Skip to Main Content

LaTeX for Publications: Basic Math Equations, Part II

Math Symbols

Mathematical expressions use a wide variety of symbols. Some symbols are "built-into" LaTeX. These symbols can be inserted into a math expression by simply typing them in.

+ - = ! / ( ) [ ] , . | ' :

A very complete list of symbols can be found in this document (PDF format):

• Comprehensive List of Math Symbols

Fractions

To insert a fraction, use the keyword \frac, followed by {numerator}{denominator}.
 x=\frac{a}{b} equation: x=a/b
 
 \frac{a+b}{b-c} Equation
 
 \frac{\frac{1}{a}+\frac{1}{b}}{b-c} Equation

Brackets

Brackets are essential for clarity in mathematical expressions. The characters ( ) and [ ] are easy to insert, using your keyboard. Here's a simple equation on a single line, using brackets:
(2+3)*(3+9)=60
Such an expression could be inserted into a line of text. We run into trouble, however, when trying to use simple brackets for larger, more complex expressions. The first example below shows standard bracket characters; the second example demonstrates the LaTeX feature for automatically sizing of brackets:
 
 (\frac{a^2}{b^3}) LaTeX brackets example: small brackets around the fraction - a squared over b cubed
 
 \left(\frac{a^2}{b^3}\right) Brackets example: correctly sized brackets around the fraction a square over b cubed

The second example above uses the command: \left(...\right) to create curved left and right brackets that size themselves to their contents. Alternatively square brackets can be used with the command:\left[...\right]

Overbraces and Underbraces

To create curly brackets above or below all or part of a mathematical expression, use the \overbrace and \underbrace commands, respectively.
\overbrace{a+b}^{6+7} LaTeX example - Overbrace
 
\underbrace{u'-P(x)u^2-Q(x)u-R(x)}_{\text{=0}} LaTeX example: underbrace
 
\frac{\frac{1}{a}+\frac{1}{b}}{b-c} Equation

Powers and Indices

Powers and indices are common on mathematical expressions. Powers are equivalent to superscripts in normal text, while indices are like subscripts. To add a power, use the carat ( ^ ) symbol, and for an index, use the underscore ( _ ). Remember, though, that if you need to raise (power) or lower (index) more than one character, you need to use curly braces { }.
Power  x^n Sample equation: x to the n
 
   y^{n+1} Sample equation: y to the n + 1
 
Index  b_i Sample equation: b sub i
 
   b_{ac} Sample equation b sub ac

Roots

The most common use of this feature is to show a square root, which is easy to do with this command: \sqrt{x}, though you can generalize the command to show any magnitude of root, with
\sqrt[n]{x}.

LaTeX will automatically adjust the size of the root notation to fit its contents. As the examples show, the [n] is optional and is needed only when something other than a square root is called for.
 x=\sqrt{y+5} Sample equation: x equals the square root of y+5
 
 Cube root of a fraction:
 \sqrt[3]{\frac{a^2}{9ac + \pi}}
Sample equation: cube root of a squared over 9ac+pi
 
 The Quadratic Formula:
 x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
Sample equation: Quadratic Formula

Matrices

Although LaTeX does not have a command for creating matrices, we can create a matrix using the array environment. Let's try making a few simple matrices.
 

 \left[
 \begin{array}{ c c }
    a & b \\
    c & d
 \end{array}
 \right]

Simple LaTeX matrix
 
 \left|
 \begin{array}{ c c c c }
    V_1 & V_2 & V_3 & V_4 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 9 & 0 \\
    5 & 7 & 8 & 0 \\
    a & n & x & ax^n
 \end{array}
 \right|
LaTeX simple matrix
Staff LADR