0

This question already has an answer here:

I have an equation like this:

\begin{equation}
\begin{split}
|a+bi|=\sqrt{a^2+b^2}\\ 
|a+bi|^2=a^2+b^2\\
|a+bi|^2=(a+bi)(a+bi)\\
        =(a+bi)(a-bi)\\
        =a^2+b^2i^2\\
        =a^2+b^2
\end{split}
\end{equation}

the resualt looks like this:

enter image description here

How can I align this equation, that all of = symbols to be under each other

marked as duplicate by Mico, Jesse, Bernard, jub0bs, Masroor Jun 14 '14 at 11:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    You need a & before each =. – Torbjørn T. Jun 8 '14 at 13:23
2

It is preferable to use the mathtools package for this task; you should use an \lvert/\rvert construction for the delimiters. With \DeclarePairedDelimiter, you can automatically scale the delimiters by using the starred version (\abs*). Also, I have created a macro for the imaginary symbol; then you can change it all the way through just by changing the definition of the marco.

\documentclass{article}

\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\newcommand*\imag{i} % change 'i' to '\mathrm{i}' if you want an upright 'i'

\begin{document}

\noindent No equation number:
\begin{align*}
  \abs{a + b\imag}
  &= \sqrt{a^{2} + b^{2}},\\
  \abs{a + b\imag}^{2}
  &= a^{2} + b^{2},\\
  \abs{a + b\imag}^{2}
  &= (a + b\imag)(a + b\imag)\\
  &= (a + b\imag)(a - b\imag)\\
  &= a^{2} + b^{2}\imag^{2}\\
  &= a^{2} + b^{2}.
\end{align*}
A vertically centered equation number:
\begin{equation}
\begin{split}
  \abs{a + b\imag}
  &= \sqrt{a^{2} + b^{2}},\\
  \abs{a + b\imag}^{2}
  &= a^{2} + b^{2},\\
  \abs{a + b\imag}^{2}
  &= (a + b\imag)(a + b\imag)\\
  &= (a + b\imag)(a - b\imag)\\
  &= a^{2} + b^{2}\imag^{2}\\
  &= a^{2} + b^{2}.
\end{split}
\end{equation}

\end{document}

output

Note: The fifth = is wrong; it should be a^{2} - b^{2}\imag^{2}.

  • The OP has an italic “i” and I find it arbitrary using a different notation. An italic “i” for the imaginary unit is common and correct in most fields of mathematics. Using \mathit in the definition is incorrect either. – egreg Jun 10 '14 at 10:44
  • @egreg Okay. How would you define \img? I'll change it according to your suggestion. – Svend Tveskæg Jun 10 '14 at 10:52
  • It's either \mathrm{i} (which I totally dislike) or simply i. So \newcommand{\img}{i} or \newcommand{\img}{\mathrm{i}} – egreg Jun 10 '14 at 10:53
  • Okay. I'll change it to i. – Svend Tveskæg Jun 10 '14 at 10:54
1
\begin{equation*}
\begin{split}
|a+bi|  &=\sqrt{a^2+b^2}\\ 
|a+bi|^2&=a^2+b^2\\
|a+bi|^2&=(a+bi)(a+bi)\\
        &=(a+bi)(a-bi)\\
        &=a^2+b^2i^2\\
        &=a^2+b^2
\end{split}
\end{equation*}

Not the answer you're looking for? Browse other questions tagged or ask your own question.