# Equation of tangent plane.

I have trouble understanding the proof of tangent plane:
let $z=f(x,y)$ and $z_0=f(x_0,y_0)$, for $x=x_0$ the tangent line to $z$ at $(x_0,y_0,z_0)$ is along $(0,1,\frac{\partial f}{\partial y}(x_0,y_0))$.
How did we get the above result ?

Consider the function $g(x,y,z) = f(x,y) - z$. Observe that $(x_0,y_0,z_0):=p_0$ is in the zero level curve of $g$. Let us suppose that $f$ is differentiable with continuous partial derivatives of first order. If we suppose that $f_x(p_0)$ and $f_y(p_0)$ are both non-zero then we can find a $C^1$-parametrized curve $\gamma$ with $\gamma(0) = p_0$ and $\gamma$ is completely contained in $g(\textbf{x}) = 0$. By the Chain rule;

$$(g \circ \gamma)(t) = 0 \Rightarrow 0=\frac{d}{dt}\Bigr|_{t = 0} (g\circ \gamma)(t) = \nabla g(p_0) \cdot \gamma'(0)$$

The above says that $\nabla g(p_0)$ is perpendicular to the tangent line at $p_0$ i.e a candidate for the tangent plane at $p_0$. The plane is determined by:

$$\nabla g(p_0) \cdot \langle x-x_0, y-y_0, z-z_0 \rangle = 0$$

Observe that $\nabla g(p_0) = \langle f_x(p_0), f_y(p_0),-1 \rangle$ and you are done. One last remark is that $f_x(p_0)$ and $f_y(p_0)$ are the slopes of the tangent lines in the direction of $\textbf{e}^1$ and $\textbf{e}^2$. The equations of these lines are given by:

$$L_1: f_x(p_0)(x-x_0) + f(x_0,y_0)$$

$$L_2: f_y(p_0)(y-y_0)+ f(x_0,y_0)$$