"Functions" that always equal zero and their gradients I am currently enrolled in a university level Multivariable Calculus course in which my professor taught finding the tangent plane at a point on a surface the following way: 
To find the tangent plane at point $(x_0,y_0,z_0)$ on the surface $ z=x^2+y^2 $ set $f(x,y,z)=x^2+y^2-z=0$ and then find $\nabla f(x_0,y_0,z_0) $.
According to his method, $\nabla f $ would be the following...
$$
\nabla f =  \begin{bmatrix} \frac{\partial f}{\partial x} \\ \frac{\partial f}{\partial y} \\ \frac{\partial f}{\partial z} \end{bmatrix} = \begin{bmatrix}  2x \\ 2y \\ -1 \end{bmatrix}  
$$
While this indeed is an expression for the tangent plane's normal vector, I don't understand how this is a mathematically valid statement. If $f(x,y,z)=0$, than how can the rates of instantaneous change (i.e.$\frac{\partial f}{\partial x}$) ever be anything other than zero? 
Is $f(x,y,z)=x^2+y^2-z=0$ a valid function? Why would the partials not always be equal to zero? Am I thinking about partial derivatives incorrectly? Is this just a mathematical "hack" to serve as a shortcut? If this is the case, is there a more mathematically rigorous method to find the tangent plane of a surface?
Thank you in advance.
 A: You have quite a few questions there. To begin with, $f:(x,y,z)\mapsto x^2+y^2-z$ is certainly a valid function from $\mathbb R^3$ to $\mathbb R$. Its partial derivatives clearly don’t all vanish everywhere. The expression $x^2+y^2-z=0$, on the other hand, describes one of $f$’s level (hyper)surfaces. It’s a basic property of the gradient operator that the gradient of a function is always normal to its level surfaces. Your professor is taking advantage of this property.
A: Let's take an example one dimension lower. Consider $g(x,y)=x-2y$, a plane. Its level sets are of the form $g(x,y)=c$ for some constant $c$, i.e., $x-2y=c$. This defines a line in the $xy$-plane. A normal vector to one of these lines at the point $(x_0,y_0)$ is given by $\nabla g(x_0,y_0)$.
In your example, we have the function $f(x,y,z)=x^2+y^2-z$. This function is not constant, so its partial derivatives are not always zero. We can consider level surfaces of the form $f(x,y,z)=c$ for some constant $c$, i.e., $x^2+y^2-z=c$. The level surface with $c=0$ is $x^2+y^2-z=0$, and this is the surface for which you want to find the tangent plane. The normal vector to this level surface at the point $(x_0,y_0,z_0)$ is given by $\nabla f(x_0,y_0,z_0)$. 
A: In slightly different guise, this amounts to Differentiating both sides of a non-differential equation: You have


*

*A non-constant function $f(x, y, z) = x^{2} + y^{2} - z$, whose gradient vector field is defined and non-zero;

*The condition $f(x, y, z) = 0$, whose solution set is a surface with normal vector $\nabla f(x_0, y_0, z_0)$ at the point $(x_0, y_0, z_0)$.
The conclusion that the partials of $f$ are (or should be) zero implicitly assumes the condition "$f(x, y, z) = 0$" is an identity, i.e., is true for all $(x, y, z)$ in some open ball about $(x_0, y_0, z_0)$.
