How to write square, cube, and nth roots in LaTeX?

Many people find it hard to write the root symbol in LaTeX at first. In this guide, we will show you how to use the \sqrt command to write the root symbol easily and correctly.

Simple step-by-step instructions are given so that even beginners can understand.

Syntax

The \sqrt command needs two pieces of information. One is the value of the root and the other is the expression. Use the following syntax:

\sqrt[n]{expression}

Shortcut for square roots

For square roots, you do not need to specify the value. LaTeX assumes it is n=2. Just put the expression inside curly braces {}.

\[ \frac{-b \pm \sqrt{b^2-4ac}}{2a} \]

\[ \frac{-b \pm \sqrt{b^2-4ac}}{2a} \]

Cube root

To represent a cube root in LaTeX, you need to specify that n=3 by placing [3] immediately after the \sqrt command. This tells LaTeX to display the radical with an index of 3.

\[ z = \sqrt[3]{\frac{x^2 + y^2}{a + b}} + \sqrt[4]{\sin^2 \theta + \cos^2 \theta} \]

\[ z = \sqrt[3]{\frac{x^2 + y^2}{a + b}} + \sqrt[4]{\sin^2 \theta + \cos^2 \theta} \]

nth or pth root

If you want to write an nth root, you must pass n as the value. For example:

\[f(n) = \sqrt[n]{\frac{1}{n}} + \frac{\sqrt[n]{n^2}}{n - 1}\]

\[f(n) = \sqrt[n]{\frac{1}{n}} + \frac{\sqrt[n]{n^2}}{n – 1}\]

Dynamic Sizing (Adjusts to Size)

A good thing about the \sqrt command is that it automatically adjusts the size of the root symbol to fit your expression. If the expression is large, the symbol grows larger. If the expression is small, the symbol becomes smaller.

\[ \sqrt{\frac{1}{n^2 + \cfrac{1}{n}}} \]

\[ \sqrt{\frac{1}{n^2 + \cfrac{1}{n}}} \]

Nested root

If you need to write a root inside another, you can do that too. Just use the \sqrt command inside another \sqrt command. For example:

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

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

Share tutorial

Leave a Comment

Your email address will not be published. Required fields are marked *