Square Root in LaTeX (\sqrt{x})

x\sqrt{x}
LaTeX command
\sqrt{x}
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Draws a radical sign over its argument, giving the principal square root of x.

\sqrt automatically stretches the radical to cover whatever you put in braces, so \sqrt{x^2 + y^2} gets a longer vinculum and a taller sign. It is the standard way to write the Euclidean norm, the quadratic formula, and standard deviation as \sqrt{\operatorname{Var}(X)}. Radicals over arguments with different heights can look uneven; adding \vphantom{y} or \mathstrut inside makes neighboring roots match. For an index such as a cube root, use the optional argument \sqrt[3]{x}. In inline text, x^{1/2} is sometimes clearer than a radical over a tall fraction.

Minimal compilable example

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

x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\documentclass{article}
\begin{document}
Square Root: $\sqrt{x}$

\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
\end{document}

Related symbols

All الرموز الرياضية →

Frequently asked questions

How do I write Square Root in LaTeX?
Type \sqrt{x} in math mode, for example $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. It works in plain LaTeX without loading any package.
Which package do I need for \sqrt{x}?
None. \sqrt{x} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \sqrt{x} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\sqrt{x}$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

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

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

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