Given a three dimensional surface, it can be useful to find the plane tangent to a certain point on the surface. This can be easily accomplished using some basic calculus.

If the function `z = f(x,y)`

is smooth and has both x and y partial derivatives at the point `(a,b)`

, then its tangent plane can be found. The plane tangent to the surface `z = f(x,y)`

at the point `P(a,b,f(a, b))`

contains the lines that are tangent to both of the following curves:

z = f(x,b) holding constant y = b
z = f(a,y) holding constant x = a

To solve for a the general plane equation, we need the definition of a plane:

A(x-a) + B(y-b) + C(z-c) = 0
z–c = ^{-A}/_{C}(x-a) + ^{-B}/_{C}(y-b)
if we set p = ^{-A}/_{C} and q = ^{-B}/_{C} then
z-c = p(x-a) + q(y-b)

Going back to the previous statement, we know that the plane has to contain both tangent lines to the respect x and y curves. When `z = f(x,b)`

then the equation simplifies into `z-c = p(x-a)`

, or the equation of a line. To find the slope of that line, a partial derivative with respect to x is done. That gives us `p =`^{∂f}/_{∂x}

and `q =`^{∂f}/_{∂y}

. The last part of the equation is `c`

, but it's simple to see that when given the point `P(a,b,f(a,b))`

, then `c = f(a,b)`

. Finally, we get the general tangent plane equation for `z = f(x,y)`

at the point `P(a,b,f(x,y))`

:

z - f(a,b) = =^{∂f}/_{∂x}(x-a) + =^{∂f}/_{∂y}(y-b)

Sources: Calculus with analytic geometry, by Edwards and Penny, Fifth edition.