A Beginner's Guide to MathML
Sub-scripts & Super-scripts
Sub/Super-scripts are used in MathML not just for powers or indices, they are also used for limits.
Sub-scripts
Sub-Scripts are denoted with the <msub> tag. It accepts exactly 2 child elements, the first is the 'base', the second is the sub-script.
<msub><mi>x</mi><mi>i</mi></msub>
As usual, you can use grouping elements, such as <mrow>, to group multiple tags so that there are only two child elements within the <msub>.
Super-scripts
The <msup> behaves in exactly the same way as for sub-scripts.
<msup><mi>e</mi><mrow><mi>x</mi><mo>+</mo><mn>2</mn></mrow></msup>
Sub-script Super-script pair
For the frequently encountered case when you need both sub and super-scripts we can use the <msubsup> tag:
<msubsup><mi>x</mi><mi>2</mi><mn>i</mn></msubsup>
Note that this is different to nesting sub/super scripts:
<msup><msub><mi>x</mi><mn>i</mn></msub><mn>2</mn></msup>
Integration
<msubsup><mo>∫</mo><mn>0</mn><mn>1</mn></msubsup><mi>x</mi><mrow><mo>ⅆ</mo><mi>x</mi></mrow>
Under and Over Scripts
Exaclty like the sub and super scripts, we can place things above and below using three similar tags: <munder>, <mover> and <munderover>
<munder><mi>x</mi><mo>⏟</mo></munder><mo>+</mo><mover><mi>y</mi><mo>^</mo></mover>
<munderover><mi>∑</mi><mrow><mi>x</mi><mo>=</mo><mn>0</mn></mrow><mi>n</mi></munderover><mrow><mn>2</mn> <mi>x</mi><mo>+</mo><mn>1</mn></mrow>
As you can see from this second example, this is a suitable way to write summations.