Skip to main content
Mathematics LibreTexts

4.3: Approximating the logartihm

  • Page ID
    58570
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    A function is often approximated by its Taylor series

    \[f(x)=f(0)+\left.x \frac{d f}{d x}\right|_{x=0}+\left.\frac{x^{2}}{2} \frac{d^{2} f}{d x^{2}}\right|_{x=0}+\cdots\label{4.28} \]

    Screen Shot 2021-03-08 at 12.05.38 PM.png

    which looks like an unintuitive sequence of symbols. Fortunately, pictures often explain the first and most important terms in a function approximation. For example, the one-term approximation \(\sin θ ≈ θ\), which replaces the altitude of the triangle by the arc of the circle, turns the nonlinear pendulum differential equation into a tractable, linear equation (Section 3.5).

    Another Taylor-series illustration of the value of pictures come from the series for the logarithm function:

    \[ln(1 + x) = x - \frac{x^{2}}{2} + \frac{x^{3}}{3} - ... .\label{4.29} \]

    Its first term, x, will lead to the wonderful approximation \((1 + x)^{n} ≈ e^{nx}\) for small \(x\) and arbitrary \(n\) (Section 5.3.4). Its second term, −\(x^{2}/2\), helps evaluate the accuracy of that approximation. These first two terms are the most useful terms—and they have pictorial explanations. The starting picture is the integral representation

    \[ln(1 + x) = \in_{0}^{x} \frac{dt}{1 + t }. \label{4.30} \]

    Question

    What is the simplest approximation for the shaded area?

    Screen Shot 2021-03-08 at 12.08.05 PM.png

    As a first approximation, the shaded area is roughly the circumscribed rectangle an example of lumping. The rectangle has area x:

    \[\text{area} = \underbrace{\text{height}}_{1} x \underbrace{\text{width}}_{x} = x. \label{4.31} \]

    This area reproduces the first term in the Taylor series. Because it uses a circumscribed rectangle, it slightly overestimates \(ln(1 + x)\).

    Screen Shot 2021-03-08 at 12.20.46 PM.png

    The area can also be approximated by drawing an inscribed rectangle. Its width is again \(x\), but its height is not 1 but rather \(1/(1+x)\), which is approximately \(1 − x\) (Problem 4.18). Thus the inscribed rectangle has the approximate area \(x(1 − x) = x − x\). This area slightly underestimates \(ln(1 + x)\).

    Problem 4.18 Picture for approximating the reciprocal function

    Confirm the approximation

    \[\frac{1}{1 + x} ≈ 1 − x \text{(for small x)} \label{4.32} \]

    by trying \(x = 0.1\) or \(x = 0.2\). Then draw a picture to illustrate the equivalent approximation \((1 − x)(1 + x) ≈ 1\).

    We now have two approximations to \(ln(1 + x)\). The first and slightly simpler approximation came from drawing the circumscribed rectangle. The second approximation came from drawing the inscribed rectangle. Both dance around the exact value.

    Question

    How can the inscribed- and circumscribed-rectangle approximations be combined to make an improved approximation?

    Screen Shot 2021-03-08 at 12.31.42 PM.png

    One approximation overestimates the area, and the other underestimates the area; their average ought to improve on either approximation. The average is a trapezoid with area

    \[\frac{x + (x - x^{2})}{2} = x - \frac{x^{2}}{2}. \label{4.33} \]

    This area reproduces the first two terms of the full Taylor series

    \[ln(1 + x) = x - \frac{x^{2}}{2} + \frac{x^{3}}{3} - ... . \label{4.34} \]

    Problem 4.19 Cubic term

    Estimate the cubic term in the Taylor series by estimating the difference between the trapezoid and the true area.

    For these logarithm approximations, the hardest problem is ln 2.

    \[\ln (1+1) \approx\left\{\begin{array}{ll}
    1 & \text { (one term) } \\
    1-\frac{1}{2} & \text { (two terms) }
    \end{array}\right.\label{4.35} \]

    Both approximations differ significantly from the true value (roughly 0.693). Even moderate accuracy for ln 2 requires many terms of the Taylor series, far beyond what pictures explain (Problem 4.20). The problem is that x in \(ln(1 + x)\) is 1, so the \(x^{n}\) factor in each term of the Taylor series does not shrink the high-n terms.

    The same problem happens when computing π using Leibniz’s arctangent series (Section 4.2.3)

    \[\arctan x = x - \frac{x^{3}}{3} + \frac{x^{5}}{5} - \frac{x^{7}}{7} + .... \label{4.36} \]

    By using x = 1, the direct approximation of π/4 requires many terms to attain even moderate accuracy. Fortunately, the trigonometric identity \(\arctan 1 = 4 \arctan 1/5 − \arctan 1/239\) lowers the largest \(x\) to 1/5 and thereby speeds the convergence.

    Question

    Is there an analogous that helps estimate \(ln2\)?

    Because 2 is also (4/3)/(2/3), an analogous rewriting of \(ln2\) is

    \[ln2 = ln\frac{4}{3} - ln\frac{2}{3}. \label{4.37} \]

    Each fraction has the form \(1 + x\) with \(x = ±1/3\). Because x is small, one term of the logarithm series might provide reasonable accuracy. Let’s therefore use \(ln(1 + x) ≈ x\) to approximate the two logarithms:

    \[ln2 ≈ \frac{1}{3} - (-\frac{1}{3}) = \frac{2}{3}. \label{4.38} \]

    This estimate is accurate to within 5%!

    The rewriting trick has helped to compute \(\pi\) (by rewriting the \(arctan x\) series) and to estimate \(ln(1 + x)\) (by rewriting x itself). This idea therefore becomes a method—a trick that I use twice (this definition is often attributed to Polya).

    Multiple problems

    Problem 4.20 How many terms?

    The full Taylor series for the logarithm is

    \[ln(1 + x) = \sum{1}^{\infty} (-1)^{n+1} \frac{x^{n}}{n}. \label{4.39} \]

    If you set \(x = 1\) in this series, how many terms are required to estimate \(ln2\) to within 5%?

    Problem 4.21 Second rewriting

    Repeat the rewriting method by rewriting 4/3 and 2/3; then estimate \(ln2\) using only one term of the logarithm series. How accurate is the revised estimate?

    Problem 4.22 Two terms of the Taylor series

    After rewriting \(ln2\) as \(ln(4/3) − ln(2/3)\), use the two-term approximation that \(ln(1+x) ≈ x − x^{2}/2\) to estimate \(ln2\). Compare the approximation to the one-term estimate, namely 2/3. (Problem 4.24 investigates a pictorial explanation.)

    Problem 4.23 Rational-function approximation for the logarithm

    The replacement \(ln 2 = ln(4/3) − ln(2/3)\) has the general form

    \[ln(1 + x) = ln\frac{1 + y}{1 - y}, \label{4.40} \]

    where \(y = x/(2 + x)\).

    Use the expression for y and the one-term series \(ln(1 + x) ≈ x\) to express \(ln(1 + x)\) as a rational function of \(x\) (as a ratio of polynomials in x). What are the first few terms of its Taylor series?

    Compare those terms to the first few terms of the \(ln(1 + x)\) Taylor series, and thereby explain why the rational-function approximation is more accurate than even the two-term series \(ln(1 + x) ≈ x − x^{2}/2\).

    Problem 4.24 Pictorial interpretation of the rewriting

    Screen Shot 2021-03-23 at 8.27.21 PM.png

    a. Use the integral representation of \(ln(1 + x)\) to explain why the shaded area is \(ln2\).

    b. Outline the region that represents

    \[ln\frac{4}{3} - ln\frac{2}{3} \label{4.41} \]

    when using the circumscribed-rectangle approximation for each logarithm.

    c. Outline the same region when using the trapezoid approximation \(ln(1 + x) = x − x^{2}/2\). Show pictorially that this region, although a different shape, has the same area as the region that you drew in item b.


    This page titled 4.3: Approximating the logartihm is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Sanjoy Mahajan (MIT OpenCourseWare) via source content that was edited to the style and standards of the LibreTexts platform.