0

I solved a question and I wrote it in Latex, but the equality sign is not aligned, I searched google, but none of the ways there worked with me. How do I get the equality signs aligned in the below?


Code:

\item Let $C$ be the boundary of the rectangle $[0,1]\times [3,4].$ Use Green's theorem to find $\oint_{C}{\bf{F}}\cdot d{\bf{s}},$ where ${\bf{F}}=[x-y,x^2].$
Solution
    $$\oint_{C}{\bf{F}}\cdot d{\bf{s}} =\iint_{R}\frac{\partial f_{2}}{\partial x}-\frac{\partial f_{1}}{\partial y}$$\\
    $$=\int^{1}_{0}\int^{4}_{3}2x-1 \,dydx$$
    $$=\left.\int_{0}^{1}2xy-y\right]^{4}_{3} \,dx$$
    $$=\int_{0}^{1}\left(8x-4\right)-\left(6x-3\right) \,dx$$
    $$=\int_{0}^{1}2x-1 \,dx$$
    $$=\left.x^{2}-x\right]_{0}^{1}$$
    $$=\left(1-1\right)-\left(0-0\right)$$
    $$=0$$\\
Torbjørn T.
  • 206,688
  • Are you trying to align all those = ? Note that the \item is clearly not working, probably because it is outside $ . You are using $$ for most of the material and that automatically centres. – almagest May 26 '16 at 16:58
  • @almagest i know that using $$ for the material make it automatically centres,but i want the equality sign in particular to be align ,like each equal is straight under the other one –  May 26 '16 at 17:10
  • Does that work? – almagest May 26 '16 at 17:29

1 Answers1

4

You should use amsmath and its align* environment.

Please, note also other fixes: punctuation should be outside inline math formulas; the command \bf has been obsolete for several years and \mathbf should be preferred; \left. <terms> \right] for evaluation of integrals is better done with \Bigr] (or other size); with the \diff command, differentials are typeset better and easier.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\diff}{\mathop{}\!d}

\begin{document}

\begin{enumerate}

\item Let $C$ be the boundary of the rectangle $[0,1]\times [3,4]$.
      Use Green's theorem to find $\oint_{C}{\bf{F}}\cdot \diff\mathbf{s}$,
      where ${\bf{F}}=[x-y,x^2]$.

Solution
\begin{align*}
\oint_{C}\mathbf{F}\cdot\diff\mathbf{s} 
 &= \iint_{R}\frac{\partial f_{2}}{\partial x}-\frac{\partial f_{1}}{\partial y} \\
 &= \int^{1}_{0}\int^{4}_{3}2x-1 \diff y\diff x \\
 &= \int_{0}^{1}2xy-y\Bigr]^{4}_{3} \diff x \\
 &= \int_{0}^{1}(8x-4)-(6x-3) \diff x \\
 &= \int_{0}^{1}(2x-1) \diff x \\
 &= x^{2}-x\Bigr]_{0}^{1} \\
 &= (1-1)-(0-0) \\
 &=0
\end{align*}

\end{enumerate}

\end{document}

enter image description here

egreg
  • 1,121,712