If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Multivariable calculus

### Course: Multivariable calculus>Unit 3

Lesson 1: Tangent planes and local linearization

# Local linearization

Learn how to generalize the idea of a tangent plane into a linear approximation of scalar-valued multivariable functions.

## What we're building to

• Local linearization generalizes the idea of tangent planes to any multivariable function. Here, I will just talk about the case of scalar-valued multivariable functions.
• The idea is to approximate a function near one of its inputs with a simpler function that has the same value at that input, as well as the same partial derivative values.
• Written with vectors, here's what the approximation function looks like:
L, start subscript, f, end subscript, left parenthesis, start bold text, x, end bold text, right parenthesis, equals, start underbrace, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, end text, end subscript, plus, start underbrace, del, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, space, v, e, c, t, o, r, end text, end subscript, dot, start overbrace, left parenthesis, start bold text, x, end bold text, minus, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end overbrace, start superscript, start bold text, x, end bold text, start text, space, i, s, space, t, h, e, space, v, a, r, i, a, b, l, e, end text, end superscript
• This is called the local linearization of f near start bold text, x, end bold text, start subscript, 0, end subscript.

## Tangent planes as approximations

In the previous article, I talked about finding the tangent plane to a two-variable function's graph.
The formula for the tangent plane ended up looking like this.
\begin{aligned} \quad T(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) \end{aligned}
This function T, left parenthesis, x, comma, y, right parenthesis often goes by a different name: The "local linearization" of f at the point left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, right parenthesis. You can think about this as the simplest function satisfying two properties:
1. It has the same value of f at the point left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, right parenthesis.
2. It has the same partial derivatives as f at the point left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, right parenthesis.
As always in multivariable calculus, it is healthy to contemplate a new concept without relying on graphical intuition. That's not to say you should not try to think visually. Maybe instead think purely about the input space, or think relevant transformation rather than the graph.
Fundamentally, a local linearization approximates one function near a point based on the information you can get from its derivative(s) at that point.
In the case of functions with a two-variable input and a scalar (i.e. non-vector) output, this can be visualized as a tangent plane. However, with higher dimensions we don't have this visual luxury, so we are left to think about it just as an approximation.
In real-world applications of multivariable calculus, you almost never care about an actual plane in space. Instead, you might have some complicated function, like, oh, I don't know, air resistance on a parachute as a function of speed and orientation. Dealing with the actual function may be tricky or computationally expensive, so it's helpful to approximate it with something simpler, like a linear function.

## What do I mean by "Linear function"?

Consider a function with a multidimensional input.
f, left parenthesis, x, start subscript, 1, end subscript, comma, x, start subscript, 2, end subscript, comma, dots, comma, x, start subscript, n, end subscript, right parenthesis
This function is called linear if in its definition, all the coordinates are just multiplied by constants, with nothing else happening to them. For example, it might look like this:
f, left parenthesis, x, start subscript, 1, end subscript, comma, x, start subscript, 2, end subscript, comma, dots, comma, x, start subscript, n, end subscript, right parenthesis, equals, 2, x, start subscript, 1, end subscript, plus, 3, x, start subscript, 2, end subscript, plus, \@cdots, minus, 5, x, start subscript, n, end subscript
The full story of linearity goes deeper (hence the existence of the field "Linear algebra"), but for now, this conception will do. Typically, instead of writing out all the variable like this, you would treat the input as a vector:
$\textbf{x} = \left[ \begin{array}{c} x_1 \\ x_2 \\ \vdots \\ x_n \end{array} \right]$
And you would define the function using a dot product:
$f(\textbf{x}) = \left[ \begin{array}{c} 2 \\ 3 \\ \vdots \\ -5 \end{array} \right] \cdot \textbf{x}$
For the purposes of this article, and more generally when you talk about local linearization, you are allowed to add in a constant to this expression:
f, left parenthesis, start bold text, x, end bold text, right parenthesis, equals, start underbrace, c, end underbrace, start subscript, start text, S, o, m, e, space, c, o, n, s, t, a, n, t, end text, end subscript, plus, start overbrace, start bold text, v, end bold text, end overbrace, start superscript, start text, S, o, m, e, space, v, e, c, t, o, r, end text, end superscript, dot, start bold text, x, end bold text
If you wanted to be pedantic, this is no longer a linear function. It's what's called an "affine" function. But most people would say "whatever, it's basically linear".

## Local linearization

Now, suppose your function f, left parenthesis, start bold text, x, end bold text, right parenthesis does not have the luxury of being linear. (The bolded "start bold text, x, end bold text" still represents a multidimensional vector). It might be defined by some crazy expression way more wild than a dot product.
The idea of a local linearization is to approximate this function near some particular input value, start bold text, x, end bold text, start subscript, 0, end subscript, with a function that is linear. Specifically, here's what that new function looks like:
L, start subscript, f, end subscript, left parenthesis, start bold text, x, end bold text, right parenthesis, equals, start underbrace, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, end text, end subscript, plus, start underbrace, del, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, space, v, e, c, t, o, r, end text, end subscript, dot, start overbrace, left parenthesis, start bold text, x, end bold text, minus, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end overbrace, start superscript, start bold text, x, end bold text, start text, space, i, s, space, t, h, e, space, v, a, r, i, a, b, l, e, end text, end superscript
• Notice, by plugging in start bold text, x, end bold text, equals, start bold text, x, end bold text, start subscript, 0, end subscript, you can see that both functions f and L, start subscript, f, end subscript will have the same value at the input start bold text, x, end bold text, start subscript, 0, end subscript.
• The vector dotted against the variable start bold text, x, end bold text is the gradient of f at the specified input, del, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis. This ensures that both functions f and L, start subscript, f, end subscript will have the same gradient at the specified input. In other words, all their partial derivative information will be the same.
I think the best way to understand this formula is to basically derive it for yourself in the context of a specific function.

## Example 1: Finding a local linearization.

Problem: Have yourself a function:
f, left parenthesis, x, comma, y, comma, z, right parenthesis, equals, z, e, start superscript, x, squared, minus, y, cubed, end superscript
Find a linear function L, start subscript, f, end subscript, left parenthesis, x, comma, y, comma, z, right parenthesis such that the value of L, start subscript, f, end subscript and all its partial derivatives match those of f at the following point:
left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, comma, z, start subscript, 0, end subscript, right parenthesis, equals, left parenthesis, 8, comma, 4, comma, 3, right parenthesis

Step 1: Evaluate f at the chosen point
f, left parenthesis, 8, comma, 4, comma, 3, right parenthesis, equals

Step 2: Use this to start writing your function. Which of the following functions will be guaranteed to equal f at the input left parenthesis, x, comma, y, comma, z, right parenthesis, equals, left parenthesis, 8, comma, 4, comma, 3, right parenthesis?
For both of these, start color #11accd, a, end color #11accd, start color #e84d39, b, end color #e84d39 and start color #1fab54, c, end color #1fab54 are all arbitrary constants.

The partial derivatives of L, start subscript, f, end subscript, as you have written it so far, are precisely these constants start color #11accd, a, end color #11accd, start color #0d923f, b, end color #0d923f and start color #e84d39, c, end color #e84d39. So to force our function to have the same partial derivative information as f at the point left parenthesis, 8, comma, 4, comma, 3, right parenthesis, we just need to set these constants equal to the corresponding partial derivatives of f at this point.
Step 3: Compute each partial derivative of f, left parenthesis, x, comma, y, comma, z, right parenthesis, equals, z, e, start superscript, x, squared, minus, y, cubed, end superscript
f, start subscript, x, end subscript, left parenthesis, x, comma, y, comma, z, right parenthesis, equals
f, start subscript, y, end subscript, left parenthesis, x, comma, y, comma, z, right parenthesis, equals
f, start subscript, z, end subscript, left parenthesis, x, comma, y, comma, z, right parenthesis, equals

Now we evaluate each of these at left parenthesis, 8, comma, 4, comma, 3, right parenthesis.
f, start subscript, x, end subscript, left parenthesis, 8, comma, 4, comma, 3, right parenthesis, equals
f, start subscript, y, end subscript, left parenthesis, 8, comma, 4, comma, 3, right parenthesis, equals
f, start subscript, z, end subscript, left parenthesis, 8, comma, 4, comma, 3, right parenthesis, equals

Step 4: Replacing the constants start color #11accd, a, end color #11accd, start color #0d923f, b, end color #0d923f and start color #e84d39, c, end color #e84d39 in the expression of L, start subscript, f, end subscript with these partial derivative values, what do you get?
L, start subscript, f, end subscript, left parenthesis, x, comma, y, comma, z, right parenthesis, equals

Now notice what this looks like if you write it with vector notation.
It is just a specific form of the general formula shown above.
L, start subscript, f, end subscript, left parenthesis, start bold text, x, end bold text, right parenthesis, equals, start underbrace, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, end text, end subscript, plus, start underbrace, del, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, space, v, e, c, t, o, r, end text, end subscript, dot, start overbrace, left parenthesis, start bold text, x, end bold text, minus, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end overbrace, start superscript, start bold text, x, end bold text, start text, space, i, s, space, t, h, e, space, v, a, r, i, a, b, l, e, end text, end superscript

## Example 2: Using local linearization for estimation

What follows is by no means a practical application, but working through it will help give a feel for what local linearization is doing.
Problem: Suppose you are on a desert island without a calculator, and you need to estimate square root of, 2, point, 01, plus, square root of, 0, point, 99, plus, square root of, 9, point, 01, end square root, end square root, end square root. How would you do it?
Solution:
We can view this problem as evaluating a certain three-variable function at the point left parenthesis, 2, point, 01, comma, 0, point, 99, comma, 9, point, 01, right parenthesis, namely
f, left parenthesis, x, comma, y, comma, z, right parenthesis, equals, square root of, x, plus, square root of, y, plus, square root of, z, end square root, end square root, end square root
I don't know about you, but I'm not sure how to evaluate square roots by hand. If only this function was linear! Then working it out by hand would only involve adding and multiplying numbers. What we could do is find the local linearization at a nearby point where evaluating f is easier. Then we can get close to the right answer by evaluating the linearization at the point left parenthesis, 2, point, 01, comma, 0, point, 99, comma, 9, point, 01, right parenthesis.
The point we care about is very close to the much simpler point left parenthesis, 2, comma, 1, comma, 9, right parenthesis, so we find the local linearization of f near that point. As before, we must find
• f, left parenthesis, 2, comma, 1, comma, 9, right parenthesis
• All partial derivatives of f at left parenthesis, 2, comma, 1, comma, 9, right parenthesis
The first of these is
\begin{aligned} \quad f(2, 1, 9) &= \sqrt{2 + \sqrt{1 + \sqrt{9}}} \\ &= \sqrt{2 + \sqrt{1 + 3}} \\ &= \sqrt{2 + \sqrt{4}} \\ &= \sqrt{2+2} \\ &= \sqrt{4} \\ &= 2 \end{aligned}
Looks like someone chose a few convenient input values, eh?
On to the partial derivatives (heavy sigh). Since the square roots are abundant, let's write out for ourselves the derivative of square root of, x, end square root.
\begin{aligned} \quad \dfrac{d}{dx} \sqrt{x} &= \dfrac{d}{dx} x^{\frac{1}{2}} = \dfrac{1}{2} x^{-\frac{1}{2}} = \dfrac{1}{2\sqrt{x}} \end{aligned}
Okay, here we go. The simplest partial derivative is f, start subscript, x, end subscript
\begin{aligned} \quad f_x &= \dfrac{\partial }{\partial \blueD{x}} \sqrt{\blueD{x} + \sqrt{y + \sqrt{z}}} = \dfrac{1}{2\sqrt{\blueD{x} + \sqrt{y + \sqrt{z}}}} \\ \end{aligned}
Since y is nestled in there, f, start subscript, y, end subscript requires some chain rule action:
\begin{aligned} \quad f_y &= \dfrac{\partial }{\partial \redD{y}} \sqrt{x + \sqrt{\redD{y} + \sqrt{z}}} = \dfrac{1}{2\sqrt{x + \sqrt{\redD{y} + \sqrt{z}}}} \cdot \dfrac{1}{2\sqrt{\redD{y} + \sqrt{z}}} \\ \end{aligned}
Nestled even deeper, that tricky z will require two iterations of the chain rule:
\begin{aligned} \quad f_z &= \dfrac{\partial }{\partial \greenD{z}} \sqrt{x + \sqrt{y + \sqrt{\greenD{z}}}} = \dfrac{1}{2\sqrt{x + \sqrt{y + \sqrt{\greenD{z}}}}} \cdot \dfrac{1}{2\sqrt{y + \sqrt{\greenD{z}}}} \cdot \dfrac{1}{2\sqrt{\greenD{z}}} \end{aligned}
Next, evaluate each one of these at left parenthesis, 2, comma, 1, comma, 9, right parenthesis. This might seem like a lot, but they are all made up of the same three basic components:
\begin{aligned} \quad \dfrac{1}{2\sqrt{x + \sqrt{y + \sqrt{z}}}} &= \dfrac{1}{2\sqrt{2 + \sqrt{1+\sqrt9}}} = \dfrac{1}{2\sqrt{2+2}} = \dfrac{1}{4} \\ \dfrac{1}{2\sqrt{y + \sqrt{z}}} &= \dfrac{1}{2\sqrt{1 + \sqrt{9}}} = \dfrac{1}{2\sqrt{4}} = \dfrac{1}{4} \\ \dfrac{1}{2\sqrt{z}} &= \dfrac{1}{2\sqrt{9}} = \dfrac{1}{6} \\ \end{aligned}
Plugging these values into our expressions for the partial derivatives, we have
\begin{aligned} \quad f_x(2, 1, 9) &= \blueD{\dfrac{1}{4}} \\ \\ f_y(2, 1, 9) &= \dfrac{1}{4} \cdot \dfrac{1}{4} = \redD{\dfrac{1}{16}} \\ \\ f_z(2, 1, 9) &= \dfrac{1}{4} \cdot \dfrac{1}{4} \cdot \dfrac{1}{6} = \greenD{\dfrac{1}{96}}\\ \end{aligned}
Unraveling the formula for local linearization, we get
\begin{aligned} \quad L_f(\textbf{x}) &= f(\textbf{x}_0) + \nabla f(\textbf{x}_0) \cdot (\textbf{x} - \textbf{x}_0) \\ \\ &= f(\textbf{x}_0) + \blueD{f_x(\textbf{x}_0)(x - x_0)} + \redD{f_y(\textbf{x}_0)}(y - y_0) + \greenD{f_z(\textbf{x}_0)}(z - z_0) \\ \\ &= \boxed{ 2 + \blueD{\dfrac{1}{4}}(x - 2) + \redD{\dfrac{1}{16}}(y - 1) + \greenD{\dfrac{1}{96}}(z - 9) } \end{aligned}
Finally, after all this work, we can plug in left parenthesis, x, comma, y, comma, z, right parenthesis, equals, left parenthesis, 2, point, 01, comma, 0, point, 99, comma, 9, point, 01, right parenthesis to compute our approximation
\begin{aligned} \quad &\quad 2 + \dfrac{1}{4}(2.01 - 2) + \dfrac{1}{16}(0.99 - 1) + \dfrac{1}{96}(9.01 - 9) \\ &\\ &= 2 + \dfrac{0.01}{4} + \dfrac{-0.01}{16} + \dfrac{0.01}{96} \end{aligned}
Calculating this by hand still isn't easy, but at least it's doable. When you work it out, the final answer is
start box, 2, point, 001979, end box
square root of, 2, point, 01, plus, square root of, 0, point, 99, plus, square root of, 9, point, 01, end square root, end square root, end square root, approximately equals, start box, 2, point, 001978, end box
So our approximation is pretty good!

## Why do we care?

Although it is not common to find yourself estimating square roots on a desert island (at least where I'm from), what is common in the contexts of math and engineering is wrangling with complicated but differentiable functions. The phrase "just linearize it" is tossed around so much that not knowing what it means could be awkward.
Remember, a local linearization approximates one function near a point based on the information you can get from its derivative(s) at that point. Even though you can use a computer to evaluate functions, that's not always enough.
• You might need to evaluate it many thousands of times per second, and working it out in full takes too long.
• Maybe you don't even have the function explicitly written out, and you just have a few measurements near a point which you wish to extrapolate.
• Sometimes what you care about is the inverse function, which can be hard or even impossible to find for the function as a whole, whereas inverting linear functions is relatively straight-forward.

## Summary

• Local linearization generalizes the idea of tangent planes to any multivariable function.
• The idea is to approximate a function near one of its inputs with a simpler function that has the same value at that input, as well as the same partial derivative values.
• Written with vectors, here's what the approximation function looks like:
L, start subscript, f, end subscript, left parenthesis, start bold text, x, end bold text, right parenthesis, equals, start underbrace, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, end text, end subscript, plus, start underbrace, del, f, left parenthesis, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end underbrace, start subscript, start text, C, o, n, s, t, a, n, t, space, v, e, c, t, o, r, end text, end subscript, dot, start overbrace, left parenthesis, start bold text, x, end bold text, minus, start bold text, x, end bold text, start subscript, 0, end subscript, right parenthesis, end overbrace, start superscript, start bold text, x, end bold text, start text, space, i, s, space, t, h, e, space, v, a, r, i, a, b, l, e, end text, end superscript
• This is called the local linearization of f near start bold text, x, end bold text, start subscript, 0, end subscript.