# Question on calculating curvature of a surface given implicitly

I want to find, as an exercise, an expression for the curvature of a surface given by the zero set of a function. I reached a final expression, but when I test it for a sphere I get a non-constant expression. I know I'm doing a step wrong, but I don't know why. Below is what I have.

Say we have a good enough $f:\Bbb R^3 \to \Bbb R$. This defines a surface in $\Bbb R^3$ as $$S = \{(x,y,z)\in\Bbb R^3 : f(x,y,z) = 0\}$$

Suppose that $f_z = \frac{\partial f}{\partial z}\neq 0$. Then by the implicit function theorem it's easy enough to see we have a local parametrization of $S$ (in fact, the graph of a function): $$h:\Bbb R^2\to \Bbb R^3 \atop (x,y)\mapsto (x,y,h(x,y))$$ and $h$ satisfies (found using the chain rule on $f(x,y,h(x,y)) = 0$) \begin{align}h_x = \frac{-f_x}{f_z} \\ h_y = \frac{-f_y}{f_z}\end{align}

This way we have a basis for $T_pS$ (at a point $p$ which is omitted in the expressions) $(1,0,-f_x/f_z), (0,1,-f_y/f_z)$. With the usual notation, the coefficients of the first fundamental form $I$ can be calculated as $$E = 1+(f_x/f_z)^2, F = \frac{f_xf_y}{f_z^2}, G = 1 + (f_y/f_z)^2$$ My problem, it seems, comes with the second fundamental form $II$. For example, my calculation of $h_{xx}$ results in $$h_{xx} = \frac{f_xf_{xz}-f_{xx}f_z}{f_z^2}$$ while on this page they get $$h_{xx} = \frac{2f_xf_zf_{xz}-f_x^2f_{zz}-f_z^2f_{xx}}{f_z^3}$$

so either something is horribly wrong and I've forgotten how to differentiate a quotient, or there's something else in the calculation I'm not including. Note that this is before doing anything with the normal vector, just partial derivatives of the parametrization. Could someone clear this up?

You've forgotten to apply the chain rule again. Remember that you're evaluating the partial derivatives of $f$ at $(x,y,h(x,y))$.
• Thanks! I guess this is what I get for not writing $h_x(p)$... – GPerez Mar 18 '15 at 22:14