Square root in LaTeX
Use \sqrt{} for square roots and \sqrt[n]{} for nth roots.
Quick answer
latex
$\sqrt{x}$ % square root
$\sqrt{x^2 + y^2}$ % square root of expression
$\sqrt[3]{x}$ % cube root
$\sqrt[n]{x}$ % nth rootSquare root examples
latex
% Simple:
$\sqrt{4} = 2$
% Expression under the radical:
$\sqrt{x^2 + y^2}$
% Quadratic formula:
$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
% Nested roots:
$\sqrt{\sqrt{x}} = x^{1/4}$nth root
latex
$\sqrt[3]{8} = 2$ % cube root
$\sqrt[4]{16} = 2$ % fourth root
$\sqrt[n]{x^n} = x$ % general nth rootDisplay vs inline
In display mode, the radical sign automatically scales to fit the expression. In inline mode it stays small. Use \displaystyle to force large rendering inline.
latex
% Inline (small): $\sqrt{\frac{a}{b}}$
% Display (large, auto-scaled):
\[ \sqrt{\frac{a}{b}} \]
% Force display size inline:
$\displaystyle\sqrt{\frac{a}{b}}Square root without bar
For fractional exponent notation instead of the radical sign:
latex
$x^{1/2}$ % x to the power 1/2
$x^{1/n}$ % nth root as exponentAdjusting radical height
For tall expressions, LaTeX usually scales the root automatically. If needed, use \vphantom to add invisible height:
latex
% Force the radical to be taller:
$\sqrt{\vphantom{\frac{a}{b}} X + Y}