Typesetting Mathematics

This blog post is a short introduction to how to type mathematical expressions using LaTeX commands. On the blogging platform we are using, this is achieved by MathJax. Some documentations can be found here.

If you have a mathematical expression to type, you may start by entering “$latex” (remove quotation marks), writing the corresponding LaTeX commands, and then closing with another “$” (again, no quotation marks).

Example: A power function takes the form f(x)=x^{a} ($latex f(x)=x^{a}$)

Most of the commands for mathematical typesetting are pretty intuitive:

Most stuff:

  • Just type them!
  • For example, 1+2=3 ($latex 1+2=3$) and f'(x) ($latex f'(x)$)

Multiplication:

  • Use \times or \cdot, but not *.
  • For example, 2 \times 3 = 6 (2 \times 3 = 6) or 2 \cdot 3 = 6 (2 \cdot 3 = 6)

Fractions:

  • Use \frac{numerator}{denominator} or \frac{numerator}{denominator}.
  • Remember to enclose the entire numerator and the entire denominator in pairs of curly brackets.
  • For example, \frac{1}{x} (\frac{1}{x}) or \dfrac{1}{x} (\dfrac{1}{x})

Exponents:

  • Use ^{exponent}.
  • Again, remember to enclose the entire exponent in a pair of curly brackets.
  • For example, e^{-2x} (e^{-2x}, but not e^-2x, because the latter will produce e^-2x)

Subscripts:

  • Use _{subscript}. This is very similar to exponents.
  • For example, P_{0} (P_{0}) or a_{10} (a_{10}, but not a_10, because the latter will produce a_10)

Roots:

  • Use \sqrt{number} for square roots, and \sqrt[n]{number} for n-th roots.
  • For example, \sqrt{10} or \sqrt[3]{10} (\sqrt{10} or \sqrt[3]{10})

Special functions:

  • Use \sin, \cos, \ln for sine, cosine, and natural log functions.
  • For example, \sin(x), \cos(x), or \ln(x) (\sin(x), \cos(x), or \ln(x))

Integrals:

  • Use \int_{a}^{b} for a definite integral with limits a and b, and use \int for an indefinite integral
  • For example, \int_a^b f(x) dx or \int f(x) dx (\int_{a}^{b} f(x) dx or \int f(x) dx)

Now let’s say you have a somewhat complicated expression to put together, see if you can map the LaTeX commands to the mathematical expression below:

\dfrac{d}{dx}[\sqrt{x^2-3x+3}] = \dfrac{2x-3}{2\sqrt{x^2-3x+3}}

\dfrac{d}{dx}[\sqrt{x^2-3x+3}] = \dfrac{2x-3}{2\sqrt{x^2-3x+3}}

Leave a Reply

Your email address will not be published. Required fields are marked *