Taylor Polynomials of Functions of Two Variables
- Last updated
- Dec 21, 2020
- Save as PDF
- Page ID
- 10916
( \newcommand{\kernel}{\mathrm{null}\,}\)
Earlier this semester, we saw how to approximate a function f(x,y) by a linear function, that is, by its tangent plane. The tangent plane equation just happens to be the 1st-degree Taylor Polynomial of f at (x,y), as the tangent line equation was the 1st-degree Taylor Polynomial of a function f(x).
Now we will see how to improve this approximation of f(x,y) using a quadratic function: the 2nd-degree Taylor polynomial for f at (x,y).
Review of Taylor Polynomials for a Function of One Variable
Do you remember Taylor Polynomials from Calculus II?
Definition: Taylor polynomials for a function of one variable, y=f(x)
If f has n derivatives at x=c, then the polynomial,
Pn(x)=f(c)+f′(c)(x−c)+f″(c)2!(x−c)2+⋯+f(n)(c)n!(x−c)n
is called the nth-degree Taylor Polynomial for f at c.
Now a function of one variable f(x) can be approximated for x near c using its 1st-degree Taylor Polynomial (i.e., using the equation of its tangent line at the point (c,f(c)). This 1st-degree Taylor Polynomial is also called the linear approximation of f(x) for x near c.
That is:
f(x)≈f(c)+f′(c)(x−c)
Note
Remember that the first-derivative of this 1st-degree Taylor polynomial at x=c is equal to the first derivative of f at x=c. That is:
Since P1(x)=f(c)+f′(c)(x−c),
P′1(c)=f′(c)
A better approximation of f(x) for x near c is the quadratic approximation (i.e., the 2nd-degree Taylor polynomial of f at x=c):
f(x)≈f(c)+f′(c)(x−c)+f″(c)2(x−c)2
Note
Remember that both the first and second derivatives of the 2nd-degree Taylor polynomial of f at x=c are the same as those for f at x=c. That is:
Since P2(x)=f(c)+f′(c)(x−c)+f″(c)2(x−c)2,
P′2(c)=f′(c)andP″2(c)=f″(c)
1st and 2nd-Degree Taylor Polynomials for Functions of Two Variables
Taylor Polynomials work the same way for functions of two variables. (There are just more of each derivative!)
Definition: first-degree Taylor polynomial of a function of two variables, f(x,y)
For a function of two variables f(x,y) whose first partials exist at the point (a,b), the 1st-degree Taylor polynomial of f for (x,y) near the point (a,b) is:
f(x,y)≈L(x,y)=f(a,b)+fx(a,b)(x−a)+fy(a,b)(y−b)
L(x,y) is also called the linear (or tangent plane) approximation of f for (x,y) near the point (a,b).
Note that this is really just the equation of the function f's tangent plane.
Also note that the first partial derivatives of this polynomial function are fx and fy!
We can obtain an even better approximation of f for (x,y) near the point (a,b) by using the quadratic approximation of f for (x,y) near the point (a,b). This is just another name for the 2nd-degree Taylor polynomial of f.
Definition: Second-degree Taylor Polynomial of a function of two variables, f(x,y)
For a function of two variables f(x,y) whose first and second partials exist at the point (a,b), the 2nd-degree Taylor polynomial of f for (x,y) near the point (a,b) is:
f(x,y)≈Q(x,y)=f(a,b)+fx(a,b)(x−a)+fy(a,b)(y−b)+fxx(a,b)2(x−a)2+fxy(a,b)(x−a)(y−b)+fyy(a,b)2(y−b)2
If we have already determined L(x,y), we can simplify this formula as:
f(x,y)≈Q(x,y)=L(x,y)+fxx(a,b)2(x−a)2+fxy(a,b)(x−a)(y−b)+fyy(a,b)2(y−b)2
Note: Since both mixed partials are equal, they combine to form the middle term. Originally there were four terms for the second partials, all divided by 2.
Observe that the power on the factor (x−a) corresponds to the number of times the partial is taken with respect to x and the power on the factor y−b corresponds to the number of times the partial is take with respect to y. For example, in the term with fxx(a,b), you have the factor (x−a)2, since the partial is taken with respect to x twice, and in the term with fxy(a,b), you have the factors (x−a) and (y−b) (both raised to the first power), since the partial is taken with respect to x once and with respect to y once.
Also note that both the first and second partial derivatives of this polynomial function are the same as those for the function f !
Example 1: Finding 1st and 2nd degree Taylor Polynomials
Determine the 1st- and 2nd-degree Taylor polynomial approximations, L(x,y) & Q(x,y), for the following functions of x and y near the given point.
a. f(x,y)=sin2x+cosy for (x,y) near the point (0,0)
b. f(x,y)=xey+1 for (x,y) near the point (1,0)
Solution
a. To determine the first-degree Taylor polynomial linear approximation, L(x,y), we first compute the partial derivatives of f.
fx(x,y)=2cos2xandfy(x,y)=−siny
Then evaluating these partials and the function itself at the point (0,0) we have:
f(0,0)=sin2(0)+cos0=1fx(0,0)=2cos2(0)=2fy(0,0)=−sin0=0
Now,
L(x,y)=f(0,0)+fx(0,0)(x−0)+fy(0,0)(y−0)=1+2x
See the plot of this function and its linear approximation (the 1st-degree Taylor polynomial) in Figure 1.
Figure 1: Graph of f(x,y)=sin2x+cosy and its 1st-degree Taylor polynomial, L(x,y)=1+2x
To determine the second-degree Taylor polynomial (quadratic) approximation, Q(x,y), we need the second partials of f:
fxx(x,y)=−4sin2xfxy(x,y)=0fyy(x,y)=−cosy
Evaluating these 2nd partials at the point (0,0):
fxx(0,0)=−4sin2(0)=0fxy(0,0)=0fyy(0,0)=−cos0=−1
Then,
Q(x,y)=L(x,y)+fxx(0,0)2(x−0)2+fxy(0,0)(x−0)(y−0)+fyy(0,0)2(y−0)2=1+2x+02x2+(0)xy+−12y2=1+2x−y22
See the plot of the function f along with its quadratic approximation (the 2nd-degree Taylor polynomial) in Figure 2.
Figure 2: Graph of f(x,y)=sin2x+cosy and its 2nd-degree Taylor polynomial, Q(x,y)=1+2x−y22
b. To determine the first-degree Taylor polynomial linear approximation, L(x,y), we first compute the partial derivatives of f(x,y)=xey+1 .
fx(x,y)=eyandfy(x,y)=xey
Then evaluating these partials and the function itself at the point (1,0) we have:
f(1,0)=(1)e0+1=2fx(1,0)=e0=1fy(1,0)=(1)e0=1
Now,
L(x,y)=f(1,0)+fx(1,0)(x−1)+fy(1,0)(y−0)=2+1(x−1)+1y=1+x+y
See the plot of this function and its linear approximation (the 1st-degree Taylor polynomial) in Figure 3.
Figure 3: Graph of f(x,y)=xey+1 and its 1st-degree Taylor polynomial, L(x,y)=1+x+y
To determine the second-degree Taylor polynomial (quadratic) approximation, Q(x,y), we need the second partials of f:
fxx(x,y)=0fxy(x,y)=eyfyy(x,y)=xey
Evaluating these 2nd partials at the point (1,0):
fxx(1,0)=0fxy(1,0)=e0=1fyy(1,0)=(1)e0=1
Then,
Q(x,y)=L(x,y)+fxx(1,0)2(x−1)2+fxy(1,0)(x−1)(y−0)+fyy(1,0)2(y−0)2=1+x+y+02(x−1)2+(1)(x−1)y+12y2=1+x+y+xy−y+y22=1+x+xy+y22
See the plot of the function f along with its quadratic approximation (the 2nd-degree Taylor polynomial) in Figure 4.
Figure 4: Graph of f(x,y)=xey+1 and its 2nd-degree Taylor polynomial, Q(x,y)=1+x+xy+y22
Higher-Degree Taylor Polynomials of a Function of Two Variables
To calculate the Taylor polynomial of degree n for functions of two variables beyond the second degree, we need to work out the pattern that allows all the partials of the polynomial to be equal to the partials of the function being approximated at the point (a,b), up to the given degree. That is, for P3(x,y) we will need its first, second and third partials to all match those of f(x,y) at the point (a,b). For P10(x,y) we would need all its partials up to the tenth partials to all match those of f(x,y) at the point (a,b).
If you work out this pattern, it gives us the following interesting formula for the nth-degree Taylor polynomial of f(x,y), assuming all these partials exist.
Definition: nth-degree Taylor Polynomial for a function of two variables
For a function of two variables f(x,y) whose partials all exist to the nth partials at the point (a,b), the nth-degree Taylor polynomial of f for (x,y) near the point (a,b) is:
Pn(x,y)=n∑i=0n−i∑j=0d(i+j)f∂xi∂yj(a,b)i!j!(x−a)i(y−b)j
Let's verify this formula for the second-degree Taylor polynomial. (We'll leave it to you to verify it for the first-degree Taylor polynomial.)
For n=2, we have:
P2(x,y)=2∑i=02−i∑j=0d(i+j)f∂xi∂yj(a,b)i!j!(x−a)i(y−b)j
Since i will start at 0 and continue to increase up to 2, while the value of j will start at 0 and increase to 2−i for each value of i, we would see the following values for i and j:
i=0,j=0i=0,j=1i=0,j=2i=1,j=0i=1,j=1i=2,j=0
Then by the formula:
P2(x,y)=f(a,b)0!0!(x−a)0(y−b)0+fy(a,b)0!1!(x−a)0(y−b)1+fyy(a,b)0!2!(x−a)0(y−b)2+fx(a,b)1!0!(x−a)1(y−b)0+fxy(a,b)1!1!(x−a)1(y−b)1+fxx(a,b)2!0!(x−a)2(y−b)0=f(a,b)+fy(a,b)(y−b)+fyy(a,b)2(y−b)2+fx(a,b)(x−a)+fxy(a,b)(x−a)(y−b)+fxx(a,b)2(x−a)2=f(a,b)+fx(a,b)(x−a)+fy(a,b)(y−b)+fxx(a,b)2(x−a)2+fxy(a,b)(x−a)(y−b)+fyy(a,b)2(y−b)2
This equation is the same as Equation ??? above.
Note that P2(x,y) is the more formal notation for the second-degree Taylor polynomial Q(x,y).
Exercise 1: Finding a third-degree Taylor polynomial for a function of two variables
Now try to find the new terms you would need to find P3(x,y) and use this new formula to calculate the third-degree Taylor polynomial for one of the functions in Example 1 above. Verify your result using a 3D function grapher like CalcPlot3D.
- Answer
-
As you just found, the only new combinations of i and j would be:
i=0,j=3i=1,j=2i=2,j=1i=3,j=0
Note that these pairs include all the possible combinations of i and j that can add to 3. That is, these pairs correspond to all the possible third-degree terms we could have for a function of two variables x and y, remembering that i represents the degree of x and j represents the degree of y in each term. If the point (a,b) were (0,0), the variable factors of these terms would be y3, xy2, x2y, and x3, respectively.
Then by the Equation ???:
P3(x,y)=P2(x,y)+fyyy(a,b)0!3!(x−a)0(y−b)3+fxyy(a,b)1!2!(x−a)1(y−b)2+fxxy(a,b)2!1!(x−a)2(y−b)1+fxxx(a,b)3!0!(x−a)3(y−b)0
Simplifying, P3(x,y)=P2(x,y)+fyyy(a,b)6(y−b)3+fxyy(a,b)2(x−a)(y−b)2+fxxy(a,b)2(x−a)2(y−b)+fxxx(a,b)6(x−a)3
Contributors
- Paul Seeburger (Monroe Community College)
Exercises:
13.7: Taylor Polynomials of Functions of Two Variables
In the exercises 1 - 8, find the linear approximation L(x,y) and the quadratic approximation Q(x,y) of each function at the indicated point. These are the 1st- and 2nd-degree Taylor Polynomials of these functions at these points. Use a 3D grapher like CalcPlot3D to verify that each linear approximation is tangent to the given surface at the given point and that each quadratic approximation is not only tangent to the surface at the given point, but also shares the same concavity as the surface at this point.
1) f(x,y)=x√y,P(1,4)
- Answer:
- L(x,y)=2x+14y−1
Q(x,y)=−1+2x+14y+14(x−1)(y−4)−164(y−4)2
2) f(x,y)=excosy;P(0,0)
3) f(x,y)=arctan(x+2y),P(1,0)
- Answer:
- L(x,y)=14π−12+12x+y
Q(x,y)=14π−34+x+2y−x24−xy−y2
4) f(x,y)=√20−x2−7y2,P(2,1)
5) f(x,y)=x2y+y2,P(1,3)
- Answer:
- L(x,y)=12+6(x−1)+7(y−3)=−15+6x+7y
Q(x,y)=−15+6x+7y+3(x−1)2+2(x−1)(y−3)+(y−3)2
6) f(x,y)=cosxcos3y,P(0,0)
7) f(x,y)=ln(x2+y2+1),P(0,0)
- Answer:
- L(x,y)=0
Q(x,y)=x2+y2
8) f(x,y)=√2x−y,P(1,−2)
9) Verify that the formula for higher-degree Taylor polynomials works for the first-degree Taylor polynomial L(x,y)=P1(x,y). For convenience, the formula is given below.
Pn(x,y)=n∑i=0n−i∑j=0d(i+j)f∂xi∂yj(a,b)i!j!(x−a)i(y−b)j
10) Determine the new terms that would be added to P3(x,y) (which you found in Exercise 13.7.1) to form P4(x,y) and determine the fourth-degree Taylor polynomial for one of the functions we've considered and graph it together with the surface plot of the corresponding function in a 3D grapher like CalcPlot3D to verify that it continues to fit the surface better.
Contributors
- Paul Seeburger (Monroe Community College)
- Exercises 1-4 were adapted from problems provided in the section on Tangent Planes & Differentials from the OpenStax Calculus 3 textbook.