[Tex/LaTex] Show the Steps Taken to Solve an Equation

equations

I am new to LaTex and I am trying to type a document where I show the steps I took to solve an equation however I do not know how to do this in LaTex. I am trying to display something like this:

 x^2+2x+1 = 0  
 (x+1)^2 = 0  
 x = -1

Is there a way to do this (or something similar) in LaTex? Any suggestions would be much appreciated!

Best Answer

You should consider using amsmath:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align*}
  x^2 + 2x + 1 &= 0 \\
  (x+1)^2 &= 0 \\
  \llap{$\rightarrow$\hspace{50pt}} x &= -1
\end{align*}
\end{document}