I'm studying a calculus course and I have a problem understanding the definition of the second order total differential: \begin{align} d^2f &= d(df) = d(\frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy) \\ &=\frac{\partial}{\partial x}\left (\frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy\right )dx + \frac{\partial}{\partial y}\left (\frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy\right )dy \\ &= \left ( \frac{\partial^2 f}{\partial x^2}dx + \frac{\partial f}{\partial x}\frac{\partial }{\partial x}(dx)+\frac{\partial^2 f}{\partial x \partial y}dy+0 \right )dx+\left ( \frac{\partial^2 f}{\partial y \partial x}dx+0+\frac{\partial^2 f}{\partial y^2}dy + 0 \right )dy \\ &= \frac{\partial^2 f}{\partial x^2}dx^2+2\frac{\partial^2 f}{\partial x \partial y}dx dy + \frac{\partial^2 f}{\partial y^2}dy^2=\left ( \frac{\partial }{\partial x}(dx)+\frac{\partial }{\partial y}(dy) \right )^{"2"}f \end{align}
I don't get where the zeros on the second line come from. On the same I also don't see where the $\frac{\partial f}{\partial x}\frac{\partial }{\partial x}(dx)$ term comes from and what it exactly means.