Tutorials › Calculus II › Taylor Polynomials for the Natural Logarithm

Taylor Polynomials · Tutorial 811 of 998

Taylor Polynomials for the Natural Logarithm

Differentiate the natural logarithm repeatedly to build and check Taylor polynomials at positive centers.

Beginner 9 min read

What You'll Learn

  • State the domain condition needed for a Taylor polynomial of \(\ln x\) at a center.
  • Find successive derivatives of the natural logarithm and evaluate them at a positive center.
  • Use the general coefficient formula to construct low-degree polynomials.
  • Express the polynomial at center one in powers of \(h\).
  • Check a computed polynomial by differentiating it at its center.
  • Identify and correct sign and center errors in logarithm polynomials.

Why Taylor Polynomials for the Natural Logarithm?

The natural logarithm changes at a rate that depends on the input: its derivative is \(1/x\). Consequently, the polynomial that models \(\ln x\) depends on the center where the model is built. Finding that polynomial is a useful way to turn derivative information at one positive input into a local algebraic approximation.

The calculation follows the Taylor polynomial definition: evaluate the function and its derivatives at the center, then use those values as coefficients. For the natural logarithm, repeated differentiation produces a particularly regular pattern.

Key condition: The center \(a\) must be positive. The function \(\ln x\) and all of its derivatives used in the polynomial are defined in a neighborhood of every \(a>0\).

The Derivatives of \(\ln x\)

Let \(f(x)=\ln x\), with \(x>0\). Its first derivatives are

$$ f(x)=\ln x,\qquad f'(x)=\frac{1}{x},\qquad f''(x)=-\frac{1}{x^2},\qquad f'''(x)=\frac{2}{x^3},\qquad f^{(4)}(x)=-\frac{6}{x^4}. $$

The signs alternate, and the numerator factors are \(1,1,2,6,\ldots\). In general, for every integer \(k\geq 1\),

$$ f^{(k)}(x)=\frac{(-1)^{k-1}(k-1)!}{x^k}. $$

This formula can be established by induction. It is true for \(k=1\), since \((-1)^0(0)!/x=1/x=f'(x)\). If it holds for \(k\), differentiating both sides gives

$$ \frac{d}{dx}\left[(-1)^{k-1}(k-1)!x^{-k}\right] = (-1)^{k-1}(k-1)!(-k)x^{-k-1} = (-1)^k k!x^{-(k+1)}. $$

That is the claimed formula with \(k+1\) in place of \(k\), so the formula holds for every \(k\geq1\).

The Taylor Polynomial at a Positive Center

For a function with \(n\) derivatives at \(a\), its degree-\(n\) Taylor polynomial at \(a\) is

$$ P_n(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k, \qquad f^{(0)}(a)=f(a). $$

For \(f(x)=\ln x\), the constant term is \(\ln a\). For each \(k\geq1\), the coefficient of \((x-a)^k\) is

$$ \frac{f^{(k)}(a)}{k!} = \frac{(-1)^{k-1}(k-1)!}{a^k k!} = \frac{(-1)^{k-1}}{k a^k}. $$

Therefore, for every positive center \(a\) and integer degree \(n\geq0\),

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

When \(n=0\), the sum has no terms and \(P_0(x)=\ln a\). For positive degrees, the first few terms are

$$ P_1(x)=\ln a+\frac{x-a}{a}, $$ $$ P_2(x)=\ln a+\frac{x-a}{a}-\frac{(x-a)^2}{2a^2}, $$ $$ P_3(x)=\ln a+\frac{x-a}{a}-\frac{(x-a)^2}{2a^2} +\frac{(x-a)^3}{3a^3}. $$

Each successive term uses the next derivative at \(a\). The power is \((x-a)^k\), so the polynomial is centered at \(a\); its coefficients are not in general the same as those of a polynomial centered at zero.

Worked Examples

Worked Example: A Cubic Polynomial at Center Two

Find the degree-three Taylor polynomial for \(\ln x\) at \(a=2\). First evaluate the function and the derivatives through order three at the center:

$$ f(2)=\ln 2,\qquad f'(2)=\frac{1}{2},\qquad f''(2)=-\frac{1}{2^2}=-\frac14,\qquad f'''(2)=\frac{2}{2^3}=\frac14. $$

Substitute these values into the Taylor polynomial definition, dividing the \(k\)th derivative by \(k!\):

$$ \begin{aligned} P_3(x) &=f(2)+f'(2)(x-2)+\frac{f''(2)}{2!}(x-2)^2 +\frac{f'''(2)}{3!}(x-2)^3\\ &=\ln 2+\frac12(x-2)-\frac{1}{4\cdot2}(x-2)^2 +\frac{1}{4\cdot6}(x-2)^3\\ &=\ln 2+\frac12(x-2)-\frac18(x-2)^2+\frac1{24}(x-2)^3. \end{aligned} $$

Check by differentiating the polynomial:

$$ P_3'(x)=\frac12-\frac14(x-2)+\frac18(x-2)^2, \qquad P_3'(2)=\frac12=f'(2), $$ $$ P_3''(x)=-\frac14+\frac14(x-2), \qquad P_3''(2)=-\frac14=f''(2), $$ $$ P_3'''(x)=\frac14, \qquad P_3'''(2)=\frac14=f'''(2). $$

Also \(P_3(2)=\ln 2=f(2)\). Thus the polynomial agrees with the function and its first three derivatives at the chosen center.

Worked Example: A Quadratic Polynomial at Center Three

Find the degree-two Taylor polynomial for \(\ln x\) at \(a=3\). The required values are

$$ f(3)=\ln 3,\qquad f'(3)=\frac13,\qquad f''(3)=-\frac19. $$

Using the degree-two definition gives

$$ \begin{aligned} P_2(x) &=f(3)+f'(3)(x-3)+\frac{f''(3)}{2!}(x-3)^2\\ &=\ln 3+\frac13(x-3)-\frac{1}{18}(x-3)^2. \end{aligned} $$

For example, at \(x=3.3\), the centered input is \(x-3=0.3=3/10\), so the polynomial gives

$$ \begin{aligned} P_2(3.3) &=\ln 3+\frac13\left(\frac{3}{10}\right) -\frac{1}{18}\left(\frac{3}{10}\right)^2\\ &=\ln 3+\frac{1}{10}-\frac{9}{1800}\\ &=\ln 3+\frac{1}{10}-\frac{1}{200}\\ &=\ln 3+\frac{19}{200}. \end{aligned} $$

Check the polynomial at the center:

$$ P_2(3)=\ln 3,\qquad P_2'(x)=\frac13-\frac19(x-3),\qquad P_2'(3)=\frac13, $$ $$ P_2''(x)=-\frac19,\qquad P_2''(3)=-\frac19. $$

These are respectively \(f(3)\), \(f'(3)\), and \(f''(3)\), as required for a degree-two Taylor polynomial.

Centering at One: The Polynomial for \(\ln(1+h)\)

A common form uses a displacement \(h\) from the center rather than the original input \(x\). Set \(x=1+h\). Then \(x-1=h\), and the condition \(x>0\) becomes \(h>-1\). At center \(a=1\), the constant term is \(\ln 1=0\), and the general formula simplifies to

$$ P_n(h)=\sum_{k=1}^{n}\frac{(-1)^{k-1}}{k}h^k =h-\frac{h^2}{2}+\frac{h^3}{3}-\frac{h^4}{4}+\cdots $$

Here the displayed pattern means that the sum stops at the chosen degree \(n\). For instance, the degree-four polynomial is \(h-h^2/2+h^3/3-h^4/4\). The polynomial gives the degree-four Taylor model at \(h=0\); the displayed finite expression by itself does not assert an infinite-series identity.

Worked Example: The Degree-Four Polynomial for \(\ln(1+h)\)

To compute the degree-four polynomial, evaluate the derivatives of \(f(x)=\ln x\) at \(x=1\):

$$ f(1)=0,\qquad f'(1)=1,\qquad f''(1)=-1,\qquad f'''(1)=2,\qquad f^{(4)}(1)=-6. $$

Use the Taylor formula at \(1\), with displacement \(h=x-1\):

$$ \begin{aligned} P_4(h) &=f(1)+f'(1)h+\frac{f''(1)}{2!}h^2 +\frac{f'''(1)}{3!}h^3+\frac{f^{(4)}(1)}{4!}h^4\\ &=0+h-\frac{1}{2}h^2+\frac{2}{6}h^3-\frac{6}{24}h^4\\ &=h-\frac{h^2}{2}+\frac{h^3}{3}-\frac{h^4}{4}. \end{aligned} $$

For the input \(h=1/5\), the polynomial value is

$$ \begin{aligned} P_4\left(\frac15\right) &=\frac15-\frac{1}{2}\left(\frac1{25}\right) +\frac{1}{3}\left(\frac1{125}\right) -\frac{1}{4}\left(\frac1{625}\right)\\ &=\frac15-\frac1{50}+\frac1{375}-\frac1{2500}\\ &=\frac{1500-150+20-3}{7500} =\frac{1367}{7500}. \end{aligned} $$

To check the polynomial, differentiate:

$$ P_4'(h)=1-h+h^2-h^3,\qquad P_4'(0)=1, $$ $$ P_4''(h)=-1+2h-3h^2,\qquad P_4''(0)=-1, $$ $$ P_4'''(h)=2-6h,\qquad P_4'''(0)=2, \qquad P_4^{(4)}(h)=-6,\qquad P_4^{(4)}(0)=-6. $$

Also \(P_4(0)=0=f(1)\). The derivatives at \(h=0\) match those of \(f(1+h)=\ln(1+h)\) through order four.

Why the Coefficients Have This Form

The coefficient pattern is a direct consequence of the derivative pattern, not a guess based on a few terms. The \(k\)th derivative of \(\ln x\) at \(a\) is \((-1)^{k-1}(k-1)!/a^k\). The Taylor definition divides that derivative by \(k!\), and

$$ \frac{(k-1)!}{k!}=\frac{1}{k}. $$

That cancellation produces the coefficient \((-1)^{k-1}/(k a^k)\). At \(a=1\), only the alternating sign and the factor \(1/k\) remain. For a different center, the additional factor \(a^k\) in the denominator must be retained.

This calculation also explains why the polynomial is designed to match the function locally: its value and derivatives through degree \(n\) at the center equal those of \(\ln x\). It does not make the polynomial identical to \(\ln x\) away from the center.

Common Pitfall: Losing the Alternating Sign

A frequent error is to give every coefficient in the polynomial for \(\ln(1+h)\) a positive sign. For example, the incorrect quadratic calculation

$$ P_2(h)=h+\frac{h^2}{2} $$

fails a derivative check. It has \(P_2''(0)=1\), whereas the second derivative of \(\ln(1+h)\) at \(h=0\) is \(-1\). The correct second-order coefficient is therefore \(-1/2\), giving

$$ P_2(h)=h-\frac{h^2}{2}, \qquad P_2''(h)=-1,\qquad P_2''(0)=-1. $$

A related error is to use the formula for center one at a different center. At a general positive \(a\), the coefficient of \((x-a)^2\) is \(-1/(2a^2)\), not \(-1/2\). Keeping the center visible in every power of \(a\) helps prevent this mistake.

When These Polynomials Are Useful

A Taylor polynomial for the natural logarithm gives a polynomial model near a chosen positive input. The center should match the input around which the calculation is being made: use \(a=1\) when the expression is naturally written as \(\ln(1+h)\), and use another positive center when the input is close to that value. Increasing the degree incorporates more derivative information at that same center.

The key procedure is systematic: confirm that the center is positive, evaluate the derivatives there, divide each derivative by its factorial, and use powers of the displacement from the center. Finally, differentiate the polynomial and check that its values at the center reproduce the required derivative data.

Check Your Understanding

Use the derivative formula and the Taylor polynomial definition to answer these questions.

  1. What condition must a center \(a\) satisfy for the Taylor polynomial of \(\ln x\) at \(a\) to be defined?
  2. Find the degree-two Taylor polynomial for \(\ln x\) at \(a=2\).
  3. Write the degree-three Taylor polynomial for \(\ln(1+h)\).
  4. For a general positive center \(a\), what is the coefficient of \((x-a)^3\) in the Taylor polynomial?
  5. How can differentiating a proposed polynomial reveal a sign error in its quadratic term?