Why Compare a Linear Estimate With an Exact Value?
A tangent line gives a simple way to estimate how much a function changes near a chosen input. When the function can also be evaluated exactly, we can go further: we can compare the estimate with the true change and measure how accurate the approximation is.
This comparison is useful for understanding what an error number means. A small absolute error may be important when the exact change is tiny, while a larger absolute error may be relatively unimportant when the exact change is large. The two measures answer different questions.
In this tutorial, we estimate changes in function values. The exact change is the value at the new input minus the value at the base input. We will compare that change with the tangent-line estimate and calculate both absolute and relative error.
The Tangent-Line Estimate of a Change
Let \(f\) be differentiable at a base point \(a\), and let \(h\) be a change in the input. The new input is \(a+h\). The tangent line at \(a\) estimates the function value at the new input by \(f(a)+f'(a)h\). Subtracting the original value \(f(a)\) gives an estimate for the change.
The exact change is obtained by directly evaluating the function at both inputs. It is important not to confuse an estimated change with an estimated function value: the estimate for the function value is \(f(a)+L\).
Our signed-error convention compares exact change minus estimated change. Thus, \(R>0\) means the tangent-line estimate is below the exact change, while \(R<0\) means the estimate is above it. The absolute error removes that sign and records the size of the discrepancy.
Relative error compares the absolute discrepancy with the magnitude of the exact change. Its denominator is therefore \(|\Delta f|\), not the estimated change. Relative error is undefined when the exact change is zero, even if the absolute error is defined. In that case, report the absolute error instead.
Why the Tangent Estimate Is the Relevant Comparison
The derivative at \(a\) describes the limiting change in function value per unit change in input near \(a\). In precise terms, differentiability at \(a\) means that, for nonzero \(h\), the difference between the actual change and \(f'(a)h\) becomes small compared with \(|h|\) as \(h\) approaches zero.
This gives a short justification for using \(L=f'(a)h\): the derivative definition says the error in that change estimate is of smaller order than the input change near the base point. It does not say that the estimate is exact for a nonzero \(h\), or that its relative error is necessarily small. We must calculate and assess the discrepancy for the particular change in question.
Worked Example: A Quadratic Function
Worked Example: Estimating a Change in \(f(x)=x^2\)
Estimate the change in \(f(x)=x^2\) as \(x\) moves from \(2\) to \(\frac{5}{2}\). Then find the signed, absolute, and relative errors.
The input change is \(h=\frac{5}{2}-2=\frac{1}{2}\). The derivative is \(f'(x)=2x\), so \(f'(2)=4\). The tangent-line estimate of the change is
To find the exact change, evaluate the function at both inputs:
Therefore, the exact change is
Using the stated convention, the signed error is
Thus, the absolute error is \(\frac{1}{4}\). The relative error is
As a percentage, this is \(\frac{100}{9}\%=11.111111\ldots\%\), or 11.111111% rounded to six decimal places. The positive signed error confirms that the estimate \(2\) is below the exact change \(\frac{9}{4}\). As a check using function values, the estimated new value is \(f(2)+L=4+2=6\), while the exact new value is \(\frac{25}{4}\). Their difference is \(\frac{25}{4}-6=\frac{1}{4}\), agreeing with the absolute error.
Worked Example: A Reciprocal Function
Worked Example: Estimating a Negative Change
Let \(f(x)=\frac{1}{x}\). Estimate the change as \(x\) moves from \(2\) to \(\frac{5}{2}\), and compare it with the exact change.
Here \(a=2\) and \(h=\frac{1}{2}\). The derivative is \(f'(x)=-\frac{1}{x^2}\), so
The estimated change is therefore
The exact function values are \(f(\frac{5}{2})=\frac{2}{5}\) and \(f(2)=\frac{1}{2}\). Hence the exact change is
Now calculate the signed error:
The absolute error is \(\frac{1}{40}\). The relative error is
The percentage error is \(25\%\). Since \(R>0\), the estimate \(-\frac{1}{8}\) is greater than the exact change \(-\frac{1}{10}\): it is less negative. Checking estimated and exact new function values gives the same absolute discrepancy. The estimate is \(f(2)+L=\frac{1}{2}-\frac{1}{8}=\frac{3}{8}\), while the exact value is \(\frac{2}{5}\), and \(\frac{2}{5}-\frac{3}{8}=\frac{16}{40}-\frac{15}{40}=\frac{1}{40}\).
Worked Example: A Decrease in a Cubic Function
Worked Example: Comparing Errors for a Decreasing Input
Let \(f(x)=x^3\), and move from \(a=1\) to \(a+h=\frac{4}{5}\). Find the tangent-line estimate, exact change, absolute error, and percentage error.
The input change is \(h=\frac{4}{5}-1=-\frac{1}{5}\). Since \(f'(x)=3x^2\), the derivative at the base point is \(f'(1)=3\). The estimated change is
The exact values are \(f(\frac{4}{5})=(\frac{4}{5})^3=\frac{64}{125}\) and \(f(1)=1=\frac{125}{125}\). Thus,
The signed error is
The absolute error is \(\frac{14}{125}\). The relative error is
As a percentage, \(\frac{1400}{61}\%=22.950819672\ldots\%\), or 22.9508% rounded to four decimal places. The positive signed error means that the estimate is above the exact change: \(-\frac{3}{5}=-\frac{75}{125}\) is greater than \(-\frac{61}{125}\). The estimated new function value is \(1-\frac{3}{5}=\frac{2}{5}=\frac{50}{125}\); its difference from the exact value is \(\frac{64}{125}-\frac{50}{125}=\frac{14}{125}\), which checks the absolute error.
A Reliable Comparison Process
When a function value can be computed exactly, use the same order each time. Keeping the exact change and the tangent-line estimate separate prevents sign mistakes and makes the error calculation easier to check.
Write \(a\) and \(h\), with the new input expressed as \(a+h\). Preserve the sign of \(h\).
Evaluate \(f'(a)\), then compute \(L=f'(a)h\).
Evaluate \(f(a+h)\) and \(f(a)\), then subtract in the order \(\Delta f=f(a+h)-f(a)\).
Compute \(R=\Delta f-L\) and \(|R|\). If \(\Delta f\ne 0\), divide by \(|\Delta f|\) for relative error and multiply by \(100\%\) for percentage error.
Common Pitfall: Reversing the Error or Its Denominator
A common mistake is to subtract in the wrong order and then interpret the sign as though the signed error were estimate minus exact. For the reciprocal example, the correct calculation is
If instead we calculate \(L-\Delta f\), the result is \(-\frac{1}{40}\). That is a valid difference, but it uses the opposite sign convention. Its magnitude is still the absolute error, \(\frac{1}{40}\); its sign cannot be interpreted using the convention \(R=\Delta f-L\). State the order of subtraction before drawing a conclusion about overestimation or underestimation.
Another error is dividing by the estimate rather than by the exact change. In the quadratic example, the correct relative error is \((1/4)/(9/4)=1/9\), not \((1/4)/2=1/8\). The exact change is the reference quantity in the definition used here.
Also distinguish relative error in a change from relative error in a function value. The three examples measure error relative to \(|\Delta f|\). If the target were instead the value \(f(a+h)\), its relative error would use \(|f(a+h)|\) as the denominator, provided that value is nonzero. Those denominators need not be the same.
What the Error Measures Tell You
Absolute error is expressed in the same units as the function output. If \(f\) measures a length, the absolute error in a change is also a length. Relative error has no units because it is a ratio of two quantities with the same units. Percentage error is that ratio expressed as a percentage.
Neither measure alone gives a complete description in every situation. Absolute error tells you the size of the discrepancy on the function's scale. Relative error tells you how large that discrepancy is compared with the exact change. If the exact change is very close to zero, relative error may be large even when absolute error is small; if the exact change is zero, relative error is not defined. Reporting the quantities being compared helps make the result meaningful.
When the function can be evaluated exactly, the comparison also lets you check direction. With \(R=\Delta f-L\), a positive \(R\) means \(L<\Delta f\), and a negative \(R\) means \(L>\Delta f\). This statement concerns the signed changes. It should not be confused with comparing the magnitudes of those changes, particularly when the change is negative.
Check Your Understanding
For each question, use the convention that signed error is exact change minus estimated change.
- For \(f(x)=x^2\), estimate the change from \(x=3\) to \(x=3+\frac{1}{10}\). What are the exact change and the signed error?
- For \(f(x)=\frac{1}{x}\), use the tangent at \(a=1\) to estimate the change for \(h=\frac{1}{4}\). Find the exact change and absolute error.
- If the signed error is negative, is the linear estimate above or below the exact change?
- Why is relative error undefined when the exact change is zero?
- In the quadratic worked example, what denominator is used for relative error in the change, and why is the estimated change not that denominator?