Math and Equations

How to Write Square Roots and Nth Roots in LaTeX

Write square roots and nth roots in LaTeX with sqrt for square and cube roots, nested radicals, sizing tips for fractions inside roots, and the surd symbol.

On this page
  1. Square roots
  2. Nth roots
  3. Nested roots
  4. Roots of fractions and display size
  5. The bare radical sign
  6. Roots versus fractional exponents
  7. Common errors

Use \sqrt{x} for a square root and \sqrt[n]{x} for an nth root. Put the whole expression under the radical inside the braces, so the bar covers all of it.

Square roots

$\sqrt{2}$ and $\sqrt{x^2 + y^2}$

The braces hold everything under the radical. The bar grows with its contents. \sqrt is part of base LaTeX, so it needs no package.

Nth roots

Put the root index in square brackets before the braces:

\[
  \sqrt[3]{8} = 2 \qquad \sqrt[n]{x}
\]

\qquad adds space between the two expressions. The index can be any expression, such as \sqrt[n+1]{x}.

Nested roots

Place one \sqrt inside another:

\[
  \sqrt{1 + \sqrt{x}}
\]

Roots of fractions and display size

A fraction inside a root is set at text size in inline math. Use \dfrac to keep it at display size:

\[
  \sqrt{\dfrac{a}{b}}
\]

How to write fractions in LaTeX covers the size rules for fractions in more detail.

The bare radical sign

\surd prints the radical sign by itself, with no bar over an expression. Use it when you need the sign alone, such as in a table of symbols. For a root over an expression, use \sqrt.

Roots versus fractional exponents

For nonnegative $x$, $\sqrt{x}$ and $x^{1/2}$ are equal, so either form can be correct. Pick the one your document uses and stay consistent.

Common errors

  • Missing braces: \sqrt 2x puts the radical over the 2 only, which leaves the x outside it. Use \sqrt{2x} for a root over both.
  • Missing $: \sqrt outside math mode gives a “Missing $ inserted” error. Wrap it in $...$.

Roots often contain fractions and sit inside larger expressions. See how to write fractions in LaTeX and sizing brackets and parentheses. For the wider set of math topics in this cluster, see the advanced mathematics guide.

The complete guide to math and equations

Advanced Mathematics in LaTeX: Operators, Theorems and Proofs
Read the guide

Keep exploring

Guides from other topics

All topics →