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.

### 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:
• This is called the local linearization of $f$ near ${\mathbf{\text{x}}}_{0}$.

## 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{array}{r}\phantom{\rule{1em}{0ex}}T\left(x,y\right)=f\left({x}_{0},{y}_{0}\right)+{f}_{x}\left({x}_{0},{y}_{0}\right)\left(x-{x}_{0}\right)+{f}_{y}\left({x}_{0},{y}_{0}\right)\left(y-{y}_{0}\right)\end{array}$
This function $T\left(x,y\right)$ often goes by a different name: The "local linearization" of $f$ at the point $\left({x}_{0},{y}_{0}\right)$. You can think about this as the simplest function satisfying two properties:
1. It has the same value of $f$ at the point $\left({x}_{0},{y}_{0}\right)$.
2. It has the same partial derivatives as $f$ at the point $\left({x}_{0},{y}_{0}\right)$.
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({x}_{1},{x}_{2},\dots ,{x}_{n}\right)$
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({x}_{1},{x}_{2},\dots ,{x}_{n}\right)=2{x}_{1}+3{x}_{2}+\cdots -5{x}_{n}$
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:
$\mathbf{\text{x}}=\left[\begin{array}{c}{x}_{1}\\ {x}_{2}\\ ⋮\\ {x}_{n}\end{array}\right]$
And you would define the function using a dot product:
$f\left(\mathbf{\text{x}}\right)=\left[\begin{array}{c}2\\ 3\\ ⋮\\ -5\end{array}\right]\cdot \mathbf{\text{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(\mathbf{\text{x}}\right)=\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\underset{\text{Some constant}}{\underset{⏟}{c}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}+\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\stackrel{\text{Some vector}}{\stackrel{⏞}{\mathbf{\text{v}}}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\phantom{\rule{-0.167em}{0ex}}\cdot \mathbf{\text{x}}$
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(\mathbf{\text{x}}\right)$ does not have the luxury of being linear. (The bolded "$\mathbf{\text{x}}$" 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, ${\mathbf{\text{x}}}_{0}$, with a function that is linear. Specifically, here's what that new function looks like:
• Notice, by plugging in $\mathbf{\text{x}}={\mathbf{\text{x}}}_{0}$, you can see that both functions $f$ and ${L}_{f}$ will have the same value at the input ${\mathbf{\text{x}}}_{0}$.
• The vector dotted against the variable $\mathbf{\text{x}}$ is the gradient of $f$ at the specified input, $\mathrm{\nabla }f\left({\mathbf{\text{x}}}_{0}\right)$. This ensures that both functions $f$ and ${L}_{f}$ 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(x,y,z\right)=z{e}^{{x}^{2}-{y}^{3}}$
Find a linear function ${L}_{f}\left(x,y,z\right)$ such that the value of ${L}_{f}$ and all its partial derivatives match those of $f$ at the following point:
$\left({x}_{0},{y}_{0},{z}_{0}\right)=\left(8,4,3\right)$
Step 1: Evaluate $f$ at the chosen point
$f\left(8,4,3\right)=$

Step 2: Use this to start writing your function. Which of the following functions will be guaranteed to equal $f$ at the input $\left(x,y,z\right)=\left(8,4,3\right)$?
For both of these, $a$, $b$ and $c$ are all arbitrary constants.

The partial derivatives of ${L}_{f}$, as you have written it so far, are precisely these constants $a$, $b$ and $c$. So to force our function to have the same partial derivative information as $f$ at the point $\left(8,4,3\right)$, 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(x,y,z\right)=z{e}^{{x}^{2}-{y}^{3}}$
${f}_{x}\left(x,y,z\right)=$
${f}_{y}\left(x,y,z\right)=$
${f}_{z}\left(x,y,z\right)=$

Now we evaluate each of these at $\left(8,4,3\right)$.
${f}_{x}\left(8,4,3\right)=$
${f}_{y}\left(8,4,3\right)=$
${f}_{z}\left(8,4,3\right)=$

Step 4: Replacing the constants $a$, $b$ and $c$ in the expression of ${L}_{f}$ with these partial derivative values, what do you get?
${L}_{f}\left(x,y,z\right)=$

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.

## 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 $\sqrt{2.01+\sqrt{0.99+\sqrt{9.01}}}$. How would you do it?
Solution:
We can view this problem as evaluating a certain three-variable function at the point $\left(2.01,0.99,9.01\right)$, namely
$\phantom{\rule{1em}{0ex}}f\left(x,y,z\right)=\sqrt{x+\sqrt{y+\sqrt{z}}}$
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(2.01,0.99,9.01\right)$.
The point we care about is very close to the much simpler point $\left(2,1,9\right)$, so we find the local linearization of $f$ near that point. As before, we must find
• $f\left(2,1,9\right)$
• All partial derivatives of $f$ at $\left(2,1,9\right)$
The first of these is
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}f\left(2,1,9\right)& =\sqrt{2+\sqrt{1+\sqrt{9}}}\\ & =\sqrt{2+\sqrt{1+3}}\\ & =\sqrt{2+\sqrt{4}}\\ & =\sqrt{2+2}\\ & =\sqrt{4}\\ & =2\end{array}$
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 $\sqrt{x}$.
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}\frac{d}{dx}\sqrt{x}& =\frac{d}{dx}{x}^{\frac{1}{2}}=\frac{1}{2}{x}^{-\frac{1}{2}}=\frac{1}{2\sqrt{x}}\end{array}$
Okay, here we go. The simplest partial derivative is ${f}_{x}$
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}{f}_{x}& =\frac{\partial }{\partial x}\sqrt{x+\sqrt{y+\sqrt{z}}}=\frac{1}{2\sqrt{x+\sqrt{y+\sqrt{z}}}}\end{array}$
Since $y$ is nestled in there, ${f}_{y}$ requires some chain rule action:
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}{f}_{y}& =\frac{\partial }{\partial y}\sqrt{x+\sqrt{y+\sqrt{z}}}=\frac{1}{2\sqrt{x+\sqrt{y+\sqrt{z}}}}\cdot \frac{1}{2\sqrt{y+\sqrt{z}}}\end{array}$
Nestled even deeper, that tricky $z$ will require two iterations of the chain rule:
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}{f}_{z}& =\frac{\partial }{\partial z}\sqrt{x+\sqrt{y+\sqrt{z}}}=\frac{1}{2\sqrt{x+\sqrt{y+\sqrt{z}}}}\cdot \frac{1}{2\sqrt{y+\sqrt{z}}}\cdot \frac{1}{2\sqrt{z}}\end{array}$
Next, evaluate each one of these at $\left(2,1,9\right)$. This might seem like a lot, but they are all made up of the same three basic components:
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}\frac{1}{2\sqrt{x+\sqrt{y+\sqrt{z}}}}& =\frac{1}{2\sqrt{2+\sqrt{1+\sqrt{9}}}}=\frac{1}{2\sqrt{2+2}}=\frac{1}{4}\\ \frac{1}{2\sqrt{y+\sqrt{z}}}& =\frac{1}{2\sqrt{1+\sqrt{9}}}=\frac{1}{2\sqrt{4}}=\frac{1}{4}\\ \frac{1}{2\sqrt{z}}& =\frac{1}{2\sqrt{9}}=\frac{1}{6}\end{array}$
Plugging these values into our expressions for the partial derivatives, we have
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}{f}_{x}\left(2,1,9\right)& =\frac{1}{4}\\ \\ {f}_{y}\left(2,1,9\right)& =\frac{1}{4}\cdot \frac{1}{4}=\frac{1}{16}\\ \\ {f}_{z}\left(2,1,9\right)& =\frac{1}{4}\cdot \frac{1}{4}\cdot \frac{1}{6}=\frac{1}{96}\end{array}$
Unraveling the formula for local linearization, we get
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}{L}_{f}\left(\mathbf{\text{x}}\right)& =f\left({\mathbf{\text{x}}}_{0}\right)+\mathrm{\nabla }f\left({\mathbf{\text{x}}}_{0}\right)\cdot \left(\mathbf{\text{x}}-{\mathbf{\text{x}}}_{0}\right)\\ \\ & =f\left({\mathbf{\text{x}}}_{0}\right)+{f}_{x}\left({\mathbf{\text{x}}}_{0}\right)\left(x-{x}_{0}\right)+{f}_{y}\left({\mathbf{\text{x}}}_{0}\right)\left(y-{y}_{0}\right)+{f}_{z}\left({\mathbf{\text{x}}}_{0}\right)\left(z-{z}_{0}\right)\\ \\ & =\overline{)2+\frac{1}{4}\left(x-2\right)+\frac{1}{16}\left(y-1\right)+\frac{1}{96}\left(z-9\right)}\end{array}$
Finally, after all this work, we can plug in $\left(x,y,z\right)=\left(2.01,0.99,9.01\right)$ to compute our approximation
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}& \phantom{\rule{1em}{0ex}}2+\frac{1}{4}\left(2.01-2\right)+\frac{1}{16}\left(0.99-1\right)+\frac{1}{96}\left(9.01-9\right)\\ & \\ & =2+\frac{0.01}{4}+\frac{-0.01}{16}+\frac{0.01}{96}\end{array}$
Calculating this by hand still isn't easy, but at least it's doable. When you work it out, the final answer is
$\phantom{\rule{1em}{0ex}}\overline{)2.001979}$
$\phantom{\rule{1em}{0ex}}\sqrt{2.01+\sqrt{0.99+\sqrt{9.01}}}\approx \overline{)2.001978}$
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:
• This is called the local linearization of $f$ near ${\mathbf{\text{x}}}_{0}$.

## Want to join the conversation?

• Also, in example one, when they show what the plane looks like using vector notation, shouldn't the second vector components be x-8 not x, and y-4, not y and etc?
• I think what it should say is to dot the gradient of f (evaluated at (8, 4, 3)) with the vector:
((x, y, z) - (8, 4, 3))
i.e.:
∇f(x_0) . (x - x_0)
to fully replicate the generic formula, so in short: yes.
Well noticed!
• At "Example 1", given that f(x, y, z) = e^(x^2-y^3), shouldn't f(4, 8, 3) be 3*e^(4^2-8^3) = 3*e^(-496)≃0 ?
• You have the function the incorrect way around I believe. it is f(8,4,3). NOT f(4,8,3)
• Why does local linearization sound similar to taylor series?!
• Because it is indeed a (first-order) Taylor expansion for the original function! It's just that in this case you're trying to approximate a multivariable function, and so you're using partial derivatives instead of regular derivatives.
• Is "the local linearization" the same as "Linear approximation"(https://en.wikipedia.org/wiki/Linear_approximation) ?
• These are the same. To clarify the equality, compare this article to the formula that follows after quote: "Linear approximations for vector functions of a vector variable are obtained in the same way, with the derivative at a point replaced by the Jacobian matrix."

(a, b) at Wikipedia is (x0, y0) here.
• Under Example 1, after the line "Now notice what this looks like if you write it with vector notation," under the explanation, the last matrix should have the terms "x-8, y-4, and z-3.
• Can this be edited to include an example involving the linear localization of a vector valued function? Maybe something simple like from $\mathbb{R}^2 \to \mathbb{R}^3$?