We introduce Taylor polynomials for functions of several variables.

Recall the definition of a Taylor polynomial:

Let \(f(x) = \sin (x)\). Compute the degree \(7\) Taylor polynomial centered at \(x=0\).
\[ p_7(x)\begin{prompt} = \answer {x-x^3/3!+x^5/5!-x^7/7!} \end{prompt} \]
Let \(f(x) = \cos (x)\). Compute the degree \(7\) Taylor polynomial centered at \(x=0\).
\[ p_7(x)\begin{prompt} = \answer {1-x^2/2+x^4/4!-x^6/6!} \end{prompt} \]
Let \(f(x) = e^x\). Compute the degree \(7\) Taylor polynomial centered at \(x=0\).
\[ p_7(x)\begin{prompt} = \answer {1 + x + x^2/2+ x^3/3! + x^4/4!+ x^5/5! + x^6/6!+x^7/7!} \end{prompt} \]

We have a similar formula for functions \(F:\R ^n\to \R \).

As you can see, it is more complex than the formula for a single variable. Good news everyone: In this class, we will only compute the degree two polynomial for functions of two variables. In this case \(P_2\) is:

\begin{align*} P_2(\vec {x})=F(\vec {c}) &+ \grad F(\vec {c})\dotp (\vec {x}-\vec {c})\\ &+\left (\frac {1}{2}\right )F^{(2,0)}(\vec {c}) (x-c_1)^2 \\ &+ F^{(1,1)}(\vec {c})(x-c_1)(y-c_2) \\ &+ \left (\frac {1}{2}\right )F^{(0,2)}(\vec {c})(y-c_2)^2. \end{align*}

Basically, given a function \(F:\R ^2\to \R \), the second degree Taylor polynomial \(P_2\) at a point \(\vec {c}\) is a polynomial “cooked-up” so that:

  • The values are equal: \(P_2(\vec {c}) = F(\vec {c})\).
  • The first partial derivatives are equal: \(P_2^{(1,0)}(\vec {c}) = F^{(1,0)}(\vec {c})\) and \(P_2^{(0,1)}(\vec {c}) = F^{(0,1)}(\vec {c})\).
  • The second partial derivatives are equal: \(P_2^{(2,0)}(\vec {c}) = F^{(2,0)}(\vec {c})\), \(P_2^{(0,2)}(\vec {c}) = F^{(0,2)}(\vec {c})\), and \(P_2^{(1,1)}(\vec {c}) = F^{(1,1)}(\vec {c})\).

Here’s the plan. Soon we will be trying to find maximums and minimums for functions of two variables. The second degree Taylor polynomial will be the key to developing a “second derivative test” for identifying these extrema.

1 Try it, you might like it

Computing the Taylor polynomial is not so bad, you just need to get the hang of it.

Compute the degree \(2\) Taylor polynomial for:
\[ F(x,y)=\cos (xy) \]
centered at \((0,0)\).
Start by making a table of partial derivatives along with their value when evaluated at \((0,0)\).
\[ P_2(x,y) = \answer {1} \]
Compute the degree \(2\) Taylor polynomial for:
\[ F(x,y)= x^2 y + y^2 + x y \]
centered at \((-1/2,1/8)\).
Start by making a table of partial derivatives along with their value when evaluated at \((-1/2,1/8)\).
\[ P_2(x,y) = \answer {-1/64 + (1/8)(x+1/2)^2+(y-1/8)^2} \]
Compute the degree \(2\) Taylor polynomial for:
\[ F(x,y)= x^3-3x-y^2+4y \]
centered at \((1,2)\).
Start by making a table of partial derivatives along with their value when evaluated at \((1,2)\).
\[ P_2(x,y) = \answer {2 + 3(x-1)^2 -(y-2)^2} \]

2 In other words

Now that we have a formula and we (hopefully!) can apply it. Let’s finish by talking about what is really going on. Given a function \(f:\R \to \R \), the Taylor polynomial

\[ p_d(x) = \sum _{k=0}^d\frac {f^{(k)}(c)}{k!}(x-c)^k. \]

is a polynomial “cooked-up” to share the value of the function, meaning

\[ p_d(c)=f(c), \]

and share values of the first \(d\) derivatives, meaning

\[ p_d^{(i)}(c) = f^{(i)}(c) \]

whenever \(0\le i\le d\). The exact same idea is true for functions of several variables. Let’s explain the construction of the Taylor polynomial as an iterative process. Given \(F:\R ^2\to \R \) (and similarly for functions \(F:\R ^n\to \R \)) the degree zero Taylor polynomial is just the value of the function

\[ P_0(x,y) = F(c_1,c_2) \]

where \(\vec {c}=\vector {c_1,c_2}\) is the center of the Taylor polynomial. The degree one Taylor polynomial is just the degree zero polynomial plus the first partial derivatives with respect to \(x_i\) multiplied by \((x_i-c_i)\)

\[ P_1(x,y) = P_0(x,y) + F^{(1,0)}(\vec {c})(x-c_1) + F^{(0,1)}(\vec {c})(y-c_2). \]

The degree two Taylor polynomial can be found by adding the degree one Taylor polynomial to one-half of all the second partial derivatives with respect to \(x\) and \(y\) multiplied by

  • \((x-c_1)^2\) when taking the partial derivative with respect to \(x\),
  • \((y-c_2)^2\) when taking the partial derivative with respect to \(y\), and
  • \(2(x-c_1)(y-c_2)\) when taking the partial derivative with respect to \(x\) and \(y\).

Putting this together, we see

\begin{align*} P_2(x,y) &= P_1(x,y) \\ &+\left (\frac {1}{2}\right )F^{(2,0)}(\vec {c})(x-c_1)^2 \\ &+F^{(1,1)}(\vec {c})(x-c_1)(y-c_2)\\ &+\left (\frac {1}{2}\right )F^{(0,2)}(\vec {c})(y-c_2)^2. \end{align*}

The interested reader can (repeatedly) differentiate \(P_2(x,y)\) to see that its value at \(\vec {x}=\vec {c}\) and the values of the first two derivatives of \(P_2(x,y)\) do indeed match those of \(F(x,y)\).

3 Unpacking the general formula

This final section is for the interested student, and is not required for this course.

Recall that if \(F:\R ^n\to \R \) is a function whose first \(d\) derivatives exist at \(\vec {x}=\vec {c}\). The Taylor polynomial of degree \(d\) of \(F\) centered at \(\vec {x}=\vec {c}\) is

\[ P_d(\vec {x}) = \sum _{k=0}^d \eval {\eval {\frac {(\vec {a}\dotp \grad )^k F(\vec {x})}{k!}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}} \]

This formula is complex and will take some unpacking. We’ll walk you through this.

3.1 The degree zero Taylor polynomial

First note that

\begin{align*} P_0(\vec {x}) &= \sum _{k=0}^0 \eval {\eval {\frac {(\vec {a}\dotp \grad )^k F(\vec {x})}{k!}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}\\ &=\eval {\eval {\frac {(\vec {a}\dotp \grad )^0 F(\vec {x})}{0!}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}\\ &=\eval {\eval {F(\vec {x})}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}\\ &=F(\vec {c}). \end{align*}

This means for any function \(F:\R ^n\to \R \), the \(0\)th degree Taylor polynomial for \(F\) at \(\vec {x}=\vec {c}\) is just

\[ P_0(\vec {x})=F(\vec {c}). \]

3.2 The degree one Taylor polynomial

Now let’s look at the \(1\)st degree Taylor polynomial:

\begin{align*} P_1(\vec {x})&= \sum _{k=0}^1 \eval {\eval {\frac {(\vec {a}\dotp \grad )^k F(\vec {x})}{k!}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}\\ &=P_0(\vec {x}) + \eval {\eval {\frac {(\vec {a}\dotp \grad )^1 F(\vec {x})}{1!}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}\\ &=F(\vec {c}) + \eval {\eval {(\vec {a}\dotp \grad ) F(\vec {x})}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}} \end{align*}

Now we ask, what is \((\vec {a}\dotp \grad )F\)? Well, computing the dot product,

\[ (\vec {a}\dotp \grad ) = a_1 \pp {x} + a_2 \pp {y} \]

and to find \((\vec {a}\dotp \grad )F\), we distribute \(F\) to obtain

\begin{align*} (\vec {a}\dotp \grad )F &= a_1 \pp [F]{x} + a_2 \pp [F]{y}\\ &= \grad F(\vec {x})\dotp \vec {a} \end{align*}

So

\begin{align*} P_1(\vec {x})&=F(\vec {c}) + \eval {\eval {\grad F(\vec {x})\dotp \vec {a}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}\\ &=F(\vec {c}) +\grad F(\vec {c})\dotp (\vec {x}-\vec {c}). \end{align*}

This means for any function \(F:\R ^n\to \R \), the \(1\)st degree Taylor polynomial for \(F\) at \(\vec {x}=\vec {c}\) is just the tangent “plane” for \(F\) at \(\vec {x}= \vec {c}\).

3.3 The degree two Taylor polynomial

To get our hands on the \(2\)nd degree Taylor polynomial, we will specialize to functions \(F:\R ^2\to \R \). Let \(\vec {c}=\vector {c_1,c_2}\) and let \(\vec {x} = \vector {x,y}\). Write with me:

\[ P_2(\vec {x}) = P_1(\vec {x}) + \eval {\eval {\frac {(\vec {a}\dotp \grad )^2 F(\vec {x})}{2!}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}} \]
\begin{align*} = F(\vec {c}) &+ \grad F(\vec {c})\dotp (\vec {x}-\vec {c})\\ &+(1/2)\eval {\eval {(\vec {a}\dotp \grad )^2 F(\vec {x})}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}} \end{align*}

Now we ask ourselves, what is \((\vec {a}\dotp \grad )^2 F(\vec {x})\)? Well, we know that

\[ (\vec {a}\dotp \grad )F = a_1 \pp [F]{x} + a_2 \pp [F]{y} \]

and

\begin{align*} (\vec {a}\dotp \grad )^2F &=(\vec {a}\dotp \grad )(\vec {a}\dotp \grad )F\\ &= (\vec {a}\dotp \grad )\left (a_1 \pp [F]{x} + a_2 \pp [F]{y}\right )\\ &= \left (a_1 \pp [F]{x} + a_2 \pp [F]{y}\right )\left (a_1 \pp [F]{x} + a_2 \pp [F]{y}\right ) \end{align*}

Now we use the distributively property and (since we are assuming that all derivatives of \(F\) exist) we have that

\[ \frac {\partial ^2F}{\partial x\partial y} = \frac {\partial ^2F}{\partial y\partial x} \]

so

\[ (\vec {a}\dotp \grad )^2F = a_1^2\frac {\partial ^2F}{\partial x^2} + 2a_1 a_2\frac {\partial ^2F}{\partial x\partial y} + a_2^2\frac {\partial ^2F}{\partial y^2}. \]

We can now unpack our second degree Taylor polynomial:

\begin{align*} P_2(\vec {x})= F(\vec {c}) &+ \grad F(\vec {c})\dotp (\vec {x}-\vec {c})\\ &+(1/2)\eval {\eval {(\vec {a}\dotp \grad )^2F}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}, \end{align*}

as

\begin{align*} P_2(\vec {x})=F(\vec {c}) &+ \grad F(\vec {c})\dotp (\vec {x}-\vec {c})\\ &+(1/2)\eval {\eval {a_1^2\frac {\partial ^2F}{\partial x^2} + 2a_1 a_2\frac {\partial ^2F}{\partial x\partial y} + a_2^2\frac {\partial ^2F}{\partial y^2}}_{\vec {x}=\vec {c}}}_{\vec {a}=\vec {x}-\vec {c}}. \end{align*}

and finally we see:

\begin{align*} P_2(\vec {x})=F(\vec {c}) &+ \grad F(\vec {c})\dotp (\vec {x}-\vec {c})\\ &+\left (\frac {1}{2}\right )F^{(2,0)}(\vec {c}) (x-c_1)^2 \\ &+ F^{(1,1)}(\vec {c})(x-c_1)(y-c_2) \\ &+ \left (\frac {1}{2}\right )F^{(0,2)}(\vec {c})(y-c_2)^2. \end{align*}

Whew. That was a lot of work. However, as we have said before, all you need to know right now, is how to compute the degree two Taylor polynomial for functions of two variables.