From a Tangent Approximation to a Quadratic One
A linearization uses the function’s value and first derivatives at a base point to estimate nearby values. A second-order Taylor approximation adds curvature information: it records how the first derivatives change near that point. The extra terms can substantially improve an estimate, but their usefulness depends on the function, the chosen point, and how far the input is from it.
This workshop develops both approximations for functions of several variables. The examples compare them with exact values, and the remainder estimates explain how to judge their accuracy rather than relying only on the apparent number of terms.
Taylor Polynomials at a Base Point
Let \(f\) be a real-valued function of \(n\) variables, and let \(\mathbf{a}\) be a point in its domain. For a nearby point \(\mathbf{x}\), write \(\mathbf{h}=\mathbf{x}-\mathbf{a}\). The first-order Taylor polynomial uses the value and gradient of \(f\) at \(\mathbf{a}\). The second-order polynomial also uses the Hessian matrix, whose entries are the second partial derivatives.
Here \(\mathbf{H}_f(\mathbf{a})\) denotes the Hessian matrix evaluated at \(\mathbf{a}\). In two variables, with \(\mathbf{h}=(h_1,h_2)\), the quadratic term is
when the mixed partial derivatives agree, as they do if they are continuous near the base point. The mixed term matters: it describes curvature involving changes in both coordinates. Omitting it generally gives the wrong quadratic approximation.
Worked Example: An Exact Quadratic Approximation
Worked Example: An Exact Quadratic Approximation
Approximate \(f(x,y)=x^2+xy+2y^2\) at \((1.1,-0.8)\), using the base point \((1,-1)\). Compare the linear and quadratic estimates with the exact value.
The displacement is \(\mathbf{h}=(0.1,0.2)\). At the base point,
The first partial derivatives are \(f_x=2x+y\) and \(f_y=x+4y\). Therefore, \(f_x(1,-1)=2-1=1\) and \(f_y(1,-1)=1-4=-3\). Thus
The second partial derivatives are \(f_{xx}=2\), \(f_{xy}=1\), and \(f_{yy}=4\). The quadratic correction is
Hence \(T_2=1.5+0.11=1.61\). Direct substitution gives
The quadratic approximation is exact because \(f\) is already a polynomial of degree two. The linear estimate is \(0.11\) below the exact value.
Why the Quadratic Formula Works
The reason a multivariable Taylor polynomial has this form can be seen by restricting \(f\) to the straight line from \(\mathbf{a}\) to \(\mathbf{x}\). Define \(g(t)=f(\mathbf{a}+t\mathbf{h})\) for \(0\le t\le1\). Then \(g(0)=f(\mathbf{a})\), while \(g(1)=f(\mathbf{x})\). Differentiating along this line gives
The one-variable Taylor formula through degree two, applied to \(g\) between \(0\) and \(1\), therefore produces \(T_2\). In particular, the factor \(\frac12\) is the one-variable Taylor coefficient \(1/2!\), and the Hessian term is the second derivative along the line.
Worked Example: Exponential and Trigonometric Factors
Worked Example: Exponential and Trigonometric Factors
Use first- and second-order Taylor polynomials for \(f(x,y)=e^x\cos y\) at \((0,0)\) to estimate \(f(0.1,0.2)\). Then compare with the function value and bound the second-order remainder.
At the origin, \(f(0,0)=1\). The first partial derivatives are \(f_x=e^x\cos y\) and \(f_y=-e^x\sin y\), so \(f_x(0,0)=1\) and \(f_y(0,0)=0\). The linear estimate is \(T_1=1+0.1=1.1\).
The second partial derivatives are \(f_{xx}=e^x\cos y\), \(f_{xy}=-e^x\sin y\), and \(f_{yy}=-e^x\cos y\). Their values at the origin are \(1,0,-1\), respectively. Consequently,
The exact value is \(e^{0.1}\cos(0.2)\approx1.083140\), rounded to six decimal places. Thus the linear estimate exceeds the value by about \(1.1-1.083140=0.016860\), while the quadratic estimate exceeds it by about \(1.085-1.083140=0.001860\).
For a remainder bound, use the line \(x=0.1t,\ y=0.2t\). Then \(g(t)=e^{0.1t}\cos(0.2t)\), and direct differentiation gives
For \(0\le t\le1\), \(e^{0.1t}\le e^{0.1}<1.106\), and both sine and cosine have absolute value at most \(1\). Therefore \(|g'''(t)|<1.106(0.011+0.002)<0.015\). The one-variable Taylor remainder estimate gives \(|f(0.1,0.2)-T_2|<0.015/6=0.0025\), consistent with the observed error of about \(0.001860\).
Remainder Estimates and Their Conditions
An approximation is more informative when accompanied by an estimate of its error. A useful second-order estimate requires third derivatives along the segment to be bounded. The function must be sufficiently smooth on that entire segment, not only at its starting point.
This follows from the one-variable Taylor theorem with remainder: for some \(c\) between \(0\) and \(1\), \(g(1)=g(0)+g'(0)+g''(0)/2+g'''(c)/6\). Taking absolute values and using \(|g'''(c)|\le M\) yields the stated inequality. For a first-order approximation, if \(|g''(t)|\le K\) on the segment, the same theorem gives \(|f(\mathbf{a}+\mathbf{h})-T_1(\mathbf{a}+\mathbf{h})|\le K/2\).
These are bounds, not predictions of the exact error or its sign. A bound may be conservative, and it does not guarantee that the error decreases by a fixed factor whenever the displacement is shortened. It does provide a justified accuracy check when its hypotheses hold.
Worked Example: A Logarithm and a Remainder Bound
Worked Example: A Logarithm and a Remainder Bound
Approximate \(f(x,y)=\ln(1+x+2y)\) at \((0,0)\), evaluated at \((0.1,0.05)\). Compare the first- and second-order estimates and verify a remainder bound.
The displacement is \(\mathbf{h}=(0.1,0.05)\), and \(f(0,0)=\ln 1=0\). Differentiating gives \(f_x=1/(1+x+2y)\) and \(f_y=2/(1+x+2y)\). Both partial derivatives at the origin are therefore \(1\) and \(2\), so
Writing \(s=1+x+2y\), the second partial derivatives are \(f_{xx}=-1/s^2\), \(f_{xy}=-2/s^2\), and \(f_{yy}=-4/s^2\). At the origin these equal \(-1,-2,-4\). The quadratic correction is
Thus \(T_2=0.2-0.02=0.18\). The exact value is \(\ln(1+0.1+2(0.05))=\ln(1.2)\approx0.182322\), rounded to six decimal places. The linear estimate is low by about \(0.017678\); the quadratic estimate is low by about \(0.002322\).
Along the segment, \(g(t)=\ln(1+0.2t)\). The segment stays in the domain because \(1+0.2t\ge1>0\) for \(0\le t\le1\). Differentiating three times gives \(g'''(t)=2(0.2)^3/(1+0.2t)^3\). Hence \(0<g'''(t)\le0.016\), so the second-order remainder has magnitude at most \(0.016/6\approx0.002667\). The observed error, about \(0.002322\), is below this bound.
How to Choose and Compare Approximations
At a given target point, \(T_1\) and \(T_2\) should be built at the same base point before comparing their estimates. The quadratic polynomial adds curvature information; it is not automatically more accurate at every chosen target. The examples above show useful improvements, but the polynomial example is exact for a specific reason: it has no terms of degree higher than two.
For a smooth function and a sufficiently small displacement, the second-order remainder is typically of smaller order than the quadratic terms as \(\mathbf{h}\) approaches zero. This local statement does not license using the approximation far from the base point. A long segment may leave the region where derivatives are controlled, or even leave the function’s domain. Check the whole segment before applying a remainder estimate.
Compute \(\mathbf{h}=\mathbf{x}-\mathbf{a}\) with the correct coordinate differences.
Use first partial derivatives for \(T_1\), and include every Hessian entry in \(T_2\).
Compare with an exact value if available; otherwise verify the smoothness, domain, and derivative bound required by the remainder estimate.
A Common Mistake: Dropping the Mixed Term
A frequent error is to retain the pure square terms \(h_1^2\) and \(h_2^2\) but omit the mixed-partial contribution. For the quadratic function in the first example, that mistake would give
leading to the incorrect estimate \(1.5+0.09=1.59\). The mixed contribution is \(\frac12(2)(1)(0.1)(0.2)=0.02\), so the correct quadratic correction is \(0.09+0.02=0.11\), and \(T_2=1.61\). Substitution into the original function confirms that \(1.61\), not \(1.59\), is exact. The factor \(2\) inside the displayed two-variable formula is essential; the outer factor \(\frac12\) then leaves one mixed term \(f_{xy}h_1h_2\).
Check Your Understanding
Use the definitions and error reasoning in this workshop to answer the following questions.
- For a function of two variables, which derivatives determine the first-order Taylor polynomial at a base point?
- Why does the quadratic expression contain a mixed term, and what condition allows the two mixed partial derivatives to agree?
- For \(f(x,y)=x^2+y^2\) at \((1,1)\), what displacement corresponds to the target point \((1.1,0.9)\)?
- What derivative bound is needed along the segment to use the stated second-order remainder estimate?
- Why must the domain and derivative conditions be checked along the full segment from the base point to the target?