Writing steps in an equation

I usually advise against longish enumerate items in a proof; the indent at the start of a paragraph followed by a number is sufficient to mark a step. If the proof is longer than one page, the page would be very uneven.

1. Using the previous property,
\begin{align*}
\abs{\mathbf{x} + \mathbf{y}}^2
&= (\mathbf{x} \cdot \mathbf{y}) \cdot (\mathbf{x} \cdot \mathbf{y}) \\
&= \sum_{i=1}^k (x_i + y_i)(x_i + y_i)
   \quad\text{(by the definition of inner product)}\\
&= \sum_{i=1}^k (x_i^2 + 2 x_i^{} y_i^{} + y_i^2) \\
&= \mathbf{x} \cdot \mathbf{x}
   + 2 \mathbf{x} \cdot \mathbf{y}
   + \mathbf{y} \cdot \mathbf{y} \\
&\leq \abs{\mathbf{x} \cdot \mathbf{x}}
      + 2 \abs{\mathbf{x} \mathbf{y}}
      + \abs{\mathbf{y} \cdot \mathbf{y}} \\
&\leq \abs{\mathbf{x}} \abs{\mathbf{x}}
      + 2 \abs{\mathbf{x}} \abs{\mathbf{y}}
      + \abs{\mathbf{y}} + \abs{\mathbf{y}}
      \quad\text{(by Property 4)} \\
&= (\abs{\mathbf{x}} + \abs{\mathbf{y}})^2,
\end{align*}
and since both sides are $\geq 0$, we can take the square root.

enter image description here

A tip: notice that in the third line of the alignment I wrote

x_i^2 + 2 x_i^{} y_i^{} + y_i^2

with empty exponents, that will lower the subscripts at the same height as the others on the line.


In the following example, the environment align and the command \intertext from the package amsmath are used to get the "nice formatting".

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{enumerate}

\item
First, we will show that
\begin{align*}
x^8-y^8 &= (x^4+y^4)(x^4-y^4),
\intertext{where we used the relation $a^2-b^2=(a+b)(a-b)$, and we can continue:}
&= (x^4+y^4)(x^2+y^2)(x^2-y^2)
\\
&= (x^4+y^4)(x^2+y^2)(x+y)(x-y).
\end{align*}

\item
Second item.

\end{enumerate}

\end{document}

Tags:

Equations