The msup element attaches a superscript to a base. It increments scriptlevel by 1, and sets displaystyle to "false", within superscript, but leaves both attributes unchanged within base. MathML Fundamentals
<math mathsize="100">
<mspace linebreak="newline" indentalign="center"></mspace>
<mtext style="border:1px;" mathsize="50">Superscript msup</mtext>
<mspace linebreak="newline" indentalign="center"></mspace>
<mrow style="border:1px;">
<mtext>a</mtext>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<mn style="border:1px">2</mn>
</msup>
</msup>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">X</mi>
<mn style="border:1px">2</mn>
</msup>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">x</mi>
<mn style="border:1px">2</mn>
</msup>
</mrow>
<mspace linebreak="newline" indentalign="center"></mspace>
<mrow style="border:1px;" dir="rtl">
<mtext>a</mtext>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<mn style="border:1px">2</mn>
</msup>
</msup>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">X</mi>
<mn style="border:1px">2</mn>
</msup>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">x</mi>
<mn style="border:1px">2</mn>
</msup>
</mrow>
<mspace linebreak="newline" indentalign="center"></mspace>
<mrow style="border:1px;">
<mtext>a</mtext>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<mfrac style="border:1px">
<mn style="border:1px">1</mn>
<mn style="border:1px">2</mn>
</mfrac>
</msup>
</msup>
<mo>+</mo>
<msup style="border:1px">
<mi style="border:1px">Y</mi>
<mfrac style="border:1px">
<mn style="border:1px">1</mn>
<mfrac style="border:1px">
<mn style="border:1px">1</mn>
<mn style="border:1px">2</mn>
</mfrac>
</mfrac>
</msup>
<mo>+</mo>
<msup style="border:1px" superscriptshift="30%">
<mi style="border:1px">Y</mi>
<mfrac style="border:1px">
<mn style="border:1px">1</mn>
<mfrac style="border:1px">
<mn style="border:1px">1</mn>
<mn style="border:1px">2</mn>
</mfrac>
</mfrac>
</msup>
</mrow>
</math>