The following code

```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage[left=1.5in, right=1.5in, top=0.5in]{geometry}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\theoremstyle{remark}
\begin{document}
\title{Extra Credit}
\maketitle
\begin{definition}
If f is analytic at $z_0$, then the series
$$f(z_0) + f'(z_0)(z-z_0) + \frac{f''(z_0)}{2!}(z-z_0)^2 + \cdots = \sum_{n=0}^{\infty} \frac{f^{(n)}(z_0)}{n!}(z-z_0)^n \hspace{1cm}(1)$$
is called the Taylor series for f around $z_0$.
\end{definition}
\begin{theorem}
If f is analytic inside and on the simple closed positively oriented contour $\Gamma$ and if $z_0$ is any point inside $\Gamma$, then
$$f^{(n)}(z_0) = \frac{n!}{2\pi i} \int_{\Gamma} \frac{f(\zeta)}{(\zeta - z_0)^{n+1}}d\zeta \hspace{1cm} (n=1,2,3, \cdots )$$ \hfill (2)
\end{theorem}\hrulefill
```

How can I align the (1) and (2), and also get (2) to be on the same line as (n=1,2,3,…)?

## Best Answer

I highly suggest to use a different approach:

Please read the comments in the code and What are the differences between $$, \[, align, equation and displaymath?. Other useful staff is written in https://ctan.org/pkg/short-math-guide, https://ctan.org/pkg/lshort-english, and What are good learning resources for a LaTeX beginner?.