[LaTeX] Sums, Integrals & More
category: Writing  course: LaTeX Math  difficulty:QUICK CONTENTS:
1. Fractions
2. Binomial
3. (Square) Roots
4. Sums & Products
5. Integrals
6. Logic & Set Oper...
7. Leftovers
8. Stacking Subscripts
9. Regular Superscripts
Some mathematical “functions” exist, that have their own special symbol, and aren’t written by simply using their (shortened) name. I’m talking about: fractions, binomials, (square) roots, sums, products, integrals and logic/set operations.
Fractions
A fraction is created with the command
\frac{numerator}{denominator}
Fractions can be nested within fractions as often as you like, but those nested fractions keep getting smaller and smaller, which is why I don’t recommend nesting them too deeply. If you want nested fractions to all stay at the same size, use the \cfrac{num}{denom}
(continued fraction) command.
Alternatively, if you want your fractions displayed with a diagonal slash, you can achieve this effect by means of the xfrac
package. After you’ve included it, use
\sfrac{numerator}{denominator}
\[ \frac{2}{3} \text{ or } \sfrac{2}{3} \text{ or } x^{\frac{2}{3}} \]
Binomial
The command for creating binomials – sometimes also used for column vectors – works similarly:
\binom{top}{bottom}
\[ \binom{6}{4} = \frac{6!}{4! \cdot 2!} \]
(Square) Roots
Any type of root can be created with:
\sqrt[n]{equation}
If you leave out the optional parameter, it’s a square root. Otherwise, it’s the nth root. The symbol automatically scales with the equation.
\[ \sqrt{a^2 + b^2} \ \sqrt[4]{a^2 + b^2} \]
Sums & Products
The syntax for creating a sum symbol is:
\sum_{subscript}^{superscript}
The syntax for creating a product symbol is:
\prod_{subscript}{superscript}
\[ \sum_{i=1}^{n} 2i \not= \prod_{i=1}^{n} 2i \]
Integrals
A single integral can be created with
\int_{subscript}^{superscript}
If you want more integrals, you can just place these after each other. But, if you want multiple integrals with a single subscript – for example, a double integral over an area A – you can use the \iint
, \iiint
and \iiiint
commands. These create two, three or four integrals after each other, respectively. For more integrals, you can use \idotsint
, which displays two integral symbols with the familiar dots between them.
For cyclic integrals, you need to include the esint
package. The syntax is
\oint_{subscript}^{superscript}
For a double cyclic integral, use \oiint
.
\usepackage{esint} \begin{document} % Special command to make the differential in roman letters % Not necessary, but highly recommended \newcommand*\diff{\mathop{}\!\mathrm{d}} % The actual integrals \[ \int_{a}^{b} 4x \diff x \not= \idotsint 4x \diff x \] \[ \oint_{a}^{b} 4x \diff x \not= \oiint 4x \diff x \] \end{document}
Logic & Set Operations
For operations on sets (unions and intersections), use the \bigcup
and \bigcap
commands.
For logical operations (AND and OR), use the \bigwedge
and \bigvee
commands.
\[ A \bigcup B = \left\{ x \in \mathbb{R} \middle x \in A \bigvee x \in B \right\} \] \[ A \bigcap B = \left\{ x \in \mathbb{R} \middle x \in A \bigwedge x \in B \right\} \]
Leftovers
Besides these, there are 6 other “big” symbols you can use:
Command 
Visual 











Stacking Subscripts
If you want multiple subscripts on top of each other under a big symbol, you could use the atop
command, but a much better and easier solution is at hand:
\substack{something \\ something}
\[ \sum_{\substack{ i=1 \\ i \not= j}}^{n} i \]
Regular Superscripts
A problem arises if you try to get the subscript in display style, but want the superscript in regular text style. To solve this, you can set regular (and other) superscripts for big symbols with
\sideset{left superscripts}{superscript}
\[ \sideset{_a^b}{'}\sum_{\substack{ i=1 \\ i \not= j}}^{n} i \]