To format mathematical expressions using MathJax, you can use the following steps:
Surround the mathematical expression with dollar signs () t o i n d i c a t e t h a t i t i s a n i n l i n e e x p r e s s i o n . F o r e x a m p l e , ) to indicate that it is an inline expression. For example, ) t o in d i c a t e t ha t i t i s anin l in ee x p r ess i o n . F or e x am pl e , 2x + 3 = 7$.
To display a mathematical expression on its own line, you can use double dollar signs () t o i n d i c a t e t h a t i t i s a d i s p l a y e d e x p r e s s i o n . F o r e x a m p l e , ) to indicate that it is a displayed expression. For example, ) t o in d i c a t e t ha t i t i s a d i s pl a y e d e x p 2x + 3 = 7$$.
To use mathematical symbols and operators, you can use LaTeX syntax. For example, x \sqrt{x} x , 1 2 \frac{1}{2} 2 , and .
To use mathematical functions, you can use LaTeX syntax. For example, sin ( x ) \sin(x) sin ( x ) , log ( x ) \log(x) log ( x ) , and exp ( x ) \exp(x) exp ( x ) .
To use mathematical environments, such as equations, matrices, and cases, you can use LaTeX syntax. For example,
\begin{equation*}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation*}
\begin{pmatrix}
1 & 2 & 3 \
4 & 5 & 6 \
7 & 8 & 9
\end{pmatrix}
\begin{cases}
x = 1 & \text{if } x < 0 \
x = 0 & \text{if } x = 0 \
x = -1 & \text{if } x > 0
\end{cases}
To use mathematical fonts, such as bold, italic, and bold-italic, you can use LaTeX syntax. For example, x \mathbf{x} x , x \mathit{x} x , and x \mathbf{\mathit{x}} x .
To use mathematical spacing, such as thin spaces, thick spaces, and negative spaces, you can use LaTeX syntax. For example, x y x \, y x y , x y x \; y x y , and .
\begin{align*}
x + 2 &= 5 \
x &= 3
\end{align*}
\begin{align*}
x + 2 &= 5 && \text{add 2 to both sides} \
x &= 3 && \text{subtract 2 from both sides}
\end{align*}
\begin{align*}
x + 2 &= 5 && \text{add 2 to both sides} \
x &= 3 && \text{subtract 2 from both sides} \
&&& \text{divide both sides by 3}
\end{align*}
To use mathematical notation, such as summation, product, and integral notation, you can use LaTeX syntax. For example,
\sum_{i=1}^{n} x_i
\prod_{i=1}^{n} x_i
\int_{a}^{b} f(x) , dx
To use mathematical symbols, such as Greek letters, arrows, and relation symbols, you can use LaTeX syntax. For example, α \alpha α , β \beta β , γ \gamma γ , → \to → , ⇐ \Leftarrow ⇐ , ∼ \sim ∼ , and .
\begin{pmatrix}
1 & 2 & 3 \
4 & 5 & 6 \
7 & 8 & 9
\end{pmatrix}
\begin{cases}
x = 1 & \text{if } x < 0 \
x = 0 & \text{if } x = 0 \
x = -1 & \text{if } x > 0
\end{cases}
\begin{align*}
x + 2 &= 5 && \text{add 2 to both sides} \
x &= 3 && \text{subtract 2 from both sides} \
&&& \text{divide both sides by 3}
\end{align*}
To use mathematical fonts, such as bold, italic, and bold-italic, you can use LaTeX syntax. For example, x \mathbf{x} x , x \mathit{x} x , and x \mathbf{\mathit{x}} x .
To use mathematical spacing, such as thin spaces, thick spaces, and negative spaces, you can use LaTeX syntax. For example, x y x \, y x y , x y x \; y x y , and .
\begin{align*}
x + 2 &= 5 \
x &= 3
\end{align*}
\begin{align*}
x + 2 &= 5 && \text{add 2 to both sides} \
x &= 3 && \text{subtract 2 from both sides}
\end{align*}
\begin{align*}
x + 2 &= 5 && \text{add 2 to both sides} \
x &= 3 && \text{subtract 2 from both sides} \
&&& \text{divide both sides by 3}
\end{align*}
To use mathematical notation, such as summation, product, and integral notation, you can use LaTeX syntax. For example,
\sum_{i=1}^{n} x_i
\prod_{i=1}^{n} x_i
\int_{a}^{b} f(x) , dx
To use mathematical symbols, such as Greek letters, arrows, and relation symbols, you can use LaTeX syntax. For example, α \alpha α , β \beta β , γ \gamma γ , → \to → , ⇐ \Leftarrow ⇐ , ∼ \sim ∼ , and .