Beginner Friendly 8 min read

LaTeX Square Root - Complete \sqrt Command Guide

⭐ Essential Math Tutorial

Learn how to write square root in LaTeX using the \sqrt{} command. This comprehensive guide covers square roots, nth roots (cube root, fourth root), nested radicals, and advanced formatting techniques for mathematical expressions.

⚡ Quick Answer

To write a square root in LaTeX:

$\sqrt{25}$  % Produces: √25 = 5

For nth roots (cube root, etc.), use: \sqrt[n]{x}

Basic \sqrt Command - Square Root Symbol

The \sqrt{} command is used to create square root symbols in LaTeX. Place the expression you want to take the square root of inside the curly braces.

Basic Syntax

% Simple square root
$\sqrt{x}$

% Square root of a number
$\sqrt{25} = 5$

% Square root with variables
$\sqrt{a^2 + b^2}$

% In display math mode
\[ \sqrt{x + y} \]

Output:

√x

√25 = 5

√(a² + b²)

Important: The \sqrt command automatically sizes the radical symbol to fit the content inside. LaTeX handles the length of the overline perfectly.

Common Square Root Examples

% Mathematical constant
$\sqrt{2} \approx 1.414$

% Pythagorean theorem
$c = \sqrt{a^2 + b^2}$

% Distance formula
$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$

% Quadratic formula component
$\sqrt{b^2 - 4ac}$

Nth Root - Cube Root, Fourth Root, and More

To create an nth root (cube root, fourth root, etc.), use the optional argument [n] in the \sqrt command.

Syntax for Nth Roots

% General syntax
\sqrt[n]{x}  % nth root of x

% Cube root (n=3)
$\sqrt[3]{8} = 2$

% Fourth root (n=4)
$\sqrt[4]{16} = 2$

% Fifth root
$\sqrt[5]{32} = 2$

% Higher roots
$\sqrt[10]{1024}$

Output:

∛8 = 2 (cube root)

∜16 = 2 (fourth root)

⁵√32 = 2 (fifth root)

Common Nth Root Examples

Root Type LaTeX Code Example Result
Square Root \sqrt{x} \sqrt{16} 4
Cube Root \sqrt[3]{x} \sqrt[3]{27} 3
Fourth Root \sqrt[4]{x} \sqrt[4]{81} 3
Fifth Root \sqrt[5]{x} \sqrt[5]{32} 2
Nth Root \sqrt[n]{x} \sqrt[n]{x^n} x

Pro Tip: When writing cube roots, many mathematicians prefer \sqrt[3]{x} over using a special cube root symbol. This maintains consistency with other root notations and is universally understood.

Nested Square Roots (Nested Radicals)

You can nest \sqrt commands inside each other to create complex radical expressions. LaTeX automatically handles the sizing and spacing.

Simple Nested Radicals

% Double nested square root
$\sqrt{\sqrt{x}}$

% Square root of a sum with a square root
$\sqrt{a + \sqrt{b}}$

% Triple nested
$\sqrt{1 + \sqrt{2 + \sqrt{3}}}$

% Famous mathematical constant
$\phi = \frac{1 + \sqrt{5}}{2}$ % Golden ratio

Output:

√(√x)

√(a + √b)

φ = (1 + √5) / 2

Complex Nested Expressions

% Nested with fractions
$\sqrt{x + \frac{1}{\sqrt{y}}}$

% Multiple nested radicals
$\sqrt{a + \sqrt{b + \sqrt{c}}}$

% Ramanujan's nested radical
$\sqrt{1 + 2\sqrt{1 + 3\sqrt{1 + 4\sqrt{1 + \cdots}}}} = 3$

% Nested with nth roots
$\sqrt{x + \sqrt[3]{y + \sqrt[4]{z}}}$

LaTeX Magic: Notice how LaTeX automatically adjusts the size of outer square roots to accommodate nested expressions. No manual sizing commands needed!

Square Roots in Fractions

Square roots commonly appear in fractions. LaTeX handles their sizing differently depending on the math style.

Square Root in Numerator

% Square root in numerator
$\frac{\sqrt{x}}{2}$

% Multiple terms
$\frac{\sqrt{a^2 + b^2}}{c}$

% Quadratic formula
$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$

Square Root in Denominator

% Square root in denominator
$\frac{1}{\sqrt{x}}$

% Rationalized form
$\frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2}$

% Complex expression
$\frac{a}{\sqrt{b^2 + c^2}}$

Display Style vs Inline Style

% Inline style (smaller, compressed)
The value is $\frac{\sqrt{x}}{2}$ which is compact.

% Display style (larger, more readable)
\[
    x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\]

% Force display style in inline math
The formula $\displaystyle\frac{\sqrt{x}}{2}$ is larger.

Typography Tip: For important equations in text, use \displaystyle to make fractions and square roots more readable: $\displaystyle\frac{\sqrt{x}}{2}$

Spacing and Formatting Tips

Spacing Around Square Roots

LaTeX handles spacing automatically, but you can adjust it when needed:

% Normal spacing (automatic)
$a + \sqrt{b}$

% Add thin space if needed
$a + \,\sqrt{b}$

% Negative thin space (rarely needed)
$a\! + \sqrt{b}$

% With parentheses
$(\sqrt{a} + \sqrt{b})^2$

Long Expressions Under Square Root

% LaTeX automatically extends the radical
$\sqrt{a + b + c + d + e + f}$

% Multiple lines under square root (not recommended)
% Better to simplify or break the equation

% With equation breaking (advanced)
\begin{align}
    x &= \sqrt{(a + b + c)} \\
      &\quad \times \sqrt{(d + e + f)}
\end{align}

Styling the Root Index

% Normal nth root
$\sqrt[n]{x}$

% Bold index (rarely needed)
$\sqrt[\mathbf{n}]{x}$

% Italic index (default in most cases)
$\sqrt[n]{x}$

% With subscript in index
$\sqrt[n_i]{x}$

Practical Examples

Example 1: Pythagorean Theorem

% Standard form
\[ c = \sqrt{a^2 + b^2} \]

% With specific values
The hypotenuse is $c = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5$.

% 3D distance
\[ d = \sqrt{x^2 + y^2 + z^2} \]

Example 2: Quadratic Formula

% Complete quadratic formula
\begin{equation}
    x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}

% Discriminant
The discriminant is $\Delta = b^2 - 4ac$.
\begin{itemize}
    \item If $\Delta > 0$: two real solutions $x = \frac{-b \pm \sqrt{\Delta}}{2a}$
    \item If $\Delta = 0$: one solution $x = \frac{-b}{2a}$
    \item If $\Delta < 0$: complex solutions
\end{itemize}

Example 3: Standard Deviation

% Population standard deviation
\[ \sigma = \sqrt{\frac{1}{N} \sum_{i=1}^{N} (x_i - \mu)^2} \]

% Sample standard deviation
\[ s = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n} (x_i - \bar{x})^2} \]

% Root mean square
\[ \text{RMS} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} x_i^2} \]

Example 4: Complex Numbers and Absolute Value

% Absolute value of complex number
\[ |z| = \sqrt{a^2 + b^2} \quad \text{where } z = a + bi \]

% Magnitude of vector
\[ \|\mathbf{v}\| = \sqrt{v_1^2 + v_2^2 + v_3^2} \]

% Euclidean norm
\[ \|x\|_2 = \sqrt{\sum_{i=1}^{n} x_i^2} \]

Example 5: Famous Mathematical Constants

% Square root of 2 (Pythagoras' constant)
$\sqrt{2} \approx 1.414213562$

% Golden ratio
$\phi = \frac{1 + \sqrt{5}}{2} \approx 1.618$

% Euler's identity relationship
$e^{i\pi/4} = \frac{1}{\sqrt{2}} + i\frac{1}{\sqrt{2}}$

% Plastic constant
$\rho = \sqrt[3]{\frac{1}{2} + \frac{1}{6}\sqrt{\frac{23}{3}}} + \sqrt[3]{\frac{1}{2} - \frac{1}{6}\sqrt{\frac{23}{3}}}$

Common Mistakes to Avoid

❌ Mistake 1: Forgetting Curly Braces

% WRONG - only takes square root of x
$\sqrt x + y$  % Produces: √x + y

% CORRECT - square root of entire expression
$\sqrt{x + y}$  % Produces: √(x + y)

❌ Mistake 2: Missing Math Mode

% WRONG - causes error
The square root of 25 is \sqrt{25}.

% CORRECT - use math mode
The square root of 25 is $\sqrt{25} = 5$.

❌ Mistake 3: Incorrect Nth Root Syntax

% WRONG - wrong bracket type
$\sqrt{3}{8}$  % This doesn't work

% CORRECT - use square brackets for index
$\sqrt[3]{8}$  % Cube root of 8

❌ Mistake 4: Overcomplicating Nested Radicals

Readability Warning: While you can nest square roots indefinitely, deeply nested radicals become hard to read. Consider simplifying complex expressions or breaking them into multiple steps.

% TOO COMPLEX - hard to read
$\sqrt{\sqrt{\sqrt{\sqrt{x}}}}$

% BETTER - use fractional exponents
$x^{1/16}$ or $x^{\frac{1}{16}}$

% OR - introduce intermediate variables
Let $y = \sqrt{x}$, then $z = \sqrt{y}$, so $w = \sqrt{z}$.

Advanced Square Root Techniques

Custom Root Symbols with \sqrt

% Variable as root index
$\sqrt[n]{x^n} = x$

% Expression as root index
$\sqrt[m+n]{x}$

% Fraction as root index (unusual but valid)
$\sqrt[\frac{1}{2}]{x} = x^2$

Square Roots with amsmath Package

\usepackage{amsmath}

% Multi-line square root (rare)
\begin{equation}
\begin{split}
x = \sqrt{
    &a^2 + b^2 + c^2 \\
    &+ d^2 + e^2 + f^2
}
\end{split}
\end{equation}

% Square root in aligned equations
\begin{align}
    a &= \sqrt{b} \\
    c &= \sqrt{d + e} \\
    f &= \sqrt{g + h + i}
\end{align}

Adjusting Root Bar Height (Advanced)

% Use \vphantom for consistent heights
$\sqrt{x} + \sqrt{y}$  % May have different heights

% Force same height
$\sqrt{x\vphantom{y}} + \sqrt{y}$  % Same height

% Useful in aligned equations
\begin{align}
    \sqrt{a\vphantom{b^2}} &= c \\
    \sqrt{b^2} &= d
\end{align}

Frequently Asked Questions

How do I write a square root in LaTeX?

Use the \sqrt{} command with the expression inside curly braces: $\sqrt{x}$ produces √x. Remember to use math mode (dollar signs or equation environments).

How do I write a cube root in LaTeX?

Use \sqrt[3]{x} for cube root. The number in square brackets specifies which root: \sqrt[3]{8} = 2 produces ∛8 = 2.

Can I nest square roots in LaTeX?

Yes! Simply place one \sqrt command inside another: \sqrt{\sqrt{x}} or \sqrt{a + \sqrt{b}}. LaTeX automatically adjusts the sizes.

How do I make the square root symbol bigger?

The square root symbol automatically sizes to fit its content. For larger display, use display math mode (\[ \]) instead of inline math ($ $), or use \displaystyle in inline math.

What's the difference between \sqrt{x} and x^{1/2}?

Both represent the same mathematical value, but \sqrt{x} uses the radical symbol (√) while x^{1/2} uses fractional exponents. Use \sqrt{} for clearer presentation of roots.

How do I write a fourth root or fifth root?

Use \sqrt[n]{x} where n is the root degree: \sqrt[4]{16} for fourth root, \sqrt[5]{32} for fifth root, etc.

Can I use square roots in text mode?

No, \sqrt only works in math mode. Always wrap it in dollar signs: $\sqrt{2}$ when using in regular text.

How do I write the square root of a fraction?

Place the \frac command inside \sqrt: \sqrt{\frac{a}{b}}. LaTeX will extend the radical symbol over the entire fraction.

Related LaTeX Math Tutorials

Create Professional Scientific Documents

Now that you've mastered square roots in LaTeX, create professional mathematical documents, research papers, and technical resumes with our templates.

Browse LaTeX Resume Templates More LaTeX Tutorials