On the Hessian of a smooth $f:U\subset \mathbb{R}^2 \to \mathbb{R}$ at a critical point I am asked to prove the following from Tapp's Differential Geometry:

Let $U\subset \mathbb{R}^2$ be open and let $f:U\subset \mathbb{R}^2 \to \mathbb{R}$ be smooth. Let $\lbrace u,v \rbrace$ denote the local coordinates in $\mathbb{R}^2$; i.e. let $f=f(u,v)$. Assume that $q\in U$ is a critical point of $f$, such that $df_q(w)=0$ for all $w\in\mathbb{R}^2$; equivalently, $f_u(q)=f_v(q)=0$. Let $\gamma:I\to U$ be a regular curve with $\gamma(0)=q$ and $\gamma'(0)=w:=(a,b)\in\mathbb{R}^2$.
Show that $\mathrm{Hess}(f)_q(w)=(f\circ\gamma)''(0)=a^2 f_{uu}(q)+2ab f_{uv}(q)+b^2 f_{vv}(q)$.

I know how to compute the Hessian matrix for maps $\mathbb{R}^n \to \mathbb{R}^m$, but am a bit confused by differentials of general maps.
I tried
\begin{align}
(f\circ\gamma)''(0)=&
\left. \frac{d}{dt} \right\rvert_{t=0} \frac{d}{dt} (f\circ\gamma)'(t) \\
=& \left. \frac{d}{dt} \right\rvert_{t=0} \left( df_{\gamma(t)} \circ \gamma' \right)(t) \\
=&
\left. \left( d \left( df_{\gamma(t)} \right)_{\gamma'(t)} \circ \gamma'' \right)(t) \right\rvert_{t=t_0} \\
=& d\left( df_q \right)_w (\gamma''(0))
\end{align}
but that's about as far as I got.

Edit: (why) is it true that $\mathrm{Hess}(f)_q(w)=w^{\top} \mathbf{H}f(q) w =
\begin{bmatrix} a & b \end{bmatrix}\mathbf{H}f(q) \begin{bmatrix} a \\ b \end{bmatrix}?
$
 A: Let's work in local coordinates, as Deane said in the comments. I'll preface this by noting that I prefer to express my derivatives in a coordinate-free manner wherever possible, even when using local coordinates. That is, I prefer notation like $\partial_{1,1} f \vert_{\gamma(t)}$, $f^{(2,0)}$ and $Dg$ as opposed to ${\partial^2 f} / {\partial u^2}$ and ${dg}/{dt}$, because the (partial) derivative does not "care" about (informally speaking) and is unchanged by local coordinates. In what follows, the symbol $\partial_{i,j}$ reads as "differentiate with respect to the $i$-th argument, followed by the $j$-th argument."
Now, let's set $\gamma(t)=(u(t),v(t))$ and look at
\begin{align}
(f \circ \gamma)'(t)=& \partial_1 f\vert_{\gamma(t)} u'(t) + \partial_2 f\vert_{\gamma(t)} v'(t) \,,
\end{align}
We then differentiate a second time, carefully applying the chain and product rules.
\begin{align}
(f \circ \gamma)''(t)=& \partial_1 f\vert_{\gamma(t)} u''(t) + \partial_{1,1} f\vert_{\gamma(t)} u'(t)^2 \\
+& 2 u'(t) v'(t) \partial_{1,2} f\vert_{\gamma(t)} \\
+& \partial_{2,2} f\vert_{\gamma(t)} v'(t)^2 + \partial_2 f\vert_{\gamma(t)} v''(t)
\end{align}
So then
\begin{align}
(f \circ \gamma)''(0) =& \partial_1 f\vert_{q} u''(t) + \partial_{1,1} f\vert_{q} a^2 \\
+& 2ab \,\partial_{1,2} f\vert_{q} \\
+& \partial_{2,2} f\vert_{q} b^2 + \partial_2 f\vert_{q} v''(t) \,,
\end{align}
but since $q$ is a critical point of $f$, we know that the first-order partial derivatives vanish at $q$, so the above becomes
$$(f \circ \gamma)''(0) = \partial_{1,1} f\vert_{q} a^2
+ 2ab \,\partial_{1,2} f\vert_{q}
+ \partial_{2,2} f\vert_{q} b^2 := \mathrm{Hess}(f)_q (w) \,,$$
or, in a more familiar form
$$\mathrm{Hess}(f)_q(w)=(f \circ \gamma)''(0) = a^2 f_{uu}(q) + 2ab f_{uv}(q) + b^2 f_{vv}(q) \,.$$
