Variance in LaTeX (\text{Var}(X))

Var(X)\text{Var}(X)
LaTeX command
\text{Var}(X)
Package
Add to your preamble:\usepackage{amsmath}
Mode
Text and math mode

Where it is used

Variance of X, the expected squared deviation from its mean, with an upright label.

The usual identities are \text{Var}(X) = \mathbb{E}[(X - \mu)^2] = \mathbb{E}[X^2] - \mu^2 and \text{Var}(aX + b) = a^2\text{Var}(X). \text{Var} looks right in most places, but inside italic theorem text the label turns italic too, because \text copies the surrounding font. \operatorname{Var} or a preamble \DeclareMathOperator{\Var}{Var} is more robust and spaces correctly. Some authors write \mathbb{V}, \sigma^2 or \mathrm{Var} instead. For independent variables, variances add: \text{Var}(X+Y) = \text{Var}(X) + \text{Var}(Y), while the general case adds twice the covariance.

Minimal compilable example

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

Var(aX+b)=a2 Var(X)\text{Var}(aX + b) = a^2 \, \text{Var}(X)
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Variance: $\text{Var}(X)$

\[ \text{Var}(aX + b) = a^2 \, \text{Var}(X) \]
\end{document}

Related symbols

All الاحتمالات والإحصاء →

Frequently asked questions

How do I write Variance in LaTeX?
Type \text{Var}(X) in math mode, for example $\text{Var}(aX + b) = a^2 \, \text{Var}(X)$. Load amsmath first with \usepackage{amsmath}.
Which package do I need for \text{Var}(X)?
\text{Var}(X) needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
Can I use \text{Var}(X) in text mode, or only in math mode?
Both. \text{Var}(X) compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث