Skip to main content

Chapter 5 CA5: Linear Approximations

In Math1110 we looked at the idea of “the linearization of a function of one variable”. The idea was that near the point \(x=x_0\) we could approximate the function \(f(x)\) using the line tangent to the function at \(x=x_0\text{.}\) We called this tangent the linearization of the function at \(x=x_0\) and used it to derive the “linear approximation formula”,
\begin{equation*} \Delta y \simeq f'(x_0) \Delta x\text{.} \end{equation*}
These ideas can also be applied to functions of two variables.

Section 5.1 Tangent Planes

Recall that the graph associated with the function \(z=f(x,y)\) is a surface in \(\mathbb{R}^3\) (that passes the vertical line test). Wherever this surface does not have any discontinuities or cusp-like points it will have a tangent plane. Like the tangent line to the graph of a function of one variable, the tangent plane to the function \(z=f(x,y)\) at the point \((x_0,y_0)\) is the plane that “just touches” the surface at the point \((x_0,y_0,z_0)\text{.}\)

Example 5.1.

For the function \(f(x,y) = 5-\dfrac{x^2+y^2}{2}\) the graph below shows the graph of the function and it’s tangent plane at the point \((x,y) = (2,1)\text{.}\)
Figure 5.2. 3D plot of \(f(x,y)= 5 - \dfrac{x^2+y^2}{2}\) and the tangent plane at \((2,1)\text{.}\)
To find the equation of the plane tangent to the function \(z=f(x,y)\) at the point \((x_0,y_0,z_0)\text{,}\) firstly recall that the equation of a plane in Cartesian form is given by
\begin{equation*} ax+by+cz = k, \quad a,b,c,k \in \mathbb{R}, \end{equation*}
or in normal form, as illustrated in Figure 5.3, by
\begin{equation} \mathbf{n} \cdot (\mathbf{r}-\mathbf{r}_0) = 0\tag{5.1} \end{equation}
where \(\mathbf{n} = \langle a,b,c \rangle\) is a normal vector to the plane, \(\mathbf{r}_0\) is the position vector of a point on the plane and \(\mathbf{r} = \langle x,y,z \rangle\text{.}\)
Figure 5.3. Representation of the normal vector \(\mathbf{n}\) to a plane.

Example 5.4.

Find the equation of the tangent plane to the function \(f(x,y) = 5-\dfrac{x^2+y^2}{2}\) at \((x,y) = (2,1)\text{.}\)
Answer.
\(2x+y+z=\dfrac{15}{2}\)
Solution.
Now, we know that the partial derivative \(f_x(2,1)\) gives the slope of the tangent at \(x=2\text{,}\) to the curve of intersection of the surface associated with \(f\) and the plane \(y=1\text{.}\)
Figure 5.5.
Since this tangent line lies in the plane tangent to \(f\) at \((x,y) = (2,1)\) the vector
\begin{equation*} \langle 1,0,f_x(2,1) \rangle \end{equation*}
will be a vector that is parallel to the tangent plane, (or lies in the tangent plane if we place it’s tail at the point \((2,1,\frac{5}{2})\)). Similarly, the vector
\begin{equation*} \langle 0,1,f_y(2,1) \rangle \end{equation*}
will be another vector parallel to the tangent plane. Since these two non-parallel vectors are parallel to the tangent plane, their vector product will give a vector normal to the tangent plane, i.e.
\begin{align*} \mathbf{n} \amp = \langle 1,0,f_x(2,1) \rangle \times \langle 0,1,f_y(2,1) \rangle\\ \amp = \langle -f_x(2,1), -f_y(2,1), 1 \rangle\\ \amp = \langle 2,1,1 \rangle \end{align*}
Thus, using equation (5.1), the equation of the plane tangent to \(f(x,y) = 5 - \dfrac{x^2+y^2}{2}\) at \((x,y) = (2,1)\) is
\begin{equation*} \langle 2,1,1 \rangle \cdot \left( \langle x,y,z \rangle - \langle 2,1,\frac{5}{2} \rangle \right) = 0 \end{equation*}
which simplifies to
\begin{equation*} 2x+y+z=\frac{15}{2}\text{.} \end{equation*}
In general, to find the equation of the plane tangent to the function \(f(x,y)\) at the point \((x_0,y_0)\text{,}\) note that the vectors
\begin{equation*} \langle 1, 0, f_x(x_0,y_0) \rangle \: \text{and} \: \langle 0,1,f_y(x_0,y_0) \rangle \end{equation*}
lie in the tangent plane and hence a normal to the plane is
\begin{align*} \mathbf{n} \amp = \langle 1, 0, f_x(x_0,y_0) \rangle \times \langle0,1,f_y(x_0,y_0) \rangle\\ \amp = \langle -f_x(x_0,y_0), -f_y(x_0,y_0),1 \rangle\text{.} \end{align*}
Since the point \((x_0,y_0,z_0)\) lies on the plane, using equation (5.1), the equation of the tangent plane is
\begin{equation*} \langle -f_x(x_0,y_0), -f_y(x_0,y_0),1 \rangle \cdot \bigg( \langle x,y,z \rangle - \langle x_0, y_0, z_0 \rangle \bigg) = 0. \end{equation*}
On expanding and rearranging this we get the following result.
The Sage cell below uses the equation of the tangent plane given above to plot the tangent plane to the function \(f(x,y)=xy\) at a point \((x_0,y_0)\text{.}\)

Example 5.7.

Find the equation of the plane tangent to \(z = x^2+2y^2\) at the point \((x,y)=(1,2)\text{.}\)
Figure 5.8. 3D plot of \(z = x^2+2y^2\) and the tangent plane at \((1,2)\text{.}\)
Answer.
\(2x+8y-z-9=0\)
Solution.
Firstly, note that when \((x,y)=(1,2)\text{,}\) \(z=9\text{.}\) Now
\begin{equation*} z_x = 2x \: \text{ and so } \: z_x(1,2) = 2 \end{equation*}
and
\begin{equation*} z_y = 4y \: \text{ and so } \: z_y(1,2) = 8\text{.} \end{equation*}
Thus the equation of the tangent plane is
\begin{equation*} z = 9+2(x-1)+8(y-2) \end{equation*}
which simplifies to
\begin{equation*} 2x+8y-z-9=0\text{.} \end{equation*}

Example 5.9.

Find the equation of the line normal to the graph of the function \(z=x^2+2y^2\) at the point \((x,y) = (1,2)\text{.}\)
Answer.
\(\mathbf{r} = \langle 1, 2, 9 \rangle + t \langle -2, -8, 1 \rangle\)
Solution.
Recall that the vector equation of a line in \(\mathbb{R}^3\) is
\begin{equation*} \mathbf{r} = \mathbf{r}_0 + t \mathbf{d}, \: t \in \mathbb{R} \end{equation*}
where \(\mathbf{r} = \langle x, y, z \rangle\) is the position vector of a general point, \(\mathbf{r}_0\) is the position vector of a point that lies on the line and \(d\) is a direction vector for the line (i.e. a vector that is parallel to the line).
We know that a vector normal to the surface \(z=f(x,y)\) at the point \((x_0,y_0,z_0)\) is given by
\begin{equation*} \mathbf{n} = \langle -f_x(x_0,y_0), -f_y(x_0,y_0),1 \rangle\text{.} \end{equation*}
For the function \(z=x^2+2y^2\text{,}\) \(z_x=2x\) and \(z_y=4y\text{.}\) Thus a direction vector for the line normal to \(z=x^2+2y^2\) at the point \((x,y)=(1,2)\) will be
\begin{equation*} \mathbf{d} = \langle -2, -8, 1 \rangle\text{.} \end{equation*}
Since the normal line passes through the point \((1,2,9)\) its equation is
\begin{equation*} \mathbf{r} = \langle 1, 2, 9 \rangle + t \langle -2, -8, 1 \rangle\text{.} \end{equation*}

Exercises Example Tasks

1.
Find the equation of the tangent plane to \(z=x^2-5xy+2y^2\) at the point \((x,y)=(-1,-2)\text{.}\)
2.
Find the equation of the tangent plane and normal line to \(z = \sqrt{x+y} \sin (xy)\) at the point \((x,y)=(0,1)\text{.}\)
3.
Show that every line that is normal to the sphere \(x^2+y^2+z^2 = 1\) passes through the origin.

Section 5.2 Linear Approximations

In Section 5.1 we found that the equation of the tangent plane to the function \(f(x,y)\) at the point \((x_0,y_0,f(x_0,y_0))\text{,}\) which is a linear equation.

Definition 5.10.

We call the function
\begin{equation*} 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) \end{equation*}
the linearisation of \(f\) at the point \((x_0,y_0)\text{.}\)

Example 5.11.

Find the linearisation of \(z=\sin(x)\cos(y)\) at the point \((x,y) = \left(\dfrac{\pi}{4},\dfrac{\pi}{4} \right)\text{.}\)
Answer.
\(L(x,y) = \dfrac{1}{2} + \dfrac{1}{2} \left( x - \dfrac{\pi}{4} \right) - \dfrac{1}{2} \left(y - \dfrac{\pi}{4} \right)\)
Solution.
Begin by calculating the partial derivatives of \(z\text{,}\)
\begin{equation*} z_x = \cos(x)\cos(y) \: \text{ and } \: z_y = -\sin(x)\sin(y)\text{.} \end{equation*}
Thus
\begin{alignat*}{2} z \left(\dfrac{\pi}{4},\dfrac{\pi}{4} \right) \amp = \, \, \, \, \sin \left(\dfrac{\pi}{4} \right) \cos \left(\dfrac{\pi}{4} \right) \amp = \dfrac{1}{2}\\ z_x \left(\dfrac{\pi}{4},\dfrac{\pi}{4} \right) \amp = \, \, \, \, \cos \left(\dfrac{\pi}{4} \right) \cos \left(\dfrac{\pi}{4} \right) \amp = \dfrac{1}{2}\\ z_y \left(\dfrac{\pi}{4},\dfrac{\pi}{4} \right) \amp = -\sin \left(\dfrac{\pi}{4} \right) \sin \left(\dfrac{\pi}{4} \right) \amp = -\dfrac{1}{2}\text{.} \end{alignat*}
and so the linearisation is
\begin{equation*} L(x,y) = \dfrac{1}{2} + \dfrac{1}{2} \left( x - \dfrac{\pi}{4} \right) - \dfrac{1}{2} \left(y - \dfrac{\pi}{4} \right)\text{.} \end{equation*}
When we use the linearisation of \(f\) at the point \((x_0,y_0)\) to approximate the function near the point \((x_0,y_0)\) we call this the linear (or tangent plane) approximation of \(f\) at the point \((x_0,y_0)\text{.}\) Notice that if we let the independent variables change by the amounts \(\Delta x\) and \(\Delta y\) then the linearisation will change from \(L(x_0,y_0)\) to \(L(x_0+\Delta x, y_0 + \Delta y)\text{.}\) Thus we can approximate the change in the function value \(z=f(x,y)\) by
\begin{equation*} \Delta z \simeq L(x_0 + \Delta x, y_0 + \Delta y) - L(x_0,y_0). \end{equation*}
On using the linearisation formula given above, we end up with the following result.

Definition 5.12. The Linear Approximation Formula.

The linear approximation to the change, \(\Delta z\text{,}\) in the function \(z = f(x,y)\) when the independent variables change from \((x_0,y_0)\) to \((x_0+\Delta x, y_0 + \Delta y)\) is
\begin{equation*} \Delta z \simeq f_x (x_0, y_0) \Delta x + f_y (x_0, y_0) \Delta y\text{.} \end{equation*}
This result is sometimes called the “small change” formula for functions of two variables.

Example 5.13.

For the function \(f(x,y) = 3x^4+2y^4\text{,}\) \(f(1,2) = 35\text{.}\) Use a linear approximation to estimate \(f(1.01,2.03)\text{.}\)
Answer.
\(f(1.01,2.03) \simeq 37.04\)
Solution.
Via a linear approximation
\begin{equation*} f(1.01,2.03) \simeq f(1,2) + \Delta f\text{.} \end{equation*}
Here
\begin{equation*} f_x = 12x^3 \: \text{ and } \: f_y = 8y^3 \end{equation*}
and so
\begin{equation*} f_x(1,2) = 12 \: \text{ and } \: f_y(1,2) = 64\text{.} \end{equation*}
Thus, with \(\Delta x = 0.01\) and \(\Delta y = 0.03\text{,}\) via the linear approximation formula
\begin{equation*} \Delta f = 12 \times 0.01 + 64 \times 0.03 = 2.04 \end{equation*}
and hence
\begin{equation*} f(1.01,2.03) \simeq 35 + 2.04 = 37.04 \end{equation*}

Example 5.14.

A steel ball has a mass, \(m\text{,}\) of 6300 \(\pm\) 50 g and has volume, \(V\text{,}\) 800 \(\pm\) 10 cm3. Find the density of the ball, including an estimate of the error.
Answer.
\(\rho = \) 7.875 \(\pm \) 0.1609375 gcm3
Solution.
The density, \(\rho\text{,}\) is given by
\begin{equation*} \rho = \dfrac{m}{V}\text{.} \end{equation*}
Thus
\begin{equation*} \rho = \dfrac{6300}{800} = 7.875 \: g/cm^3. \end{equation*}
Using a linear approximation to estimate the error
\begin{equation*} \Delta \rho \simeq \dfrac{\partial \rho}{\partial m} \Delta m + \dfrac{\partial \rho}{\partial V} \Delta V\text{.} \end{equation*}
Now
\begin{equation*} \dfrac{\partial \rho}{\partial m} = \dfrac{1}{V} \: \text{ and } \: \dfrac{\partial \rho}{\partial V} = -\dfrac{m}{V^2} \end{equation*}
and so at \(m=6300\text{,}\) \(V=800\) and with \(\Delta m = 50\) and \(\Delta V = -10\) (to get the maximum value of \(\Delta \rho\))
\begin{equation*} \Delta \rho \simeq \frac{1}{800} \times 50 + \frac{6300}{800^2} \times 10 = 0.1609375\text{.} \end{equation*}
Thus
\begin{equation*} \rho = 7.875 \pm 0.1609375 \: g/cm^3\text{.} \end{equation*}

Example 5.15.

Use a linear approximation to estimate the value of \(z\) at \((x,y) = (1.1,-0.02)\) for surface \(z = f(x,y)\) defined implicitly by \(z-yz^3 = x+2\text{.}\)
Answer.
\(z(1.1,-0.02) \simeq 2.56\)
Solution.
Firstly notice that when \(x=1\) and \(y=0\text{,}\) \(z=3\text{.}\) Thus \(z(1,0)=3\text{.}\) Now, via a linear approximation
\begin{equation*} z(1.1,-0.02) \simeq z(1,0) + \Delta z \end{equation*}
where
\begin{equation*} \Delta z \simeq z_x(1,0) \Delta x + z_y(1,0) \Delta y\text{,} \end{equation*}
and \(\Delta x = 0.1\text{,}\) \(\Delta y = -0.02\text{.}\) To find the partial derivatives we need to use implicit differentiation. Differentiating with respect to \(x\text{:}\)
\begin{align*} \dfrac{\partial}{\partial x} (z - yz^3) \amp = \dfrac{\partial}{\partial x} (x+2)\\ z_x - 3y z^2 z_x \amp = 1\\ z_x \amp = \dfrac{1}{1-3yz^2}\text{.} \end{align*}
Thus
\begin{equation*} z_x(1,0) = \dfrac{1}{1-3 \times 0 \times 3^2} = 1\text{.} \end{equation*}
Differentiating with respect to y:
\begin{align*} \dfrac{\partial}{\partial y} (z - yz^3) \amp = \dfrac{\partial}{\partial y} (x+2)\\ z_y - (3y z^2 z_y + z^3) \amp = 0\\ z_y \amp = \dfrac{z^3}{1-3yz^2}\text{.} \end{align*}
Thus
\begin{equation*} z_y(1,0) = \dfrac{3^3}{1-3 \times 0 \times 3^2} = 27\text{.} \end{equation*}
Putting this together gives
\begin{equation*} \Delta z \simeq 1 \times 0.1 + 27 \times (-0.02) = -0.44 \end{equation*}
and hence
\begin{equation*} z(1.1,-0.02) \simeq 3-0.44 = 2.56. \end{equation*}

Exercises Example Tasks

1.
Use a linear approximation to find the value of \(z(2.96,-0.95)\) when
\begin{equation*} z=x^2-xy+3y^2\text{.} \end{equation*}
2.
Use a linear approximation to estimate the value of \(\sqrt{(2.01)^2-0.98}\text{.}\)
3.
A right angled triangle \(ABC\) with right angle at \(B\) is measured with \(AB = \) 10 \(\pm\) 0.02 cm and \(BC = \) 3.4 \(\pm\) 0.02 cm. What is the angle at \(A\text{,}\) including the error?
4.
In the figure below a rectangle initially with sides \(x\) and \(y\) has been made larger so that the sides are now \(x + \Delta x\) and \(y + \Delta y\text{.}\)
Figure 5.16.
Shade on the diagram the regions that represent:
  1. The increase in area.
  2. The linear approximation to the increase in area. Explain your answer.

Section 5.3 Quadratic Approximations

We have seen previously that for functions of one variable the idea of the linearisation of the function could be extended by considering the Taylor polynomial for the function.

Example 5.17.

For the function \(f(x) = e^x\) the Maclaurin polynomial of degree \(n\) is
\begin{equation*} \sum_{k=0}^{n} \dfrac{x^k}{k!} = 1+x+\dfrac{x^2}{2!}+\ldots+\dfrac{x^n}{n!}\text{.} \end{equation*}
We saw that the linearisation of \(e^x\) at \(x=0\) was the Maclaurin polynomial of degree 1, i.e.
\begin{equation*} T_1 (x) = 1+x\text{.} \end{equation*}
The Maclaurin polynomial of degree 2, i.e.
\begin{equation*} T_2 (x) = 1 + x + \dfrac{x^2}{2} \end{equation*}
gives a quadratic approximation to \(e^x\) about \(x=0\) and so on.
For functions of one variable we derived the Taylor series by trying to find a power series in \((x-a)\) that matched the function and all its derivatives at \(x=a\text{.}\) For functions of two variables we can use a similar idea to derive the Taylor series about the point \((x,y)=(a,b)\text{.}\) This series will be a power series in \((x-a)\) and \((y-b)\) that matches the function and its partial derivatives at the point \((x,y)=(a,b)\text{.}\) The formula for the Taylor series of two variables is quite lengthy to write and so we will not reproduce it here. However, as with functions of one variable truncations of this series are called Taylor polynomials and the Taylor polynomial of degree 1 is the linearisation of the function. Similarly, the Taylor polynomial of degree 2 will give us a quadratic approximation to the function.

Definition 5.18. Taylor Polynomial of Degree 2.

The Taylor Polynomial of degree 2 for the function of two variables \(f(x,y)\) about the point \((x,y) = (a,b)\) is
\begin{align*} T_2(x,y) = \amp f(a,b) + f_x(a,b)(x-a) + f_y(a,b)(y-b)\\ \amp + \dfrac{f_{xx}(a,b)}{2!} (x-a)^2 + f_{xy}(a,b)(x-a)(y-b) + \dfrac{f_{yy}(a,b)}{2!}(y-b)^2 \end{align*}
The question of how good an approximation this polynomial is goes beyond what we will cover in this course but if \(f(x,y)\) has continuous partial derivatives and if \((x,y)\) is “sufficiently close to” \((a,b)\) then the approximation should be useful.

Example 5.19.

Find the quadratic approximation to the function \(f(x,y) = x^2y\) about the point \((x,y) = (1,2)\text{.}\)
Answer.
\(T_2(x,y) = 2+4(x-1)+(y-2)+2(x-1)^2+2(x-1)(y-2)\)
Solution.
First calculate the partial derivatives:
\begin{equation*} f_x = 2xy, \: \: f_y = x^2, \: \: f_{xx} = 2y, \: \: f_{xy} = 2x, \: \: f_{yy} = 0. \end{equation*}
Now evaluate these at \((x,y) = (1,2)\)
\begin{equation*} f_x(1,2) = 4, \: \: f_y(1,2) = 1, \: \: f_{xx}(1,2) = 4, \: \: f_{xy}(1,2) = 2, \: \: f_{yy}(1,2) = 0. \end{equation*}
Thus, using \(f(1,2) = 2\text{,}\) we have
\begin{equation*} T_2(x,y) = 2+4(x-1)+(y-2)+2(x-1)^2+2(x-1)(y-2)\text{.} \end{equation*}

Example 5.20.

Using both a linear and a quadratic approximation, estimate the difference in the volume between a box with a square base of side length 1 m and height 2 m and a box with square base of side length 1.1 m and height 2.05 m.
Answer.
Via a linear approximation, \(\Delta V = 0.45\text{.}\)
Via a quadratic approximation, \(\Delta V = 0.48\)
Solution.
If we let the side length of the base of a box be \(x\) and the height be \(y\) then volume \(V\) of the box is given by the formula
\begin{equation*} V(x,y) = x^2y\text{.} \end{equation*}
Thus the difference in the volume between the boxes will be the change in \(V\) when \(x\) changes by 0.1 and \(y\) changes by 0.05. Using the results obtained in the example above, via a linear approximation
\begin{equation*} \Delta V = 4 \Delta x + \Delta y = 4 \times 0.1 + 0.05 = 0.45\text{.} \end{equation*}
Via a quadratic approximation
\begin{align*} \Delta V \amp = 4 \Delta x + \Delta y + 2 \Delta x^2 + 2\Delta x \Delta y \\ \amp = 4 \times 0.1 + 0.05 +2 \times 0.1^2 + 2 \times 0.1 \times 0.05 \\ \amp = 0.48\text{.} \end{align*}

Exercises Example Tasks

1.
Find the Taylor polynomial of degree 2 for \(f(x,y) = e^{x+y^2}\) about \((x,y) = (0,0)\text{.}\)
2.
Find the Taylor polynomial of degree 2 for \(f(x,y)=xy\) about \((x,y)=(2,3)\text{.}\)
3.
If \(x=10 \pm 0.5\text{,}\) \(y=15 \pm 0.05\) use a linear approximation and a quadratic approximation to find the value of the dependent variable z and an associated error bound when
\begin{equation*} z = y\ln(x)\text{.} \end{equation*}