# MathML demo and thoerem

MathML is an XML based markup language which, like SVG, can be included in an HTML document. It works best in Firefox as far as formatting. I think I came across some CSS once to format everything correctly in other browsers.

The following is math theorem that I came up with one night when I couldn't sleep. It proves that, for all positive integers (x), that number squared can be expressed as the number plus twice the sum of all integers to 1. Or, 4 squared is equal to four plus twice 3 + 2 + 1. Square a number using only addition (although, I do multiply by two in the proof, that can just be thought of as adding twice, right?)

I wrote this in LibreOffice Math and exported as MathML. There may be other software out there that does this as well, and maybe even better. I would not suggest writing this stuff out by hand, since it's quite a bit more complicated than HTML.
$\begin{array}{c}x\in \mathrm{ℕ}\\ {x}^{2}=x+2\sum _{n=1}^{x-1}n\\ {x}^{2}=x+2\left(\frac{x-1}{2}\right)\left(x-1+1\right)\\ {x}^{2}=x+x\left(x-1\right)\\ {x}^{2}=x+{x}^{2}-x\\ {x}^{2}={x}^{2}\end{array}$
This proof uses a neat little trick for summing up numbers. If you want to add up all the numbers from 1 to 100, you can do this much more easily by noticing that 100 + 1 = 99 + 2… = 101. When you pair up numbers in this way, you use the fact that you have 50 pairs of numbers whose sum is 101. The product of 101 and 50 is 5050, which gives you the sum much more quickly than adding them up directly.