Home » Approximation

Tag: Approximation

Compute π using the Taylor polynomial of arctan x

For this exercise define

    \[ \alpha = \arctan \frac{1}{5}, \qquad \beta = 4 \alpha - \frac{1}{4} \pi. \]

  1. Using the trig identity

        \[ \tan (A+B) = \frac{\tan A + \tan B}{1 - \tan A \tan B} \]

    twice, once with A = B = \alpha, and then the second time with A = B = 2 \alpha, show that

        \[ \tan (2 \alpha) = \frac{5}{12}, \qquad \tan (4 \alpha) = \frac{120}{119}. \]

    Then use the same identity again with A = 4 \alpha and B = -\frac{1}{4} \pi to show

        \[ \tan \beta = \frac{1}{239}. \]

    This establishes the identity

        \[ \pi = 16 \arctan \frac{1}{5} - 4 \arctan \frac{1}{239}. \]

  2. Using the Taylor polynomial approximation T_{11} (\arctan x) at x =\frac{1}{2} prove that

        \[ 3.158328934 < 16 \arctan \frac{1}{5} < 3.158328972. \]

  3. Using the Taylor polynomial approximation T_3 (\arctan x) at x = \frac{1}{239} prove that

        \[ -0.016736309 < -4\arctan \frac{1}{239} < -0.016736300. \]

  4. Using the above parts show that the value of \pi to seven decimal places is 3.1415926.

  1. Proof. Letting A = B = \alpha = \arctan \frac{1}{5} we have

        \[ \tan (A+B) = \tan (2 \alpha) = \frac{\tan A + \tan B}{1 - \tan A \tan B} = \frac{(2/5)}{1 - (1/25)} = \frac{5}{12}. \]

    Letting A = B = 2 \alpha = 2 \arctan \frac{1}{5} we have

        \[ \tan (A+B) = \tan (4 \alpha) = \frac{\tan A + \tan B}{1 - \tan A \tan B} = \frac{(10/12)}{1 - (25/144)} = \frac{120}{119}. \]

    Letting A = 4 \alpha and B = -\frac{\pi}{4} we have (recalling that \beta = 4 \alpha - \frac{\pi}{4})

        \[ \tan (\beta) = \frac{\tan (4\alpha) + \tan\left(-\frac{\pi}{4}\right)}{1 - \tan (4\alpha) \tan \left( -\frac{\pi}{4} \right)} = \frac{(120/119) - 1}{1 - (120/119)(-1)} = \frac{1}{239}. \]

    But then

        \begin{align*}  && \tan \left( 4 \alpha - \frac{\pi}{4} \right) &= \frac{1}{239}\\[9pt] \implies && 4 \alpha - \frac{\pi}{4} &= \arctan \left( \frac{1}{239} \right) \\[9pt] \implies && \frac{\pi}{4} &= 4 \arctan \frac{1}{5} - \arctan \frac{1}{239} \\[9pt] \implies && \pi &= 16 \arctan \frac{1}{5} - 4 \arctan \frac{1}{239}. \qquad \blacksquare \end{align*}

  2. Proof. We know the Taylor polynomial approximation for \arctan x from this exercise (Section 7.8, Exercise #3):

        \[ T_{11} (\arctan x) = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \frac{x^9}{9} - \frac{x^{11}}{11}. \]

    Therefore, we can compute an approximation to \arctan x,

        \begin{align*}  &&\arctan x &= \left( x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \frac{x^9}{9} - \frac{x^{11}}{11} \right) + E_{10}(x) \\[9pt] \implies && 16 \arctan \left(\frac{1}{5} \right) &= 16 \left( \frac{1}{5} - \frac{1}{375} + \frac{1}{15625} - \frac{1}{546875} + \frac{1}{17578125} - \frac{1}{537109375} \right) + E_{10}\left( \frac{1}{5} \right)\\[9pt] \implies && 16 \arctan \left( \frac{1}{5} \right) &= 3.158328957 + E_{10} \left( \frac{1}{5} \right), \end{align*}

    where

        \[ \left|E_{10}\left(\frac{1}{5} \right)\right| \leq \frac{(1/5)^{11}}{11} = .000000018. \]

    Therefore,

        \[ 3.158328934 < 16 \arctan \left( \frac{1}{5} \right) < 3.158328972. \qquad \blacksquare\]

  3. Proof. Again using the Taylor polynomial approximation to \arctan x we have

        \begin{align*}  &&T_3 (\arctan x) &= x - \frac{x^3}{3} \\[9pt] \implies && \arctan x &= x - \frac{x^3}{3} + E_2 (x), \qquad |E_2 (x)| \leq \frac{x^3}{3} \\[9pt] \implies && \arctan \left( \frac{1}{239} \right) &= \left( \frac{1}{239} \right) - \frac{(1/239)^3}{3} + E_2 \left( \frac{1}{239} \right) \\[9pt] \implies && -4 \arctan \left( \frac{1}{239} \right) &= -0.01673630401 + E_2 \left( \frac{1}{239} \right) \\[9pt] \implies && -0.016736309 &< -4 \arctan \left( \frac{1}{239} \right) < -0.016736300. \qquad \blacksquare \end{align*}

  4. Finally,

        \begin{align*}   \pi &= 16 \arctan \frac{1}{5} - 4 \arctan \frac{1}{239} \\  &\approx 3.158328957 - 0.01673630401 \\  &\approx 3.1415926.  \end{align*}

Use Taylor polynomials to approximate the nonzero root of arctan x = x2

  1. Show that r = \frac{\sqrt{21}-3}{2} is an approximation of the nonzero root of the equation

        \[ \arctan x = x^2 \]

    using the cubic Taylor polynomial approximation to \arctan x.

  2. Given that

        \[ \sqrt{21} < 4.6 \qquad \text{and} \qquad 2^{16} = 65536 \]

    prove that the number r from part (a) satisfies

        \[ |r^2 - \arctan x| < \frac{7}{100}. \]

    Determine if (r^2 - \arctan r) is positive or negative and prove the result.


  1. Proof. From a previous exercise (Section 7.8, Exercise #3) we know

        \[ \arctan x = x - \frac{x^3}{3} + E_{2n}(x). \]

    So, to approximate the nonzero root of x^2 - \arctan x we have

        \begin{align*}  x^2 - x + \frac{x^3}{3} \approx 0 && \implies && x^2 + 3x - 3 &\approx 0 \\  && \implies && x &\approx \frac{\sqrt{21}-3}{2}. \qquad \blacksquare \end{align*}

  2. We know from the same previous exercise we used in part (a) that the error term E_{2n}(x) for \arctan x satisfies the inequality

        \[ |E_{2n}(x)| \leq \frac{x^{2n+1}}{2n+1}. \]

    Using the values for \sqrt{21} and 2^{16} given we have

        \begin{align*}  \left|E_5 \left( \frac{\sqrt{21}-3}{2} \right)\right| &\leq \left| \frac{\left( \frac{\sqrt{21}-3}{2} \right)^5}{5} \right|  \leq \left| \frac{0.8^5}{5} \right| = \frac{(4/5)^5}{5}  \\[9pt]  &= \frac{2^{10}}{5^6} = \frac{2^{16}}{10^6} = \frac{65536}{1000000} < \frac{7}{100}. \qquad \blaacksquare \end{align*}

Use Taylor polynomials to approximate the nonzero root of x2=sin x

  1. Using the cubic Taylor polynomial approximation of \sin x, show that the nonzero root of the equation

        \[ x^2 = \sin x \]

    is approximated by r = \sqrt{15} - 3.

  2. Using part (a) show that

        \[ | \sin r - r^2  | < \frac{1}{200}, \]

    given that \sqrt{15} - 3 < 0.9. Determine whether (\sin r - r^2) is positive or negative and prove the result.


  1. Proof. The cubic Taylor polynomial approximation of \sin x is

        \[ \sin x = x - \frac{x^3}{3!} + E_{2n} (x). \]

    This implies

        \[ x^2 - \sin x \approx x^2 - x + \frac{x^3}{6}. \]

    Therefore, we can approximate the nonzero root by

        \begin{align*}  x^2 - \sin x = 0 && \implies && x^2 - x + \frac{x^3}{6} &\approx 0 \\  && \implies && 6x^2 + x - 1 &\approx 0 \\  && \implies && x &\approx \sqrt{15} - 3.  \qquad \blacksquare \end{align*}

  2. Proof. We know from this exercise (Section 7.8, Exercise #1) that for \sin x we have

        \[ |E_{2n} (x)| \leq \frac{|x|^{2n+1}}{(2n+1)!}. \]

    So, for n = 2, and using the given inequality \sqrt{15} - 3 < 0.9, we have

        \[ |E_{2n} (x)| \leq \frac{|0.9|^5}{120} = \frac{9^5}{10^5 (120)} < \frac{1}{200}. \]

    Furthermore, (\sin r - r^2) > 0 since

        \[ \sin r - r^2 = E_{2n}(x) = \frac{x^5}{5!} - \frac{x^7}{7!}+ \cdots \]

    with the absolute value of each term in the sum strictly less than the absolute value of the previous term (since x < 1 and (n+2)! > n!). Thus, each pair is positive, so the whole series is positive. \qquad \blacksquare

Use the weighted mean value theorem to approximate an integral

Note that

    \[ 1+x^6 = (1+x^2)(1-x^2 + x^4), \]

and use the weighted mean value theorem (Theorem 3.16 in Apostol) to prove that for positive a:

    \[ \frac{1}{1+a^6} \left( a - \frac{a^3}{3} + \frac{a^5}{5} \right) \leq \int_0^a \frac{dx}{1+x^2} \leq a - \frac{a^3}{3} + \frac{a^5}{5}.  \]

Using a = \frac{1}{10} compute the integral to six decimal places.

Recall the weighted mean value theorem:

For functions f and g continuous on [a,b], if g never changes sign in [a,b] then there exists c \in [a,b] such that

    \[ \int_a^b f(x) g(x) \, dx = f(c) \int_a^b g(x) \, dx. \]


Proof. Let

    \[ f(x) = \frac{1}{1+x^6}, \qquad g(x) = 1 - x^2 + x^4. \]

Then,

    \begin{align*}   \int_0^a \frac{dx}{1+x^2} &= \int_0^a \frac{1-x^2+x^4}{1+x^6} \, dx \\  &= \int_0^a f(x) g(x) \, dx \\  &= \frac{1}{c} \int_0^a g(x) \, dx  \end{align*}

for some c \in [0,a]. Since f is strictly decreasing on [0,a], we know f(a) \leq f(c) \leq f(0); thus,

    \[ \frac{1}{1+a^6} \leq f(c) \leq 1. \]

Furthermore,

    \[ \int_0^a g(x) \, dx = \int_0^a (1-x^2 + x^4) \, dx = a - \frac{a^3}{3} + \frac{a^5}{5}. \]

Thus,

    \[ \left( \frac{1}{1+a^6} \right) \left( a - \frac{a^3}{3} + \frac{a^5}{5} \right) \leq \int_0^a \frac{dx}{1+x^2} \leq \left( a - \frac{a^3}{3} + \frac{a^5}{5} \right). \qquad \blacksquare\]

Now, taking a = \frac{1}{10} we compute,

    \begin{align*}  && (.9999999)(.0996687) \leq \int_0^a \frac{dx}{1+x^2} \leq .0996687 \\ \implies && .0996686 \leq \int_0^a \frac{dx}{1+x^2} \leq .0996687 \\ \implies && \int_0^a \frac{dx}{1+x^2} \approx .099669. \end{align*}