Dynamic Equations in MathJax

Expand the following: (x+1)2=(x+1)(x+1)=x(x+1)+1(x+1)=(x2+x)+(x+1)=x2+(x+x)+1=x2+2x+1