Einstein Summation in LaTeX (A^i B_i)

AiBiA^i B_i
LaTeX command
A^i B_i
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Einstein summation convention: a repeated upper and lower index is summed, so A^i B_i means the sum over i.

The convention lets A^i B_i stand for \sum_i A^i B_i, the scalar pairing of a vector with a covector, without writing the sum sign. Each summed index must appear exactly once up and once down; an index appearing three times signals an error. Free indices must match on both sides of an equation, as in v^i = T^i_j u^j. When the convention might be unfamiliar to readers, state it once and give the explicit \sum form in the first equation.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

AiBi=∑i=1nAiBiA^i B_i = \sum_{i=1}^{n} A^i B_i
\documentclass{article}
\begin{document}
Einstein Summation: $A^i B_i$

\[ A^i B_i = \sum_{i=1}^{n} A^i B_i \]
\end{document}

Related symbols

All Tensor Notation →

Frequently asked questions

How do I write Einstein Summation in LaTeX?
Type A^i B_i in math mode, for example $A^i B_i = \sum_{i=1}^{n} A^i B_i$. It works in plain LaTeX without loading any package.
Which package do I need for A^i B_i?
None. A^i B_i is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use A^i B_i in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $A^i B_i$ in running text.
Math poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers