Question: how to do x squared on a keyboard?
Answer: Hold down Alt and key in 0178 and let go of Alt. A superscript 2 will appear. Incidentally, if you needed 'cubed' instead of 'squared' then type 0179 and you'll get a superscript 3.