Somewhere in your LYX document, type:
Instead, we create a formula that will get typeset properly. In order to create a formula, just click the toolbar button with written on it in blue. LYX will insert a little blue square, which is an empty math formula. LYX has placed the cursor in the blue square, so just type E=mc^2 again. The expression is typed in blue, and the blue square disappears as soon as the formula is not empty. Now type Esc to leave the equation The purple markers disappear, leaving the cursor to the right of the expression, and now if you type something, it will be regular text.
Run LATEX and look at the dvi file. Notice that the expression was typeset nicely, with spaces between the letters and the equals sign, and a superscript ``2''. Letters in math mode are assumed to be variables, and come out in italics. Numbers are just numbers.
This math editor is another example of the WYSIWYM philosophy. In LATEX, you write a mathematical expression using text and commands like \sqrt; this can be frustrating, because you can't see what an expression looks like until you LATEX the file, and may have to spend time to find missing brackets or other ``bugs''. On the other hand, LYX doesn't attempt to get the expression to look perfect (WYSIWYG), but it gives you an extremely good idea of what the expression will look like. LATEX then takes care of the professional typesetting. 99% of the time, you won't have to make any changes to the font sizes or spacing that LATEX outputs. This way (sorry to be so repetitive) you can focus on the content of your mathematical expressions, not their format.