To write subscript, use "_{script}", or, if the script is only one character long, "_s". To write superscript, use "^{script}", or "^s" for a single character. Please note that superscript and subscript can be written on top of each other, and in any place. For example, we have:
n_0^1
...yields...
So, for an integral, we just make the integral sign and then the limits...
\int_0^5dx
For super/subscript longer than one character:
\int_{genesis}^{deuteronomy}inerrancy\;d(pentateuc h)=mosaic\;law