\documentclass[a4paper,12pt]{article}
\begin{document}
\parindent=0pt

{\bf Question}

Calculate $f_{xx}, \, f_{xy}, \, f_{yx}, \, f_{yy}$ for $f(x,y) =
x^2 \cos (x + 2y)$

\vspace{.25in}

{\bf Answer}

\begin{eqnarray*}
f(x,y) & = & x^2 \cos(x + 2y) \\ f_x & = & \frac{\partial
f}{\partial x} = 2x \cos(x+2y) - x^2 \sin(x + 2y) \\ f_y & = &
\frac{\partial f}{\partial y} = -2x^2 \sin(x + 2y) \\ f_{xx} & = &
\frac{\partial^2 f}{\partial x^2} = \frac{\partial}{\partial
x}\left[ \frac{\partial f}{\partial x}\right] \\ & = & 2 \cos (x+
2y) - 4x \sin (x + 2y) - x^2 \cos (x + 2y) \\ f_{xy} & = &
\frac{\partial^2 f}{\partial x \partial y} =
\frac{\partial}{\partial x}\left[ \frac{\partial f}{\partial
y}\right] \\ & = & - 4x \sin (x + 2y) - 2x^2 \cos (x + 2y)
\\ f_{yx} & = & \frac{\partial^2 f}{\partial y\partial x} =
\frac{\partial}{\partial y}\left[ \frac{\partial f}{\partial
x}\right] \\ & = &  - 4x \sin (x + 2y) - 2x^2 \cos (x + 2y) =
f_{xy} \\ f_{yy} & = & \frac{\partial^2 f}{\partial y^2} =
\frac{\partial}{\partial y}\left[ \frac{\partial f}{\partial
y}\right] \\ & = &  - 4x^2 \cos (x + 2y)  \end{eqnarray*}



\end{document}
