University of Florida/Egm4313/s12.team11.gooding/R4

Jump to navigation Jump to search

Problem 4.4 Parts 1,2

Part 1

Problem Statement

Find n sufficiently high so that ${\displaystyle y_{n}(x_{1}),y'_{n}(x_{1})}$ do not differ from the numerical solution by more than ${\displaystyle 10^{-5}}$ at ${\displaystyle x_{1}=0.9}$

Solution

Using a program in MATLAB that iteratively added terms onto the taylor series of ${\displaystyle log(1+x)}$, terms were added until the error between the exact answer and the series was less than ${\displaystyle 10^{-5}}$.

It was found after trial and error that ${\displaystyle n=39}$ for the error to be of a magnitude of ${\displaystyle 10^{-5}}$. This error found was 9.7422e-005

Similarly, for ${\displaystyle y'_{n}(x_{1})}$.

It was found after trial and error that ${\displaystyle n=74}$ for the error to be of a magnitude of ${\displaystyle 10^{-5}}$. This error found was 9.3967e-005

Part 2

Problem Statement

Develop ${\displaystyle log(1+x)}$ in Taylor series about ${\displaystyle {\hat {x}}=1}$ for ${\displaystyle n=4,7,11}$ and plot these truncated series vs. the exact function.
What is now the domain of convergence by observation?

Solution

A MATLAB program was created, which calculated the Taylor series of each n value, along with the exact function, then plotted these together to show the comparison of all the series.
Below is the Taylor series for ${\displaystyle n=7}$ expanded at ${\displaystyle {\hat {x}}=1}$.
${\displaystyle {\frac {x-1}{2\,\ln \!\left(10\right)}}-{\frac {{\left(x-1\right)}^{2}}{8\,\ln \!\left(10\right)}}+{\frac {{\left(x-1\right)}^{3}}{24\,\ln \!\left(10\right)}}-{\frac {{\left(x-1\right)}^{4}}{64\,\ln \!\left(10\right)}}+{\frac {{\left(x-1\right)}^{5}}{160\,\ln \!\left(10\right)}}-{\frac {{\left(x-1\right)}^{6}}{384\,\ln \!\left(10\right)}}+{\frac {\ln \!\left(2\right)}{\ln \!\left(10\right)}}}$

It can be seen by observation that the domain of convergence has shifted to the right one unit.

--egm4313.s12.team11.gooding (talk) 03:48, 14 March 2012 (UTC)