To get an expression exp to appear as a subscript, you just type
}. To get exp to appear as a superscript, you type
}. LaTeX handles superscripted superscripts and all of
that stuff in the natural way. It even does the right thing when
something has both a subscript and a superscript.