\nonstopmode
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\pagestyle{empty}
\begin{document}
$$
{\begin{matrix}f(n+1)&=&(n+1)^{2}\\\ &=&n^{2}+2n+1\end{matrix}}
$$
\end{document}
