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 Notasi Tensor →

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 poweredTulis LaTeX menggunakan AI

Editor LaTeX AI Terbaik, Alternatif Overleaf

Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI

  • Jana diagram TikZ yang cantik menggunakan AI
  • Muat naik imej dan tukar ke LaTeX dengan lancar
  • Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan