Tutorials › Calculus II › Bounding Errors For Logarithms Near One

Remainders and Error Estimates · Tutorial 856 of 998

Bounding Errors For Logarithms Near One

Learn to calculate valid Lagrange error bounds for ln(1+x), including how the distance to its singularity changes the bound.

Advanced 9 min read

What You'll Learn

  • Write the degree-n Taylor polynomial for ln(1+x) about zero.
  • Find the largest relevant derivative on the interval between zero and the input.
  • Apply the Lagrange remainder bound on positive and negative intervals.
  • Explain how the singularity at x = -1 changes negative-side error estimates.
  • Recognize when a valid Lagrange bound does not become small as the degree increases.
  • Choose a Taylor degree that meets a specified error tolerance when the bound permits it.

Why logarithm error bounds depend on location

The expression \(\ln(1+x)\) is defined for \(x>-1\), but its behavior is not symmetric around \(x=0\). Moving to the right from zero, the input \(1+x\) increases. Moving left, the input approaches zero, where the logarithm has a singularity. That nearby singularity affects how large the derivatives can become on the interval used in an error estimate.

The Taylor polynomial about zero is

$$ P_n(x)=\sum_{k=1}^{n}\frac{(-1)^{k+1}x^k}{k}, $$

where \(n\) is a nonnegative integer and \(P_0(x)=0\). We will use Lagrange’s remainder bound to control the difference between \(\ln(1+x)\) and \(P_n(x)\). The key practical task is to bound the \((n+1)\)st derivative on the entire interval from the center \(0\) to the input \(x\).

Definition: The error in using the degree-\(n\) Taylor polynomial at \(x\) is \(R_n(x)=\ln(1+x)-P_n(x)\). If the \((n+1)\)st derivative is bounded in absolute value by \(M\) throughout the interval between \(0\) and \(x\), Lagrange’s remainder bound gives $$ |R_n(x)|\leq \frac{M|x|^{n+1}}{(n+1)!}. $$

Derivatives and the required interval

For every positive integer \(m\), differentiating \(\ln(1+t)\) gives

$$ \frac{d^m}{dt^m}\ln(1+t) = \frac{(-1)^{m-1}(m-1)!}{(1+t)^m}, \qquad t>-1. $$

For example, the first derivative is \(1/(1+t)\), the second is \(-1/(1+t)^2\), and the third is \(2/(1+t)^3\). The general formula follows by induction: differentiating the expression for order \(m\) multiplies by \(-m\) and raises the denominator’s power from \(m\) to \(m+1\), giving the stated expression for order \(m+1\).

To use the Lagrange bound for \(P_n\), set \(m=n+1\). The absolute value of the derivative that must be bounded is therefore

$$ \left|\frac{d^{n+1}}{dt^{n+1}}\ln(1+t)\right| = \frac{n!}{(1+t)^{n+1}}. $$

This function is largest where \(1+t\) is smallest. On the segment from \(0\) to a positive \(x\), the smallest value of \(1+t\) is \(1\). On the segment from a negative \(x\) to \(0\), it is \(1+x\). These are different derivative bounds, even when the two inputs have the same distance from zero.

The bound on either side of zero

For \(x\geq 0\), the derivative magnitude on \([0,x]\) is at most \(n!\). For \(-1<x<0\), it is at most \(n!/(1+x)^{n+1}\). Substitution into Lagrange’s formula gives the useful pointwise estimates below.

$$ \begin{aligned} x\geq 0:\quad |R_n(x)| &\leq \frac{x^{n+1}}{n+1},\\[4pt] -1<x<0:\quad |R_n(x)| &\leq \frac{|x|^{n+1}}{(n+1)(1+x)^{n+1}} =\frac{1}{n+1}\left(\frac{|x|}{1+x}\right)^{n+1}. \end{aligned} $$

These estimates require no assumption that the polynomial actually gives a good approximation: they follow whenever the function has \(n+1\) continuous derivatives on an open interval containing the segment between zero and \(x\). For \(\ln(1+t)\), this condition holds whenever \(x>-1\). The quality of the bound is a separate question.

Key takeaway: For a negative input, the important ratio in this Lagrange estimate is \(|x|/(1+x)\). As \(x\) approaches \(-1\), the denominator approaches zero, reflecting the increasingly large derivatives near the logarithm’s singularity.

Worked Example: A positive input

Worked Example: Bounding the error at \(x=1/4\)

Approximate \(\ln(5/4)\) using the degree-three Taylor polynomial and find its Lagrange error bound. Since \(1+x=5/4\), the target value is indeed \(\ln(1+x)=\ln(5/4)\).

The polynomial is

$$ P_3(x)=x-\frac{x^2}{2}+\frac{x^3}{3}. $$

At \(x=1/4\), its three terms are

$$ P_3\left(\frac14\right) = \frac14-\frac{1}{32}+\frac{1}{192} = \frac{48-6+1}{192} = \frac{43}{192}. $$

On the interval \([0,1/4]\), the third-order derivative needed for the remainder is the fourth derivative. Its magnitude is \(3!/(1+t)^4\), which is at most \(3!=6\), attained at \(t=0\). Thus \(M=6\), and

$$ \left|\ln\left(\frac54\right)-\frac{43}{192}\right| \leq \frac{6(1/4)^4}{4!} = \frac{6}{24\cdot256} = \frac{1}{1024}. $$

The bound is about \(0.000977\). The polynomial value is \(43/192\), approximately \(0.223958\); the bound guarantees that the true logarithm differs from this value by no more than \(1/1024\). The calculation uses the maximum derivative on the full segment, not only the derivative at the target.

Worked Example: A negative input near the singularity

Worked Example: Bounding the error at \(x=-1/2\)

Use \(P_3\) to approximate \(\ln(1/2)\). Substitution gives

$$ P_3\left(-\frac12\right) = -\frac12-\frac{1}{8}-\frac{1}{24} = -\frac{12+3+1}{24} = -\frac23. $$

On \([-1/2,0]\), the fourth derivative has magnitude \(3!/(1+t)^4\). Since \(1+t\geq 1/2\) on this interval,

$$ \left|\frac{d^4}{dt^4}\ln(1+t)\right| \leq \frac{6}{(1/2)^4} =96. $$

Consequently,

$$ \left|\ln\left(\frac12\right)+\frac23\right| \leq \frac{96(1/2)^4}{4!} =\frac{96}{384} =\frac14. $$

The exact Lagrange estimate is also obtained from the negative-side formula: \(\frac14( (1/2)/(1/2))^4=1/4\). The true difference is about \(0.02648\), which is below \(0.25\). The bound is valid but fairly loose.

How the distance to \(-1\) affects the bound

For a fixed negative input \(x=-a\), where \(0<a<1\), the estimate can be written

$$ |R_n(-a)| \leq \frac{1}{n+1}\left(\frac{a}{1-a}\right)^{n+1}. $$

The number \(1-a\) is the distance from \(-a\) to the singular point \(-1\), while \(a\) is the distance from \(-a\) to the expansion center \(0\). The ratio compares those distances. When the target lies closer to the singularity than to the center, \(a>1-a\), so this ratio exceeds \(1\). In that case the bound eventually grows with the degree, although it may decrease initially. It is the bound that fails to become small; this observation alone does not establish that the actual error grows.

For example, at \(x=-3/5\), the ratio is \(3/2\). The bounds for degrees zero, one, and two are respectively

$$ B_0=\frac32,\qquad B_1=\frac{(3/2)^2}{2}=\frac98,\qquad B_2=\frac{(3/2)^3}{3}=\frac98. $$

Thus the bound decreases at first and then stays the same. To see what happens eventually, write \(B_n=q^{n+1}/(n+1)\), where \(q=3/2\). The ratio of successive bounds is

$$ \frac{B_{n+1}}{B_n} = q\frac{n+1}{n+2}. $$

For \(q=3/2\), this ratio exceeds \(1\) when \(3(n+1)>2(n+2)\), or \(n>1\). In particular, \(B_3>B_2\). More generally, if \(q>1\), this ratio is eventually greater than \(1\), and the exponential factor eventually dominates the factor \(1/(n+1)\). If \(q<1\), the bound tends to zero; if \(q=1\), it is \(1/(n+1)\), which also tends to zero.

Worked Example: A uniform bound on an interval

Worked Example: Bounding the error throughout \([-1/3,1/4]\)

Find a degree-four Lagrange error bound valid for every \(x\) in \([-1/3,1/4]\). For \(x\in[-1/3,0]\), the negative-side estimate is largest at \(x=-1/3\): the ratio \(|x|/(1+x)\) increases as \(|x|\) increases, and here its largest value is \((1/3)/(2/3)=1/2\). Therefore

$$ |R_4(x)| \leq \frac{1}{5}\left(\frac12\right)^5 = \frac{1}{160} \qquad \left(-\frac13\leq x\leq0\right). $$

For \(x\in[0,1/4]\), the positive-side estimate is at most

$$ \frac{(1/4)^5}{5}=\frac{1}{5120}. $$

Since \(1/5120<1/160\), the single bound \(1/160\) applies across the whole interval. To check the derivative calculation directly, the fifth derivative has magnitude \(4!/(1+t)^5\). On the full interval, \(1+t\geq2/3\), so its maximum is \(24(3/2)^5=729/4\). With \(|x|\leq1/3\), the general Lagrange formula gives

$$ |R_4(x)| \leq \frac{(729/4)(1/3)^5}{5!} = \frac{729}{4\cdot243\cdot120} = \frac{1}{160}. $$

This confirms the interval-wide result using one derivative maximum and the greatest distance from the center.

A common mistake: using the derivative bound from the wrong side

A tempting but incorrect shortcut is to use \(M=n!\) for negative inputs, just as on a positive interval. For the degree-three approximation at \(x=-1/2\), that shortcut would give

$$ \frac{6(1/2)^4}{4!}=\frac{1}{64}. $$

But \(6\) is not an upper bound for the fourth derivative’s magnitude on \([-1/2,0]\): at \(t=-1/2\), that magnitude is \(6/(1/2)^4=96\). The proposed bound \(1/64\) is even smaller than the actual error, approximately \(0.02648\), so it cannot be valid. The corrected derivative maximum is \(96\), yielding the valid bound \(1/4\). Always find the derivative maximum over the entire segment before applying the remainder formula.

What the estimate tells you—and what it does not

Lagrange’s bound is a certificate: if its value is below a requested tolerance, then the approximation is guaranteed to meet that tolerance. It need not be the smallest possible bound, and a large bound does not prove that the approximation itself is poor. It may simply be too crude to certify the actual error.

For positive inputs up to \(1\), the bound \(x^{n+1}/(n+1)\) tends to zero as the degree increases. On the negative side, the corresponding bound tends to zero for \(|x|\leq1/2\), but for \(1/2<|x|<1\) its ratio \(|x|/(1-|x|)\) exceeds \(1\), so this particular Lagrange estimate does not tend to zero. The distinction comes from the derivative maximum near \(-1\), not from a change in the remainder formula.

Practical rule: First verify that the segment from \(0\) to \(x\) stays to the right of \(-1\). Then bound the \((n+1)\)st derivative on that segment. Only after both steps should you judge whether the resulting estimate is small enough to be useful.

Check Your Understanding

Use the derivative maximum on the relevant segment in each question, rather than assuming the positive-side bound applies everywhere.

  1. State the Lagrange remainder bound for \(P_n\) and identify the derivative that must be bounded.
  2. For \(x=-1/4\), what is the ratio \(|x|/(1+x)\) in the negative-side estimate?
  3. Why does the maximum derivative magnitude on \([-a,0]\) occur at \(-a\), for \(0<a<1\)?
  4. For \(x=-3/5\), why does the Lagrange bound eventually increase with degree even though its first values do not increase at every step?
  5. What is wrong with using \(M=n!\) for a negative input without checking the interval of differentiation?