How To Write Math Equations

Math Sandbox

If you would like to experiment writing math equations, enter your equation in the text field or edit an existing equation by clicking on a sample below. In sandbox mode, you do not need to enter [math] and [/math]. Your equation will show beneath the input field as you type.


How To Write Math Equations

In order for math equations to be recognized and formatted properly, they must be surrounded by special tags. When creating a question:

  • Click on the insert a math equation button. A dialog box will appear.
  • Type your equation in the field.
  • Click the insert equation button in the dialog box.

Your equation will automatically appear between [math] and [/math].

OR

  • Manually type a single equation between [math] and [/math]

Some features and limitations:

  • Multiple equations can appear in both questions and answers
  • All symbols below are case sensitive
  • [math] and [/math] are case sensitive

If you are still having trouble creating your equations after reading this guide, feel free to contact us.

Addition + (plus)

Use a plus (+) between two expressions. A leading and/or trailing space around the plus symbol will not change the image. Vertical addition requires a combination of symbols.

x+y [math]x+y[/math]
ul({:(,97),(+,234):}) [math]ul({:(,97),(+,234):})[/math]

Subtraction - (dash)

Use a dash (-) between two expressions. Subtraction with regrouping requires a combination of symbols.

x-y [math]x-y[/math]
-x [math]-x[/math]
ul({:( ,237),(-,94):}) [math]ul({:( ,237),(-,94):})[/math]

Multiplication xx (double x)

Use a double x (xx) between two expressions.

5xx3 [math]5xx3[/math]

Explicit Multiplication * (asterisk)

Use the asterisk (*) between two expressions. A double asterisk (**) produces a star.

x*y [math]x*y[/math]
x**y [math]x**y[/math]

Division -: (dash colon)

Use a dash (-) followed by a colon (:) between two expresions for division. Unfortunately, there is no long division symbol.

2bar({:)24) [math]2bar({:)24)[/math]
x-:y [math]x-:y[/math]

Parenthesis & Grouping Brackets

Below is a comma separated list of grouping brackets:

(, ), [, ], {, }, (:, :), :}, {:

{: and :} are invisible brackets.

Grouping brackets do not have to match in style.

(:x:) [math](:x:)[/math]
[x} [math][x}[/math]
{:) [math]{:)[/math]

Fractions / (slash)

There are two ways to write fractions. The first uses a double slash (//) between two expressions. This will inline the fraction. The second uses a single slash (/) between two expressions. This will stack the expressions. Remember to use parenthesis when grouping expresssions with more than one term. Parenthesis are also required when grouping multiple fractions.

x//y [math]x//y[/math]
x/y [math]x/y[/math]
(5x)/y [math](5x)/y[/math]
(a/b)/(c/d) [math](a/b)/(c/d)[/math]

Power & Exponents ^ (caret)

The expression following a caret (^) will be shown in superscript.

x^y [math]x^y[/math]

Subscript _ (underscore)

The expression following an underscore (_) will be show in subscript. Subscripts must precede superscripts.

x_y [math]x_y[/math]
int_0^1f(x)dx [math]int_0^1f(x)dx[/math]
lim_(x->oo) [math]lim_(x->oo)[/math]
H_2O [math]H_2O[/math]

Prescripts

Prescripts can be written using subscripts and superscripts. Note the use of the invisible grouping brackets: {: and :} in the example below.

{::}_92^238U [math]{::}_92^238U[/math]

Accents

Accents can be used on any expression.

bar(xy) [math]bar(xy)[/math]
vecx [math]vecx[/math]

Roots & Radicals

The expression following the text (sqrt) will be shown within a radical. The n-th root can be shown by using the word root followed by the value of n. Notice that parenthesis are not required after sqrt and root.

sqrtx [math]sqrtx[/math]
root3x [math]root3x[/math]

Functions

The following functions are supported:

sin, cos, tan, csc, sec, cot, sinh, cosh, tanh, log, ln, det, dim, lim, mod, gcd, and lcm

sin(90) [math]sin(90)[/math]

Matrices

[[a,b],[c,d]] [math][[a,b],[c,d]][/math]

You can view additional symbols for writing equations by navigating to a symbol set below.