In Morse Theory and Floer Homology by Michele Audin and Mihai Damian (Morse theory and Floer Homology) they give the following definition to the second-order derivative at a critical point x. $$(d^2f)_x(X,Y)=X\cdot(\tilde{Y}\cdot f)(x)$$ where $\tilde{Y}$ is a vector field that extends $Y$ and $X,Y$ are vectors tangent to the manifold at $x$.
After giving the statement they give the following example.
Let $(0,0,\varepsilon)\in\mathbb{S^2}$, then $f(x,y)=z=\varepsilon\sqrt{1-x^2-y^2}$ is a function whose second-order derivative is given by $$(d^2f)_{(0,0,\varepsilon)}(x,y)=-\varepsilon(x^2+y^2)$$
Once I tried to calculate this by using the definition I did not came close to the answer. However, I did manage to find the answer using partial derivatives. But how can I compute the second-order derivative by the given definition.
I assumed $\tilde{Y}\cdot f(x)=\tilde{Y}f(x)=\tilde{Y^i}(x)\frac{\partial f}{\partial x^i}(x)$.