How to typeset an equation

You can always use the Math Editor to create an equation easily. It’s under the gear-icon on the toolbar at the top of every composition window, and will take care of almost everything for you.
Bonus tip: If you press and hold some keys, you’ll see other options appear. For example, pressing the x-key shows other options like x^2 and \dfrac{1}{x}.

As you use the Math Editor, you’ll start to see how it creates the rendered-math you see in posts, and will probably want to start “writing math” more directly without using the Editor. Here’s how!

Writing an equation is easy and will render automatically. Please feel free to try all of these in a draft topic of your own:

• Surround the equation with a single dollar sign if you want your equation to be inline with the rest of a sentence. For example, $f(x) = x + \pi$ renders as: f(x) = x + \pi.

• Surround the equation with double dollar signs, each on their own line, if you want to have the equation sit on its own line, known as a “display equation.” For example,

$$c^2 = a^2 + b^2$$


renders as

c^2 = a^2 + b^2
• To write a superscript, use ^. For example, $x^2$ renders as x^2. If you have more than one character in your superscript, you must surround them with { }. For example, $x^{99}$ renders as x^{99}.

• To write a subscript, use _. For example, $x_i$ renders as x_i. If you have more than one character in your subscript, you must surround them with { }. For example, $p_{1,i}$ renders as p_{1,i}.

• You can combine commands. For example, $x_i^2$ renders as x_i^2.

• For a square root, use $\sqrt{ }. For example, $\sqrt{4} = 2$ renders as \sqrt{4} = 2. • For a fraction, use \frac{a}{b}. For example, $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ renders as x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}. • For \pm, use $\pm$. For \ge, use \ge$ (greater than or equal). For \le, use \le$ (gess than or equal). For \ne, use $\ne$(not equal) . • For a greek letter, use a slash \ and the letter name. For example, $\pi$ is \pi, $\Delta$ is \Delta, and $\theta$ is \theta. • For a named function, use a slash and then the function name. For example,$\sin(\pi/2)$ renders as \sin(\pi/2) and $\ln(x)$ renders as \ln(x). • Calculus has a few special names. For example, $\lim_{x \to 2}$ renders as \lim_{x \to 2}. And $\int_a^b f(x)dx\$ renders as \int_a^b f(x)\,dx.

You can always use the Math Editor to generate symbols you don’t know. And for more symbols and information about how to write nice-looking math that everyone can easily understand, please visit MathJax basic tutorial and quick reference.

Bonus tip: To see the LaTeX code behind any rendered equation, right-click on the equation, and choose “Show Math As > TeX Commands.” You can then copy that code, and modify it to quickly create a similar looking equation. Give it a try!

Technical information: When you use the above commands, you’re using a math-writing coding language known as LaTeX. We render the LaTeX on this site using tools provided by MathJax, and are grateful for their ongoing work and support!