Design Your Website More Professionally
Facebook

MathML – Radicals and roots

An important topic in mathematics is radicals and roots; so HTML5 MathML provides a feature to write them in the web pages. In this post we try to explain them with some useful examples . . .

Two kinds of radicals exist in MathML, one has just a simple radical shape with an expression below it, and the second has special feature for putting the root of the radical. The following examples show them:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

  <msqrt>

    <mi>x</mi>

  </msqrt>

</math>

 

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

  <mroot>

    <mi>x</mi>

    <mn>3</mn>

  </mroot>

</math>

They lead to:

HTML5 - MathML -  radicals and roots

As you see, the first form just needs one input tag for the expression below the radical; but in the second form you should insert two tags.

Like other MathML parts, you can group the expressions with ‘<mrow>‘, to have more than one input symbol:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

  <msqrt>

    <mrow>

                <mi>x</mi>

                <mo>+</mo>

                <mn>4</mn>

    </mrow>

  </msqrt>

</math>

 

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

  <mroot>

    <mn>x</mn>

    <mrow>

                <mi>y</mi>

                <mo>+</mo>

                <mn>3</mn>

    </mrow>

  </mroot>

</math>

In the first example we have replaced the expression below the radical with a group; so it would be:

HTML5 - MathML - radical expression

And in the second example, we have used a group for the radical root:

HTML5 - MathML - root expressions

It is usual to use radicals inside each other; here we have made an example to show the ability of MathML for this purpose:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

  <mroot>

            <mrow>

                        <mi>1</mi>

                        <mo>+</mo>

                        <msqrt>

                                    <mn>x</mn>

                        </msqrt>

            </mrow>

            <mn>3</mn>

  </mroot>

</math>

It may look confusing but by a short description, everything would be clear. First we have opened a ‘<mroot>‘ tag; so we need two inputs (shown in bold): one for radical main expression and the second for its root. The root is set to ’3′, and the main expression of the radical is replaced by a group (‘<mrow>‘). Inside the group we have three parts: a number, an operator and another radical. The final step is to put the needed input tag of the inside radical. The result looks like:

HTML5 - MathML - radical inside radical

Up to now, we have finished some features of MathML but many are left; so let’s continue together . . .

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>