CorTeX DocsOpen CorTeX
Open CorTeX
Browse all topics

Write subscripts, fractions, and roots

Build common mathematical expressions with grouping, scripts, fractions, and radicals.

On this page

Subscripts use _, superscripts use ^, and braces group every multi-token script or command argument. Most surprising results on this page come from omitting a pair of braces.

Group the whole mathematical unit#

In the square-root example below, assume a > 0 when calling √a the positive solution. For a = 0, that solution is zero; for negative real a, there is no real square root.

Compare x_n+1, which means “x with subscript n, then plus one,” with x_{n+1}, whose entire subscript is (n+1). Write both a subscript and superscript as a_i^2 or a^2_i; the first order is often easier to read in source.

LaTeX source
\documentclass{article}
\usepackage{amsmath}
\begin{document}
For iteration \(n+1\), the normalized update is
\[
  x_{n+1}^{(j)} =
  \frac{x_n^{(j)}-\mu_j}{\sqrt{\sigma_j^2+\varepsilon}}.
\]
For \(a>0\), the positive solution of \(z^2=a\) is \(z=\sqrt{a}\), while
\(z=\sqrt[3]{a}\) denotes the real cube root. A nested ratio may be written
\[
  r = \frac{1}{1+\frac{k}{n}}.
\]
\end{document}
Compiled result
Open in CorTeX

The first display combines a grouped subscript, a parenthesized superscript, a fraction, and a square root. The second shows a nested fraction. Compile after deleting the braces around n+1; the output changes without necessarily producing an error, which is why visual inspection matters.

Balance source clarity and printed size#

\frac{numerator}{denominator} takes two required arguments. \sqrt{expression} makes a square root, while \sqrt[index]{expression} supplies an optional root index. Braces around a single token are optional for _ and ^, but consistently writing x_{i} can make later edits safer.

Fractions shrink in inline math. A simple inline ratio such as a/b may read better than \frac{a}{b}; move a nested or tall fraction to display math. Do not replace \frac with a slash when the grouping would become ambiguous.

Check common brace failures#

  • x_ij prints only i as the subscript; use x_{ij}.
  • e^-kt does not group the exponent; use e^{-kt}.
  • \frac12x works but hides the argument boundaries; prefer \frac{1}{2}x in maintainable source.
  • \sqrt x+1 places only x under the radical; use \sqrt{x+1}.

Practice by writing \(c_{i,t+1}=\sqrt[3]{a_i^2/b_t}\), then replace the radicand with a fraction using \frac. You are done when every intended multi-character script stays grouped after you change an index. Next, size brackets and choose symbols.