LESSON 5: Cross Referencing Equations, Name:
As you now know math mode can be turned on and off several different ways. The in-text
math mode can be turned on and off using $ $ and displayed mode can be turned on and
off by $$ $$ or \[ \]. But both of sometimes we want displayed equations with equation
numbers so we can refer to them later in a paper. The simplest way to do this for a one line
equation is with the equation environment.
Consider the second order polynomial
equation
\begin{equation}
ax^2+bx+c=0. \label{eq1}
\end{equation}
The equation (\ref{eq1}) is called
a quadratic equation. The solution
to \eqref{eq1} is given by
\begin{equation}\label{eq2}
x=\frac{-b \pm \sqrt{b^2-4ac}}{2a}
\end{equation}
and equation \eqref{eq2} is called
the quadratic formula.
Consider the second order polynomial
equation
ax
2
+ bx + c = 0. (1)
The equation (1) is called a quadratic
equation. The solution to (1) is given by
x =
b ±
b
2
4ac
2a
(2)
and equation (2) is called the quadratic for-
mula.
Note that there are two ways to refer to an equation \ref which does not put parentheses
around the number and \eqref which do es put parentheses around the number but is only
available if you use the amsmath package. If you did not want to use the amsmath package
but you wanted a way to get parentheses around a reference number with having to type
them you could put a statement like \newcommand\eref[1]{(\ref{#1})} (which I did in
this file). Now lets reset the equation counter to zero
\setcounter{equation}{0}
Sometimes you would like to have subequations with counters like (1a) and (1b), etc. This
is done with the subequations environment.
\begin{subequations}
\begin{equation} \label{int1}
\int_0^\pi \cos( x)\, dx = \sin( x) \big|_{0}^{\pi}=0,
\end{equation}
\begin{equation}\label{int1}
\int_0^\pi \sin( x)\, dx = - \cos( x) \big|_{0}^{\pi}= 0.
\end{equation}
\end{subequations}
produces
Z
π
0
cos(x) dx = sin(x)
π
0
= 0, (1a)
Z
π
0
sin(x) dx = cos(x)
π
0
= 0. (1b)
To make the numbering given in roman numerals, for example, we can issue a command
like
\renewcommand{\theequation}{\roman{equation}}
which allows us to get
x
2
+ y
2
= z
2
(II)
The choices that I know are Alph, alph, Roman, roman, arabic.
PROBLEM: Write L
A
T
E
Xcommands and words to display the expression
x
2
y
2
= (x + y)(x y),
give it an equation number and then write some text referring to the equation (e.g., Equation
(blah) is the difference of two squares formula).