Hi, thaught it may be of some use:
Introduction to LaTeX: 2. Typing Math
Introduction to LaTeX: 2. Typing Math
Text and math modes (review from Part 1)
TeX has three basic modes: a text mode, used for typesetting ordinary text,
and two types of math modes, an ordinary math mode for math formulas set
inline, and a display math mode, used for displayed math formulas. At any
given point during the processing of a document, TeX is in one of those three
modes. The behavior of TeX depends on the mode it's in. For example, certain
characters (like the underline or caret symbols) are only allowed in a math
mode, while others (like the greater than symbol) take on completely
different meanings, depending on whether TeX is in text or in math mode. (Try
this: write some ordinary text that includes the string From (which is often
generated by email software), and see what the symbol becomes after
compiling the document. In math mode, by contrast, does what you'd expect:
it serves as the greater than symbol.)
Text mode.
This is the normal, or default, mode of TeX. TeX stays in that mode unless it
encounters a special instruction that causes it to switch to one of the math
modes, and it returns to text mode following a corresponding instruction that
indicates the end of math mode.
Ordinary (inline) math mode.
Mathematical material to be typeset inline must be surrounded by single dollar
signs. For example: $a^2 + b^2 = c^2$. The single dollar signs surrounding
this expression cause TeX to enter and exit (ordinary) math mode.
Display math mode.
Material that is surrounded by a pair of escaped brackets (\[ and \]), or
by equation environments such as \begin{align} ... \end{align}, or
\begin{equation} ... \end{equation} is being processed by TeX in display math
mode. This means that the expression enclosed gets displayed on a separate
line (or several lines, in case of multiline equations). Longer mathematical
formulas and numbered formulas are usually displayed in this manner. Note
that the commands for entering and leaving display math mode are distinct
(\begin{...} or \[ for entering and \end{...} or \]), in contrast to the
ordinary math mode, where a single dollar sign serves both as entry and exit
command. This allows for better error checking. (This is a major difference
between LaTeX and AmSTeX or Plain TeX. In the latter two TeX versions, a double
dollar sign ($$) is used to indicate the beginning and end of display math
mode.
While the double dollar sign (still) works in LaTeX, it is not part of the
official LaTeX command set (in fact, most books on LaTeX don't even mention
it) and its use is discouraged. Use the bracket pair \[, \] instead.
)
Basic math
Elementary arithmetic operations:
The plus (+), minus (-), division (/) symbols have the usual meaning. To
denote multiplication explicitly (this is rarely necessary), use \cdot
(producing a centered dot) or \times (producing an x). The equal, less
than, and greater than symbols on the keyboard work as expected; to get
less than or equal, use \le; similarly, \ge gives greater than or
equal.
Square roots: Square roots are generated with the command \sqrt{...}. For
example, $z=\sqrt{x^2+y^2}$.
Subscripts and superscripts:
These are indicated by carets (^) and underscores (_), as in $2^n$ or $a_1$.
If the sub/superscript contains more than one character, it must be enclosed in
curly braces, as in $2^{x+y}$.
Fractions and binomial coefficients:
Fractions are typeset with $\frac{x}{y}$, where x stands for the numerator and
y for the denominator. There is a similar construct $\binom{x}{y}$ for binomial
coefficients. (The latter is part of the amsmath enhancements which you get
when using amsart as documentclass.)
Sums and integrals:
The symbols for sums and integrals are \sum and \int, respectively. These are
examples of large operators, and their sizes are adjusted by TeX
automatically, depending on the context (e.g., inline vs. display math). Note
that the symbol generated by \sum is very different from the cap-Sigma
symbol, \Sigma; the latter should never be used to denote sums. TeX uses a
simple, but effective scheme to typeset summation and integration limits:
Namely, lower and upper limits are specified as sub- and superscripts to \sum
and \int. For example, $\sum_{k=1}^n k = \frac{n(n+1)}{2}$. (Note that the
lower limit k=1 here must be enclosed in braces.)
Limits:
The subscript trick works also for limits; \lim produces the lim symbol,
and the expression underneath this symbol (for example, x tends to infinity)
is typeset as a subscript to \lim: $\lim_{x\to\infty}f(x)=0$. Here \to
produces the arrow, and \infty (note the abbreviation - \infinity does not
work!) produces the infinity symbol. \limsup and \liminf work similarly,
as do \sup and \inf (for supremum and infinimum), and \max and \min
(for maximum and minimum). For example, $\max_{0\le x\le 1}x(1-x)=1/4$.
block quote