Documentation/Mathematical Typesetting/How to Write Equations in LaTeX
Mathematical Typesetting

How to Write Equations in LaTeX

LaTeX is the gold standard for typesetting mathematics. Whether you need a simple inline formula or a complex multi-line derivation, LaTeX makes it look professional.

Inline Math

Wrap math in dollar signs to include it within text:

The equation $E = mc^2$ describes mass-energy equivalence.

The area of a circle is $A = \\pi r^2$.
Output: Math formulas appear inline within the sentence text.

Display Equations

For standalone, centered equations use \[ ... \] or the equation environment:

% Unnumbered display equation
\\[ F = G \\frac{m_1 m_2}{r^2} \\]

% Numbered equation
\\begin{equation}
  a^2 + b^2 = c^2
\\end{equation}
Output: Equations appear centered on their own line, the second one with an automatic number.

Fractions, Subscripts, and Superscripts

The building blocks of mathematical notation:

% Fractions
$\\frac{a}{b}$ and $\\frac{x+1}{x-1}$

% Subscripts (use _)
$x_1, x_2, x_{10}$

% Superscripts (use ^)
$x^2, e^{i\\pi}, a^{n+1}$

% Both together
$\\sum_{i=1}^{n} x_i = x_1 + x_2 + \\cdots + x_n$
Output: Properly typeset fractions, subscripts, superscripts, and summation.

Common Symbols

Frequently used math symbols in research papers:

% Greek letters
$\\alpha, \\beta, \\gamma, \\theta, \\lambda, \\sigma, \\omega$

% Operators
$\\times, \\div, \\pm, \\leq, \\geq, \\neq, \\approx$

% Calculus
$\\int_0^1 f(x)\\,dx \\quad \\frac{dy}{dx} \\quad \\nabla f$

% Sets
$\\in, \\notin, \\subset, \\cup, \\cap, \\emptyset$

Multi-line Equations

Use the align environment for equations aligned at the equals sign:

\\usepackage{amsmath}

\\begin{align}
  (x + y)^2 &= (x + y)(x + y) \\\\
             &= x^2 + xy + yx + y^2 \\\\
             &= x^2 + 2xy + y^2
\\end{align}
Output: Three lines aligned at the = sign, each automatically numbered.

💡 Tips

  • •Always load \usepackage{amsmath} — it's essential for serious math typesetting
  • •Use \[ ... \] instead of $$ ... $$ for display equations (better spacing)
  • •Use \text{if } inside math mode for words: $f(x) = 0 \text{ if } x < 0$
  • •For multi-character subscripts, always use braces: $x_{max}$ not $x_max$

Try This in Bibby AI

Write LaTeX faster with AI auto-complete and instant compilation.

Start Writing Free

Related Tutorials

How to Write Equations in LaTeX | Bibby AI | Bibby AI