Skip to content

Mathematics in Markdown

This post demonstrates how to use mathematical formulas in our blog posts using MathJax.

Inline Formulas

You can write inline formulas using \( and \). For example, here's Einstein's famous equation: \(E = mc^2\).

Here's another example of the quadratic formula: \(x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\)

Display Formulas

For larger formulas, you can use \[ and \] to create display-style mathematics. Here's a beautiful integral:

\[ \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} \]

Here's another example showing the definition of the derivative:

\[ f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} \]

Complex Examples

You can also write more complex mathematical expressions:

Matrix

\[ \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix} \]

Sum and Product

\[ \sum_{i=1}^n i = \frac{n(n+1)}{2} \]
\[ \prod_{i=1}^n i = n! \]

Greek Letters and Special Symbols

  • Alpha: \(\alpha\)
  • Beta: \(\beta\)
  • Gamma: \(\gamma\)
  • Pi: \(\pi\)
  • Infinity: \(\infty\)
  • Partial derivative: \(\partial\)

Equations with Numbers

You can also write equations with numbers:

\[ \begin{equation} E = mc^2 \tag{1} \end{equation} \]
\[ \begin{equation} F = ma \tag{2} \end{equation} \]

Conclusion

As you can see, we can write any kind of mathematical formula, from simple inline equations to complex mathematical expressions with matrices, integrals, and more!