Skip to main content

Subscripts and Superscripts

Introduction

The use of superscripts and subscripts is very common in mathematical expressions involving exponents, indices, and some special operators. This article will explain how to write superscripts and subscripts in simple expressions, integrals, summations, etc.

Definite integrals are some of the most common mathematical expressions, let's look at an example:

home/new.tex
\[ \int\limits_0^1 x^2 + y^2 \ dx \]

This LaTeX code produces:

By convention, superscripts and subscripts in LaTeX are created using the characters ^ and _ respectively; for example, exponents are applied to x and y.

In the above code snippet. These characters can also be used with mathematical symbols, such as the integral (\int) included in the example above, where _ is used to set the lower limit and ^ is used to set the upper limit.

The command \limits changes how limits are displayed in integrals; without it, the limits would be next to the integral symbol instead of at the top and bottom:

home/new.tex
\[ \int_0^1 x^2 + y^2 \ dx \]

Open this example in Overleaf.

This LaTeX code produces:

More Detailed Examples

The symbols _ and ^ can also be combined in the same expression, for example:

home/new.tex
\[ a_1^2 + a_2^2 = a_3^2 \]

Open this example in Overleaf.

This LaTeX code produces:

If an expression contains long superscripts or subscripts, they need to be collected in braces because LaTeX normally applies the mathematical commands ^ and _ only to the following character:

home/new.tex
\[ x^{2 \alpha} - 1 = y_{ij} + y_{ij} \]

Open this example in Overleaf.

This LaTeX code produces:

Subscripts and superscripts can be nested and combined in various ways. However, when nesting subscripts/superscripts, remember that each command must refer to a single element; this can be a single letter or number, as in the examples above, or a more complex mathematical expression collected in braces or parentheses. For example:

home/new.tex
\[ (a^n)^{r+s} = a^{nr+ns} \]

Open this example in Overleaf.

This LaTeX code produces:

Operators Using Subscripts and Superscripts

Some mathematical operators may require subscripts and superscripts. The most common cases are the integral \int (check the introduction) and summation (\sum) operators, whose bounds are precisely typeset with subscripts and superscripts.

home/new.tex
\[ \sum_{i=1}^{\infty} \frac{1}{n^s}
= \prod_p \frac{1}{1 - p^{-s}} \]

Open this example in Overleaf.

This LaTeX code produces:

For other commonly used operators that require subscripts/superscripts, check the reference guide.

Open all code snippets in Overleaf Use the following link to open all the above examples as a single Overleaf project:

home/new.tex
Here are some examples of simple usage of subscripts and superscripts:

\[ \int\limits_0^1 x^2 + y^2 \ dx \]

\vspace{1cm}

Using superscript and subscripts in the same expression

\[ a_1^2 + a_2^2 = a_3^2 \]

\vspace{1cm}

Longer subscripts and superscripts:

\[ x^{2 \alpha} - 1 = y_{ij} + y_{ij} \]

\vspace{1cm}

Nested subscripts and superscripts

\[ (a^n)^{r+s} = a^{nr+ns} \]

\vspace{1cm}

Example of a mathematical equation with subscripts and superscripts

\[ \sum_{i=1}^{\infty} \frac{1}{n^s} = \prod_p \frac{1}{1 - p^{-s}} \]

\vspace{1cm}

Squared root usage

\[ \sqrt[4]{4ac} = \sqrt{4ac}\sqrt{4ac} \]

Open all the above examples as an Overleaf project.

Reference Guide Other Examples and Operators

LATEX标记 渲染为 a_{n_i} {\displaystyle a_{n_{i}}} \int_{i=1}^n {\displaystyle \int {i=1}^{n}} \sum{i=1}^{\infty} {\displaystyle \sum {i=1}^{\infty }} \prod{i=1}^n {\displaystyle \prod {i=1}^{n}} \cup{i=1}^n {\displaystyle \cup {i=1}^{n}} \cap{i=1}^n {\displaystyle \cap {i=1}^{n}} \oint{i=1}^n {\displaystyle \oint {i=1}^{n}} \coprod{i=1}^n {\displaystyle \coprod _{i=1}^{n}} There are also commands similar to cup and cap: bigcup and bigcap, but these commands are used for larger expressions.

Further Reading

For more information, see

希腊字母和数学符号列表 运营商 积分、总和和极限 数学字体 括号和括号 伟大的大LATEX符号列表(amssymb包中可用数学符号的完整列表) LATEX2ε的介绍不那么简短 将方程与amsmath对齐