1.8 Taylor’s Formula For Functions of Several Variables
For a function of one variable with \(n+1\) continuous derivatives, Taylor’s theorem gives \[f(a+h) = f(a) + f'(a)\,h + \frac {f''(a)}{2!}h^2 + \cdots + \frac {f^{(n)}(a)}{n!}h^n + R_n,\qquad R_n = \frac {f^{(n+1)}(a+\theta h)}{(n+1)!}h^{n+1}\] for some \(\theta \) between \(0\) and \(1\). The two-variable version is obtained by applying this along a line, and it is most compactly written with the operator \[h\frac {\partial }{\partial x} + k\frac {\partial }{\partial y},\qquad \text {so that} \qquad \left (h\frac {\partial }{\partial x} + k\frac {\partial }{\partial y}\right )f = hf_x + kf_y ,\] and its powers are expanded by the binomial theorem, for example \[\left (h\frac {\partial }{\partial x} + k\frac {\partial }{\partial y}\right )^2f = h^2f_{xx} + 2hkf_{xy} + k^2f_{yy} .\]
Theorem 1.8.1 (Taylor’s formula). Suppose \(f(x,y)\) and its partial derivatives up to order \(n+1\) are continuous on an open set containing the segment from \((a,b)\) to \((a+h,b+k)\). Then \[f(a+h,b+k) = \sum _{m=0}^{n}\frac {1}{m!}\left (h\frac {\partial }{\partial x} + k\frac {\partial }{\partial y}\right )^m f(a,b) + R_n ,\] where \(R_n = \frac {1}{(n+1)!}\left (h\frac {\partial }{\partial x} + k\frac {\partial }{\partial y}\right )^{n+1}f(a+\theta h,b+\theta k)\) for some \(\theta \) with \(0<\theta <1\).
Proof. Let \(g(t) = f(a+th,b+tk)\) for \(0\leq t\leq 1\). By the chain rule, \(g'(t) = hf_x + kf_y\) evaluated at \((a+th,b+tk)\), and applying it again to each term, \(g^{(m)}(t) = \left (h\frac {\partial }{\partial x} + k\frac {\partial }{\partial y}\right )^m f(a+th,b+tk)\); the mixed derivatives can be collected because \(f_{xy} = f_{yx}\) for functions with continuous second derivatives. The one-variable formula for \(g\) with \(a = 0\) and step \(1\), \[g(1) = g(0) + g'(0) + \frac {g''(0)}{2!} + \cdots + \frac {g^{(n)}(0)}{n!} + \frac {g^{(n+1)}(\theta )}{(n+1)!},\] is exactly the statement, since \(g(1) = f(a+h,b+k)\). □
With \(n = 0\) the theorem reads \(f(a+h,b+k) = f(a,b) + hf_x(a+\theta h, b+\theta k) + kf_y(a+\theta h,b+\theta k)\), the mean value theorem for functions of two variables. Taking \(a = b = 0\), \(h = x\) and \(k = y\) gives the expansion in powers of \(x\) and \(y\) (the Maclaurin expansion): \begin {align*} f(x,y) = {} & f(0,0) + \big (xf_x + yf_y\big ) + \frac {1}{2!}\big (x^2f_{xx} + 2xyf_{xy} + y^2f_{yy}\big )\\ & + \frac {1}{3!}\big (x^3f_{xxx} + 3x^2y f_{xxy} + 3xy^2f_{xyy} + y^3f_{yyy}\big ) +\cdots , \end {align*}
with every derivative evaluated at \((0,0)\).
Example 1.8.2. Expand \(f(x,y) = e^x \sin y\) about \((0,0)\) in powers of \(x\) and \(y\) up to terms of the third degree.
Solution. Each derivative is \(e^x\) times a derivative of \(\sin y\), so \begin {align*} & f = e^x\sin y \to 0, && f_x = e^x\sin y \to 0, && f_y = e^x\cos y \to 1,\\ & f_{xx} = e^x\sin y \to 0, && f_{xy} = e^x\cos y \to 1, && f_{yy} = -e^x\sin y \to 0,\\ & f_{xxx} = e^x\sin y \to 0, && f_{xxy} = e^x\cos y \to 1, && f_{xyy} = -e^x\sin y \to 0,\\ & f_{yyy} = -e^x\cos y \to -1, \end {align*}
the arrows giving the values at \((0,0)\). By Theorem 1.8.1, \[e^x\sin y = y + \frac {1}{2!}(2xy) + \frac {1}{3!}(3x^2y - y^3) + \cdots = y + xy + \frac {x^2y}{2} - \frac {y^3}{6} + \cdots .\] As a check, multiplying the series \(e^x = 1 + x + \frac {x^2}{2}+\cdots \) and \(\sin y = y - \frac {y^3}{6}+\cdots \) and keeping terms of degree at most three gives the same result.
Solution. The point is \((a,b) = (1,-2)\), where \(f(1,-2) = -2 - 6 - 2 = -10\). The derivatives and their values there are \begin {align*} & f_x = 2xy \to -4, && f_y = x^2 + 3 \to 4,\\ & f_{xx} = 2y \to -4, && f_{xy} = 2x \to 2, && f_{yy} = 0,\\ & f_{xxy} = 2, && f_{xxx} = f_{xyy} = f_{yyy} = 0 , \end {align*}
and all higher derivatives vanish, so the expansion terminates. With \(h = x - 1\) and \(k = y + 2\), \begin {align*} f(x,y) & = -10 - 4h + 4k + \frac {1}{2!}\left (-4h^2 + 2\cdot 2hk\right ) + \frac {1}{3!}\left (3h^2k\cdot 2\right )\\ & = -10 - 4(x-1) + 4(y+2) - 2(x-1)^2 + 2(x-1)(y+2) + (x-1)^2(y+2) . \end {align*}
This is exact, since \(f\) is a polynomial of degree three; substituting \(x = 1 + h\), \(y = -2 + k\) directly gives the same result.
Exercise 1.8.4. Find the expansion of \(\cos x \cos y\) in powers of \(x\) and \(y\) up to terms of the fourth order.
Answer: \(\cos x\cos y = 1 - \frac {x^2}{2}-\frac {y^2}{2} + \frac {x^4}{24} + \frac {x^2y^2}{4} + \frac {y^4}{24}+\cdots \), most easily found by multiplying the two one-variable series.
Example 1.8.5. Use the second-degree Taylor polynomial of \(f(x,y) = \sqrt {x^2 + y^3}\) about \((1,2)\) to estimate \(f(1.02, 1.97)\).
Solution. At \((1,2)\), \(s = x^2 + y^3 = 9\) and \(f = 3\). With \(f = s^{1/2}\), \[f_x = \frac {x}{\sqrt s} = \frac 13,\qquad f_y = \frac {3y^2}{2\sqrt s} = 2,\] \[f_{xx} = \frac {1}{\sqrt s} - \frac {x^2}{s^{3/2}} = \frac 13 - \frac 1{27} = \frac {8}{27},\qquad f_{xy} = -\frac {3xy^2}{2s^{3/2}} = -\frac {2}{9},\qquad f_{yy} = \frac {3y}{\sqrt s} - \frac {9y^4}{4s^{3/2}} = 2 - \frac 43 = \frac 23 .\] With \(h = 0.02\) and \(k = -0.03\), \[f\approx 3 + \frac {0.02}{3} - 0.06 + \frac 12\left (\frac {8}{27}(0.0004) - \frac {4}{9}(-0.0006) + \frac 23(0.0009)\right )\approx 2.94716 .\] The exact value is \(\sqrt {1.0404 + 7.645373} = 2.94716\) to five decimal places. The linear approximation alone gives \(2.94667\); the quadratic terms recover almost all of the difference.
Example 1.8.6. Use a second-degree expansion to classify the critical point at the origin of \(f(x,y) = e^{xy} - \cos (x+y)\).
Solution. From the one-variable series, \(e^{xy} = 1 + xy + \cdots \) and \(\cos (x+y) = 1 - \frac {(x+y)^2}{2} + \cdots \), where the omitted terms have degree at least \(4\) in the first case and at least \(4\) in the second. So \[f(x,y) = xy + \frac {(x+y)^2}{2} + \cdots = \frac {x^2}{2} + 2xy + \frac {y^2}{2} + \cdots .\] There are no linear terms, so the origin is a critical point, and comparing with Theorem 1.8.1, \(f_{xx} = 1\), \(f_{xy} = 2\), \(f_{yy} = 1\) there. Then \(D = 1 - 4 = -3<0\), and the origin is a saddle point. Along \(y = x\) the quadratic part is \(3x^2>0\), and along \(y = -x\) it is \(-x^2<0\).
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.