Written and maintained by CASRAI Editorial Board
Last updated
Short answer: in LaTeX math mode, write a square root with \sqrt{...}, for example $\sqrt{x^2+1}$, and an nth root with an optional argument, \sqrt[n]{x}. This guide is for researchers and analysts typesetting equations in papers, theses and reports; it covers both forms, the math-mode delimiters they need, how to nudge a root index with amsmath, and the norm and set-notation questions that usually come up alongside it.
What LaTeX is used for in research
LaTeX is a document-preparation system widely used for papers, theses and reports that contain mathematical notation. Equations are written as plain-text commands inside math mode, which is why a square root is a command rather than a symbol you type. See the related CASRAI guides on MathJax and LaTeX in web pages and Greek symbols in LaTeX.
Install or access
Overleaf’s “Learn LaTeX in 30 minutes” describes two ways to start. You can start a new project in Overleaf, an online editor, and view the result by recompiling the document (the Recompile button, or Auto Compile), which converts the LaTeX commands and text into a typeset PDF. Or you can create a new .tex file on your own computer and install your own local LaTeX setup, for which that page points to TeX Live. The page does not give installation steps, so follow the instructions published by the distribution you choose.
Every example below goes between \begin{document} and \end{document} in a file that begins like this minimal skeleton from the same Overleaf page:
\documentclass{article}
\begin{document}
First document. This is a simple example, with no
extra parameters or packages included.
\end{document}
Step by step: typeset a square root
- Open a new project in Overleaf, or a new
.texfile in your local setup, containing the skeleton above. - Choose a math-mode delimiter (see the table below). For an inline formula,
$ ... $is the simplest. - Inside it, type
\sqrtfollowed by the radicand in braces:$\sqrt{x^2+1}$. - For a root other than the square root, add the index in square brackets before the braces:
$\sqrt[3]{x}$. - If you use the amsmath adjustments described later, add
\usepackage{amsmath}to the preamble, before\begin{document}. - Recompile the document and check the output.
Output and how to read it
Compiling produces a PDF. Inline, $\sqrt{x^2+1}$ appears within the line of text with a radical sign drawn over the whole radicand. In display mode the same formula is centred on its own line. A numbered equation also gets an equation number. If a root instead appears as literal text such as \sqrt{x}, or compilation stops with an error, see Troubleshooting below.
Square root and nth root syntax
Square root: \sqrt{}
Put the radicand in braces after \sqrt. Overleaf’s documentation on mathematical expressions uses \sqrt{x^2+1} as its root example, both inline and in display mode.
The distance is $\sqrt{x^2+1}$.
\[
\sqrt{x^2+1}
\]
nth root: \sqrt[n]{}
The root index goes in square brackets before the braces: \sqrt[3]{x} is a cube root. The amsmath user’s guide (section 4.6, Roots) uses \sqrt[\beta]{k} as its example of an indexed root. Overleaf’s mathematical-expressions page, which several top results rely on, shows only the plain square root, so the optional index is worth knowing.
$\sqrt[3]{x}$ and $\sqrt[n]{a+b}$
Math mode delimiters: inline versus display
A root only renders inside math mode. Overleaf lists three ways to open inline math (\( ... \), $ ... $ and \begin{math} ... \end{math}) and three for display math (\[ ... \], \begin{displaymath} ... \end{displaymath} and \begin{equation} ... \end{equation}), noting that for inline math they all work and the choice is a matter of taste. Of the display forms, equation numbers the formula.
| Delimiter | Kind | Numbered? |
|---|---|---|
\( ... \), $ ... $, \begin{math} |
Inline | No |
\[ ... \], \begin{displaymath} |
Display | No |
\begin{equation} |
Display | Yes |
Source: Overleaf, Mathematical expressions (read 2026-11-07).
Adjusting the root index with amsmath
The amsmath guide notes that the placement of the index in an ordinary LaTeX root is sometimes not so good, and provides \leftroot and \uproot inside the optional argument to adjust it. Its example, \sqrt[\leftroot{-2}\uproot{2}\beta]{k}, moves the beta up and to the right; a negative \leftroot value moves the index to the right.
\usepackage{amsmath} % in the preamble
...
$\sqrt[\leftroot{-2}\uproot{2}\beta]{k}$
What is the symbol for the norm in LaTeX?
Use double vertical bars. Overleaf’s brackets documentation writes this as \|x+y\|. The amsmath package also provides \lVert and \rVert, and its guide recommends defining a macro in the preamble so the notation is used consistently:
\providecommand{\norm}[1]{\lVert#1\rVert}
...
$\norm{x}$
The same guide points out that the bar | serves as divides, absolute value and “such that” in set notation, and advises a one-to-one mapping between notation and symbol. For delimiters that scale with their contents it mentions \DeclarePairedDelimiter from the mathtools package. See also vertical lines in LaTeX.
How do I write set notation in LaTeX?
Set braces must be escaped, because bare braces are used for grouping: write \{ x+y \}, as in the Overleaf brackets documentation. Overleaf’s symbol table also lists \subset, \supset, \subseteq, \supseteq, \cup and \cap. To size the braces to their contents, use \left\{ ... \right\}; \left and \right must always be paired, and \right. supplies an invisible closing delimiter.
$A = \left\{ x \mid x > 0 \right\}$
For intersection specifically, see LaTeX set intersection.
Free alternatives
| Option | What it is | Where the root command fits |
|---|---|---|
| Overleaf | Online LaTeX editor; you recompile to produce a PDF | Same \sqrt{} syntax as this guide |
| A local LaTeX setup (Overleaf’s page points to TeX Live) | LaTeX installed on your own computer, using .tex files |
Same \sqrt{} syntax as this guide |
| MathJax | Displays mathematics on web pages from TeX, MathML or AsciiMath input | MathJax’s own sample page renders \sqrt{b^2-4ac}; its default TeX delimiters are \(...\) for inline and $$...$$ or \[...\] for display |
The sources read for this page do not state pricing or licence terms for any of these options, so check each provider’s own terms before relying on them. For MathJax in web pages, see MathJax and LaTeX in web pages.
Troubleshooting
- The root prints as literal text: the command is outside math mode; wrap it in one of the delimiters above.
- The index sits badly: load amsmath and use
\leftrootand\uproot. - “Missing \right” or similar error: every
\leftneeds a matching\right, even if one side should be invisible (\right.). - Braces disappear in a set: escape them as
\{and\}. - Odd spacing around symbols: see spacing in LaTeX.
FAQ
Is LaTeX difficult to learn?
The commands in this guide (\sqrt, delimiters, braces) are short and can be learned one at a time; most of the effort is remembering which commands exist, which is why reference tables such as Overleaf’s are commonly used.
What is LaTeX used for?
Typesetting documents that contain mathematics, such as papers, theses and reports; see the section above.
How do I write an nth root?
Use \sqrt[n]{x}.
What is the symbol for the norm?
\|x\|, or \lVert x \rVert with amsmath.
Sources
- Overleaf, Mathematical expressions (read 2026-11-07).
- Overleaf, Brackets and Parentheses (read 2026-11-07).
- Overleaf, Learn LaTeX in 30 minutes (read 2026-11-07).
- AMS/LaTeX Project, User’s Guide for the amsmath Package, sections 4.6 and 4.14.2 (read 2026-11-07).
- MathJax documentation, Mathematics in a web page (read 2026-11-07).







