16  Tangent Planes

16.1 Introduction

In single-variable calculus, the tangent line to a smooth curve \(y = f(x)\) at a point represents the line that most closely approximates the curve near that point. When dealing with a surface \(z = f(x,y)\) in 3D space, a single line is no longer sufficient to capture the local behavior in all directions! Instead we need a higher-dimensional object to capture the ways inputs of \(f\) can vary: a tangent plane.

Geometrically, the tangent plane to a surface \(S\) at a point \((x_0,y_0,z_0)\) is the plane that most closely approximates \(S\) near this point. In other words, the tangent plane contains all possible tangent lines to curves on the surface passing through that point.

Tangent Plane (Stewart et al. 2020, 14.4, pp. 974)

Suppose \(f(x,y)\) has continuous partial derivatives near \((x_0,y_0)\). Write \(L_1\) and \(L_2\) for the tangent lines to \(z = f(x,y)\) at \((x_0,y_0)\) along the \(x\)-axis and \(y\)-axis, respectively. The tangent plane to \(f(x,y)\) at \((x_0,y_0)\) is the plane containing both \(L_1\) and \(L_2\).

Consider the following example, building on those in Section 15.1 by including the tangent plane:

Example 16.1 (\(f(x,y) = \sin(xy)\)) We consider the point \((x_0,y_0) = (\frac{\pi}{2}, \frac{2}{3})\), where \(f(\frac{\pi}{2}, \frac{2}{3}) = \sin(\frac{\pi}{3}) = \frac{\sqrt{3}}{2}\). We compute the partial derivatives: \[ f_x = y \cos(xy) \implies f_x\left(\tfrac{\pi}{2}, \tfrac{2}{3}\right) = \tfrac{2}{3}\cos\left(\tfrac{\pi}{3}\right) = \tfrac{1}{3} \] and \[ f_y = x \cos(xy) \implies f_y\left(\tfrac{\pi}{2}, \tfrac{2}{3}\right) = \tfrac{\pi}{2}\cos\left(\tfrac{\pi}{3}\right) = \tfrac{\pi}{4}. \] Using an approach much like that in Example 13.1 and Example 13.2 (or anticipating the general formula in Section 16.2), we can work out the equation for the tangent plane at \((\frac{\pi}{2}, \frac{2}{3})\): \[ z = \tfrac{1}{3} \left(x-\tfrac{\pi}{2}\right) + \tfrac{\pi}{4} \left(y-\tfrac{2}{3}\right) + \tfrac{\sqrt{3}}{2}. \]

var('x y t')
pt = point([pi/2, 2/3, sqrt(3)/2], color='black', size=50)
surface = plot3d(
    sin(x*y),
    (x, -4, 4), (y, -4, 4),
    color='orange', plot_points=60
)
line_x = parametric_plot3d(
    (pi/2 + t, 2/3, sqrt(3)/2 + t/3), 
    (t, -4, 4), 
    color='red', thickness=2
)
line_y = parametric_plot3d(
    (pi/2, 2/3 + t, sqrt(3)/2 + pi/4 * t), 
    (t, -4, 4), 
    color='blue', thickness=2
)
tangent_plane = plot3d(
    (1/3) * (x-pi/2) + (pi/4) * (y-2/3) + sqrt(3)/2,
    (x, -4, 4), (y,-4, 4),
    color='purple', opacity=0.5
)
show(surface + line_x + line_y + tangent_plane + pt)

16.2 General Formula

Recall from Chapter 13 that, to write the equation of a plane, we need a point \((x_0, y_0, z_0)\) and a normal vector \(\vec{n}\). By the definition of the tangent plane, it contains the tangent lines \(L_1\) and \(L_2\). Considering \(L_1\) first, which moves in the \(x\)-direction, for every \(1\) unit we move in \(x\), the \(z\)-coordinate changes by the slope \(f_x(x_0,y_0)\): The direction vector is \[ \vec{v}_1 = \langle 1, 0, f_x(x_0,y_0) \rangle. \] The line \(L_2\) is similar, with direction vector \(\vec{v}_2 = \langle 0, 1, f_y(x_0,y_0) \rangle\).

To find a vector orthogonal to both, we take their cross product: \[ \vec{n} = \vec{v}_1 \times \vec{v}_2 = \begin{vmatrix} \mathbf{i}& \mathbf{j}& \mathbf{k}\\ 1 & 0 & f_x(x_0,y_0) \\ 0 & 1 & f_y(x_0,y_0) \end{vmatrix} = \langle -f_x(x_0,y_0), -f_y(x_0,y_0), 1 \rangle. \] Using the scalar equation of a plane from Section 13.1.2, we have \[ -f_x(x_0,y_0)(x - x_0) - f_y(x_0,y_0)(y - y_0) + 1(z - z_0) = 0, \] which we rearrange for \(z\) to obtain the general formula.

Suppose \(f(x,y)\) has continuous partial derivatives near \((x_0,y_0)\). The tangent plane to the surface \(z = f(x,y)\) is given by \[ z = f_x(x_0,y_0) (x-x_0) + f_y(x_0,y_0) (y-y_0) + f(x_0,y_0). \]

Example 16.2 (Tangent to a Paraboloid) Consider the tangent plane to the saddle \(f(x,y) = x^2 - y^2\) at the point \((1, \frac{1}{2})\). The \(z\)-coordinate is \(f(1,\frac{1}{2}) = \frac{3}{4}\).

The partial derivatives are: \[ \begin{aligned} f_x = 2x & \implies f_x(1, \tfrac{1}{2}) = 2 \\ f_y = 2y & \implies f_y(1, \tfrac{1}{2}) = -1. \end{aligned} \] Using our general formula, the equation of the tangent plane is: \[ z = 2(x - 1) - (y - \tfrac{1}{2}) + \tfrac{3}{4}, \] which simplifies to \(z = 2x - y - \frac{3}{4}\).

var('x y')
pt = point([1,1/2,3/4], color='black', size=50)
surface = plot3d(x^2-y^2, (x, -2, 2), (y, -2, 2), color='red')
plane = plot3d(2*x-y-3/4, (x, -2, 2), (y, -2, 2), opacity=0.5)
show(surface + plane + pt)

16.3 Tangent Planes as Linear Approximations

If we zoom in on a smooth surface, it looks very nearly flat! In other words, for points \((x,y)\) very close to \((x_0,y_0)\), the \(z\)-values on the tangent plane are nearly identical to the actual \(z\)-values of the surface. We call the equation of the tangent plane the linear approximation or tangent plane approximation of \(f\): \[ f(x,y) \approx L(x,y) = f(x_0,y_0) + f_x(x_0,y_0) (x-x_0) + f_y(x_0,y_0) (y-y_0). \]

Example 16.3 (Approximating \(f(x,y) = x e^{xy}\)) Without a calculator, evaluating \((1.2)e^{(1.2)(-0.1)}\) is very difficult! However, the point \((1.2, -0.1)\) is close to the much nicer point \((1, 0)\), from which we can build a linear approximation. First, we evaluate the function: \[ f(1,0) = (1)e^0 = 1. \] Next, we calculate the partial derivatives and evaluate them at \((1,0)\): \[ \begin{aligned} f_x = e^{xy} + xye^{xy} & \implies f_x(1,0) = e^0 + 0 = 1 \\ f_y = x^2e^{xy} & \implies f_y(1,0) = (1)^2e^0 = 1 \end{aligned} \] The linear approximation is: \[ L(x,y) = 1 + 1(x - 1) + 1(y - 0) = x + y. \] Lastly, we evaluate: \[ f(1.2, -0.1) \approx L(1.2, -0.1) = 1.2 + (-0.1) = 1.1. \] For context, the exact value is roughly \(1.064\)!

var('x y z')
pt_base = point([1, 0, 1], color='black', size=10)
pt_guess = point([1.2, -0.1, 1.1], color='black', size=10)
pt_actual = point([1.2, -0.1, 1.064], color='blue', size=10)
surface = implicit_plot3d(z == x * e^(x*y), (x, 0, 2), (y, -1, 1), (z, -0.5, 1.5), color='lightblue', plot_points=60)
plane = implicit_plot3d(z == x + y, (x, 0, 2), (y, -1, 1), (z, -0.5, 1.5), opacity=0.5)
show(surface + plane + pt_base + pt_guess + pt_actual)

Differentials and Error Propagation

Instead of approximating the final value of \(f(x,y)\), we often are only interested in how much the function changes in response to small tweaks in \(x\) and \(y\). If we subtract \(f(x_0,y_0)\) from both sides of our linear approximation, we get a formula for the change in height, \(\Delta z\). Letting \(\Delta x = (x-x_0)\) and \(\Delta y = (y-y_0)\), we have: \[ \Delta z \approx f_x(x_0,y_0) \Delta x + f_y(x_0,y_0) \Delta y. \]

This total differential relationship is useful in science and engineering for calculating error propagation, i.e., estimating the maximum possible error based on the measurement errors of the inputs.

Example 16.4 (Estimating Changes in Volume) The volume of a cone is given by \(V = \frac{1}{3}\pi r^2 h\). Suppose a factory produces a cone with a target radius of \(r = 10\) cm and a target height of \(h = 15\) cm, which gives a target volume of \(V = 500 \pi \approx 1571\) cm³. Due to manufacturing tolerances, the radius might be off by \(\Delta r = 0.1\) cm, and the height might be off by \(\Delta h = 0.2\) cm. How might these potential errors impact the final volume of our cone?

We compute the partial derivatives of the volume function \(V(r,h)\): \[ \begin{aligned} V_r & = \frac{2}{3}\pi r h \implies V_r(10, 15) = \frac{2}{3}\pi(10)(15) = 100\pi \\ V_h & = \frac{1}{3}\pi r^2 \implies V_h(10, 15) = \frac{1}{3}\pi(10)^2 = \frac{100\pi}{3} \end{aligned} \]

Using the differential formula, the approximate change in volume is: \[ \begin{aligned} \Delta V & \approx V_r \Delta r + V_h \Delta h \\ & = \left(100\pi\right)(0.1) + \left(\frac{100\pi}{3}\right)(0.2) \\ & = 10\pi + \frac{20\pi}{3} \\ & = \frac{50\pi}{3} \text{ cm}^3. \end{aligned} \] So the volume will deviate from the target by approximately \(52 \text{ cm}^3\)—which works out to nearly 3.5% error!