Lecture 35 Review 1

Exercise 35.1 Find the root of the function \(f(x) = e^x + x + 4\) correct to 3 decimal places. You may use \(x_0=1\) as a starting point.

Solution. We apply Newton’s Method. In order to get to 3 decimal accuracy we must iterate enough times so that consecutive solutions round to the same thousandth.

Recall that Newton’s formula is

\[ x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} \]

We must rewrite the question so that we are solving a root problem \(f(x) = 0\). In this instance we have

\[ e^x + x - 4 = 0 \] so that \(f(x) = e^x + x -4\).

From here we see that \(f'(x) = e^x + 1\), so Newton’s formula gives

\[ x_{n+1} = x_n - \frac{e^{x_n} + x_n - 4}{e^{x_n} + 1} \]

Starting with \(x_0 = 1\) we iterate to give the following sequence of solutions \[\begin{align*} x_0 &= 1 \\ x_1 &= 1.075765686 \\ x_2 &= 1.073730483 \\ x_3 &= 1.073728983 \\ \end{align*}\]

We see that solutions 3 and 4 round to the same thousandth and therefore our solution (to 3 decimal places) is \[ x = 1.074 \]

Exercise 35.2 Use \(x_0 = 0.75\) as a starting point to find the rightmost solution to the equation \(e^{-x^2}=x^2\), correct to 4 decimal places.

Solution. Using Newton’s Method, we have \[x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}\] \[f(x)=e^{-x^2}-x^2 \Rightarrow f'(x)=-2xe^{-x^2}-2x\] So \[\displaystyle x_{n+1}=x_n-\frac{e^{-x_n^2}-x_n^2}{-2x_ne^{-x_n^2}-2x_n}=x_n+\frac{e^{-x_n^2}-x_n^2}{2x_ne^{-x_n^2}+2x_n}\] With \(x_0=0.75\), we get \[\begin{align*} x_0 &= 0.75\\ x_1 & =0.75-\frac{f(0.75)}{f'(0.75)}=0.75+\frac{e^{-(0.75^2)}-0.75^2}{1.5e^{-(0.75^2)}+1.5}=0.7530929224...\\ x_2 & =0.753089165... \end{align*}\]

Thus, we have that \(x=0.7531\) after 2 iterations.

  1. Find the third degree Taylor polynomial of \(\sqrt[3]{x}\) centered at \(x=1\) (i.e. \(P_{3,1}(x)\))
  2. Use Taylor’s inequality to find an upper bound on the error in using \(P_{3,1}(x)\) to approximate \(\sqrt[3]{2}\)
  3. Verify that the actual error (by computing \(\sqrt[3]{2}\) directly) is less than the upper bound you found in part (2).
  1. Finding the derivatives and evaluating at \(x_0=1\) we get \[\begin{align*} f(x)=\sqrt[3]{x} & \quad f(1)=1\\ f'(x)=\frac{1}{3}x^{-\frac{2}{3}} & \quad f'(1)= \frac{1}{3}\\ f''(x)=-\frac{2}{9}x^{-\frac{5}{3}} & \quad f''(1)= -\frac{2}{9}\\ f'''(x)=\frac{10}{27}x^{-\frac{8}{3}} & \quad f'''(1)= \frac{10}{27} \end{align*}\]

Entering these values into the our Taylor polynomial formula we get \[P_{3,1}(x)=1+\frac{1}{3}(x-1)+\frac{-2}{9}\frac{(x-1)^2}{2!}+\frac{10}{27}\frac{(x-1)^3}{3!}\]

  1. Taking the \(4^{th}\) derivative of \(f(x)=\sqrt[3]{x}\) we get \[ f^{(4)}(x)=\frac{-80}{81}x^{\frac{-11}{3}}\]

Now for \(t\in [1,2]\) we have that \[|f^{(4)}(t)|=\left|\frac{-80}{81x^{\frac{11}{3}}}\right|\leq \frac{80}{81}\]

Taylor’s Inequality gives \[|R_{3,1}(x)|\leq \frac{80}{81}\frac{|x-1|^4}{4!}\Rightarrow|R_{3,1}(2)|\leq \frac{80}{81}\frac{|2-1|^4}{4!}=\frac{10}{243}=0.04115226337449...\]

This gives that the error of the approximation of \(\sqrt[3]{2}\) by \(P_{3,1}(2)\) is bounded by \(\displaystyle\frac{10}{243}\).

  1. Using a calculator we find that \(\sqrt[3]{2}=1.25992104989487...\)

Additionally, we have that \(\displaystyle P_{3,1}(2)=1+\frac{1}{3}-\frac{1}{9}+\frac{10}{3!27}=\frac{104}{81}\).

So then our error is given by \[ \mbox{Error}=\left|\sqrt[3]{2}-\frac{104}{81}\right|=0.02402956738908 \] and we see that this is, indeed, less than our error bound found in (2).

Exercise 35.3 Approximate the value of \(\int_0^1 \sin(2t^3)dt\) by using the Maclaurin polynomial of degree \(10\) of the function \[ f(x) = \int_0^x \sin(2t^3) dt. \] Calculate an upper bound on the error in your approximation.

Solution. First we will find a polynomial for g(u)=sin\((u)\) where \(u\in [0,2]\) and then do a substitution \(u\rightarrow 2t^3\).

Taking the derivatives and evaluating at \(u_0=0\) (since we are to use a Maclaurin polynomial) we get

\[\begin{align*} g(u)=\sin (u) & \quad g(0)=0\\ g'(u)=\cos (u) & \quad g'(0)= 1\\ g''(u)=-\sin (u) & \quad g''(0)=0\\ g'''(u)=-\cos (u) & \quad g'''(0)=-1 \end{align*}\]

From this we get that \[ \sin (u)\approx P_{3,0}(u)=u-\frac{u^3}{3!}\]

We notice that \(g^{(4)}(0)=0\) so, in fact, \(P_{3,0}(u)=P_{4,0}(u)\). Taking another derivative we get \[g^{(5)}(u)=\cos (u)\] Since \(\cos(u)\leq 1\), Taylor’s Inequality gives \[|R_{4,0}(u)|\leq \frac{|u|^5}{5!}\]

Now the substitution for \(2t^3\) gives \[\sin (2t^3)=2t^3-\frac{(2t^3)^3}{3!}+R_{4,0}(2t^3) \ \mathrm{for} \ t\in[0,1]\] Given the substitution, the error bound is now \[|R_{4,0}(2t^3)|\leq \frac{|2t^3|^5}{5!}=\frac{32t^{15}}{5!}\] Now integrating from \(0\) to \(x\) we get

\[\begin{align*} f(x)=\int^x_0\sin (2t^3)dt\\ &=\int^x_0(2t^3-\frac{8t^9}{3!}+R_{4,0}(2t^3))dt\\ &=\frac{x^4}{2}-\frac{8x^{10}}{3!10}+\int^x_0R_{4,0}(2t^3)dt\\ &=\frac{x^4}{2}-\frac{2x^{10}}{15}+\int^x_0R_{4,0}(2t^3)dt \end{align*}\]

Since \(|R_{4,0}(2t^3)|\leq \frac{32t^{15}}{5!}\) we have that the error bound for the above polynomial is given by \[\left|\int^x_0R_{4,0}(2t^3)dt\right|\leq \int^x_0|R_{4,0}(2t^3)|dt \leq \int^x_0 \frac{32t^{15}}{5!}dt=\frac{32x^{16}}{5!16}=\frac{x^{16}}{60}\]

Setting \(x=1\) we have that \[\int^1_0\sin (2t^3)dt \approx \frac{1}{2}-\frac{2}{15}=\frac{11}{30}=0.3\overline{6}\] with an error bound of \[\left|\int^x_0R_{4,0}(2t^3)dt\right|\leq \frac{1}{60}\]

Exercise 35.4 Let \(T_n(x)\) be the Taylor polynomial of degree up to \(n\) for \(y=\sin{x}\) expanded about 0. Find an \(n\) such that \(|\sin(0.1)-T_n(0.1)| \le 10^{-6}\), and show that your \(n\) works.

Solution. Let \(\displaystyle f(x)=\sin{x}\). Then all derivatives of \(f(x)\) are \(\pm \sin x\) and \(\pm \cos x\), and therefore \(|f^{(n)}(x)| \leq 1 = M\) for all \(n\). Using Taylor’s inequality:

\[ |\sin x - T_n(x)| \le \frac{M}{(n+1)!}|x|^{(n+1)} \quad \Longrightarrow |\sin(0.1)-T_n(0.1)| \le \frac{1}{10^{n+1}(n+1)!} \]

We require \(n\) such that \(\displaystyle \frac{1}{10^{n+1}(n+1)!} \le 10^{-6}\) or \(10^{n+1}(n+1)!>10^6\).

Choose \(n=4\). Then \(10^5(5!)=1.2\times10^7>10^6\).

Therefore if we take \(\displaystyle T_4\left(\frac{1}{10}\right)=\frac{1}{10}-\frac{1}{10^3\cdot3!}=\frac{599}{6000}\), we will have \(|\sin(0.1)-T_n(0.1)| \le 10^{-6}\).

Exercise 35.5 When we already know the Taylor expansion of a function it is often easier to use tricks to find a Taylor polynomial of a similar function.

  1. Find the fifth degree Maclaurin polynomial (i.e. \(P_{5,0}(x)\)) of the function \(f(x)=\sin(x)\)
  2. By differentiating \(P_{5,0}(x)\), verify that it is equivalent to \(P_{4,0}(x)\) of \(\cos(x)\).
  3. By substituting \(x \rightarrow 2x\) into \(P_{5,0}(x)\) show that it is equivalent to \(P_{5,0}(x)\) of \(\sin(2x)\).
  4. By multiplying by \(x\) show that it is equivalent to \(P_{6,0}(x)\) of \(x\sin(x)\). You should compute the appropriate Taylor polynomials of \(\cos(x), \sin(2x)\) and \(x\sin(x)\) directly to compare.
  1. Finding the derivatives and evaluating at \(x_0=0\) we get

\[\begin{align*} f(x)=\sin x & \quad f(0)=0\\ f'(x)=\cos x & \quad f'(0)= 1\\ f''(x)=-\sin x & \quad f''(0)=0\\ f'''(x)=-\cos x & \quad f'''(0)=-1\\ f^{(4)}(x)=\sin x & \quad f^{(4)}(0)=0\\ f^{(5)}(x)=\cos x & \quad f^{(5)}(0)=1 \end{align*}\]

Entering these values into the equation of a Maclaurin polynomial we get \[P_{5,0}(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}\]

  1. We know that for values of \(x\) near \(0\), \(P_{5,0}(x)\approx \sin x\). So then differentiation of \(P_{5,0}(x)\) suggests that \[\cos x\approx1-\frac{x^2}{2!}+\frac{x^4}{4!}\]

To verify that the above approximation does, indeed, hold we find \(P_{4,0}(x)\) of cos\(x\). \[\begin{align*} f(x)=\cos x & \quad f(0)=1\\ f'(x)=-\sin x & \quad f'(0)= 0\\ f''(x)=-\cos x & \quad f''(0)=-1\\ f'''(x)=\sin x & \quad f'''(0)=0\\ f^{(4)}(x)=\cos x & \quad f^{(4)}(0)=1 \end{align*}\]

\(\displaystyle \Rightarrow P_{4,0}(x)=1-\frac{x^2}{2!}+\frac{x^4}{4!}\)

  1. Substituting doing the substitution \(x\rightarrow 2x\) into \(P_{5,0}(x)\) from \((1)\) suggests \[\sin(2x)\approx 2x-\frac{(2x)^3}{3!}+\frac{(2x)^5}{5!}=2x-\frac{8x^3}{3!}+\frac{32x^5}{5!}\]

To verify that this does, indeed, hold we find \(P_{5,0}(x)\) of sin\((2x)\). \[\begin{align*} f(x)=\sin (2x) & \quad f(0)=0\\ f'(x)=2\cos (2x) & \quad f'(0)= 2\\ f''(x)=-4\sin (2x) & \quad f''(0)=0\\ f'''(x)=-8\cos (2x) & \quad f'''(0)=-8\\ f^{(4)}(x)=16\sin (2x) & \quad f^{(4)}(0)=0\\ f^{(5)}(x)=32\cos (2x) & \quad f^{(5)}(0)=32 \end{align*}\]

\(\displaystyle\Rightarrow P_{5,0}(x)=2x-\frac{8x^3}{3!}+\frac{32x^5}{5!}\)

  1. Multiplying \(P_{5,0}(x)\) from \((1)\) by \(x\) suggests that \[x\sin x\approx x^2-\frac{x^4}{3!}+\frac{x^6}{5!}\]

To verify that this holds, we find \(P_{6,0}(x)\) of \(x\sin x\). \[\begin{align*} f(x)=x\sin x & \quad f(0)=0\\ f'(x)=\sin x +x\cos x & \quad f'(0)=0\\ f''(x)=2\cos x-x\sin x & \quad f''(0)=2\\ f'''(x)=-3\sin x-x\cos x & \quad f'''(0)=0\\ f^{(4)}(x)=-4\cos x+x\sin x & \quad f^{(4)}(0)=-4\\ f^{(5)}(x)=5\sin x+x\cos x & \quad f^{(5)}(0)=0\\ f^{(6)}(x)=6\mathrm{cosx}-x\sin x& \quad f^{(6)}(0)=6 \end{align*}\]

\(\displaystyle\Rightarrow P_{6,0}(x)=x^2-\frac{x^4}{3!}+\frac{x^6}{5!}\)