% LESSON FIVE
          
\documentclass{amsart}
\thispagestyle{empty}
\begin{document}
             
\begin{center}
	\textbf{Lesson Five: Alignment, Part Two - Labels and Annotation}
\end{center}  

% Below, the & marks the alignment point, and the && indicates the annotation.
\noindent Suppose that $f(x)=1/x$. 
Compute $f'(x)$ using the limit definition of the derivative.
\begin{align}
f'(x) &= \lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \label{limitdefn} 
  && \text{This is the limit definition.} \\
&= \lim_{h\to 0}\frac{\frac{1}{x+h}-\frac{1}{x}}{h} \\
&= \lim_{h\to 0}\frac{\frac{x}{(x+h)(x)}-\frac{x+h}{(x+h)(x)}}{h} 
  \label{commondenom} &&\text{Get a common denominator.}\\ 
% \label{commondenom} allows us to refer back to this line by number later.
&= \lim_{h\to 0}\frac{\frac{x-(x+h)}{(x+h)(x)}}{h} \label{parentheses} 
  &&\text{Combine the fractions.} \\ 
&= \lim_{h\to 0}\frac{\frac{-h}{(x+h)(x)}}{h} && \text{Cancel the $x$'s.} \\ 
&= \lim_{h\to 0}\frac{\frac{-1}{(x+h)(x)}}{1} && \text{Cancel the $h$'s.}\\ 
&= \frac{-1}{(x)(x)} \\
&= -\frac{1}{x^2}
\end{align}

Note that in (\ref{limitdefn}), some professors will (properly!) like you 
to include the phrase ``provided this limit exists.''

The key algebra step was to get a common denominator in (\ref{commondenom}).
% When a reference changes, you may have to typeset the document twice in a row
%  in order to see the number appear correctly.

A common error is to forget the parentheses around the $x+h$ in (\ref{parentheses}).

% It's possible to use multiple alignment points. The first & marks the 
%  first alignment point, the second & is the column separator, 
%  the third & marks the second alignment point, and so on.

% A variation on the 'align' environment is the 'flalign' environment, 
%  which shows the leftmost columns as far to the left as possible and 
%  the rightmost column as far to the right as possible.

\end{document} 
