DanielScully.co.uk

Web Design

A Beginner's Guide to MathML

Roots

For displaying a square-root MathML provides the <msqrt> tag:

  1. <msqrt>
  2. <mi>x</mi><mo>+</mo><mn>2</mn>
  3. </msqrt>
MathML rendering of an msqrt element

For more general roots there is the <mroot> tag. Unlike the <msqrt>, which can contain any number of child tags, the <mroot> must contain exactly two. Again the order is important: the first element is the expression being rooted, and the second is the power of the root.

Below is an example of a cubic root in which, to satisfy the two child rule , the expression being acted upon is grouped within an <mrow> tag:

  1. <mroot>
  2. <mrow>
  3. <mi>x</mi><mo>+</mo><mn>2</mn>
  4. </mrow>
  5. <mn>3</mn>
  6. </mroot>
MathML rendering of a cubic root using the mroot element