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 2xputs the radical over the 2 only, which leaves the x outside it. Use\sqrt{2x}for a root over both. - Missing $:
\sqrtoutside 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.