Setting up MathJax

Beautiful and accessible math in all browsers - MathJax is a JavaScript display engine for mathematics that works in all browsers. No more setup for readers. It just works. MathJax is highly modular on input and output. Use MathML, TeX, and ASCIImath as input and produce HTML+CSS, SVG, or MathML as output.

Adding MathJax to your web pages is easy to do.

If you are using a Content Management System (like Wordpress, Moodle, or Drupal) to generate your web site, there may be a plugin to add MathJax to your site already, e.g., for Wordpress or Drupal. You may need to download or activate the plugin, if one is available.

If you write your own HTML (directly or via a template/theme engine), you can include MathJax by adding this snippet to your page:

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

Below is a test to display math formula using MathJax.

When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]


When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
$$ \begin{array}{rcll}
y & = & x^{2}+bx+c\\
  & = & x^{2}+2\times\dfrac{b}{2}x+c\\
  & = & \underbrace{x^{2}+2\times\dfrac{b}{2}x+\left(\frac{b}{2}\right)^{2}}-
      {\left(\dfrac{b}{2}\right)^{2}+c}\\
  &  & \qquad\left(x+{\dfrac{b}{2}}\right)^{2}\\
  & = & \left(x+\dfrac{b}{2}\right)^{2}-\left(\dfrac{b}{2}\right)^{2}+c 
  & \left|+\left({\dfrac{b}{2}}\right)^{2}-c\right.\\
    y+\left(\dfrac{b}{2}\right)^{2}-c & = & \left(x+
    \dfrac{b}{2}\right)^{2} & \left|\strut(\textrm{vertex form})\right.\\
y-y_{S} & = & (x-x_{S})^{2}\\
S(x_{S};y_{S}) & \,\textrm{or}\, 
    & S\left(-\dfrac{b}{2};\,\left(\dfrac{b}{2}\right)^{2}-c\right)
\end{array} $$

Here is the what the display would look like:

When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are \[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]

When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ $$ \begin{array}{rcll} y & = & x^{2}+bx+c\\ & = & x^{2}+2\times\dfrac{b}{2}x+c\\ & = & \underbrace{x^{2}+2\times\dfrac{b}{2}x+\left(\frac{b}{2}\right)^{2}}- {\left(\dfrac{b}{2}\right)^{2}+c}\\ & & \qquad\left(x+{\dfrac{b}{2}}\right)^{2}\\ & = & \left(x+\dfrac{b}{2}\right)^{2}-\left(\dfrac{b}{2}\right)^{2}+c & \left|+\left({\dfrac{b}{2}}\right)^{2}-c\right.\\ y+\left(\dfrac{b}{2}\right)^{2}-c & = & \left(x+ \dfrac{b}{2}\right)^{2} & \left|\strut(\textrm{vertex form})\right.\\ y-y_{S} & = & (x-x_{S})^{2}\\ S(x_{S};y_{S}) & \,\textrm{or}\, & S\left(-\dfrac{b}{2};\,\left(\dfrac{b}{2}\right)^{2}-c\right) \end{array} $$

Math in MathML notation

When <math><mi>a</mi><mo>≠</mo><mn>0</mn></math>,
there are two solutions to <math>
  <mi>a</mi><msup><mi>x</mi><mn>2</mn></msup>
  <mo>+</mo> <mi>b</mi><mi>x</mi>
  <mo>+</mo> <mi>c</mi> <mo>=</mo> <mn>0</mn>
</math> and they are
<math mode="display">
  <mi>x</mi> <mo>=</mo>
  <mrow>
    <mfrac>
      <mrow>
        <mo>−</mo>
        <mi>b</mi>
        <mo>±</mo>
        <msqrt>
          <msup><mi>b</mi><mn>2</mn></msup>
          <mo>−</mo>
          <mn>4</mn><mi>a</mi><mi>c</mi>
        </msqrt>
      </mrow>
      <mrow> <mn>2</mn><mi>a</mi> </mrow>
    </mfrac>
  </mrow>
  <mtext>.</mtext>
</math>

Here is what the display looks like:

When a0, there are two solutions to ax2 + bx + c = 0 and they are x = b ± b2 4ac 2a .
Previous
Previous

My 1st Putnam Problem