I am using Taylor Expansion for the following problem, but for some reason I am getting wrong solutions from a program I am running it on. Can someone please help me find $f(b)$ for $b=2,3$?? Thank you so much for your time and help!
Suppose $f'(x) = \cos(x^2)$ and $f(0) = 1$. I wish to estimate $f(b)$ for the following:
$b=0 : f(b) \approx 1$
$b=1 : f(b) \approx 1.90452$
$b=2 : f(b) \approx 1.975$ (which is incorrect, and I do not understand why)
$b=3 : f(b) \approx ??$
You're just not using enough terms to get a good approximation so far away from the point that you are Taylor expanding around. Taylor expansions around $0$ are most accurate near $0$.
In the following Desmos graph the function $f(x) = 1 + \int_0^x \cos(s^2)\, \text ds$ is plotted in $\color{red}{\text{red}}$. A $\pm0.1$ tolerance region is plotted around $f$ in $\color{darkgreen}{\text{green}}$. The first 5 terms, i.e. the 4th order Taylor approximation, plotted in $\color{blue}{\text{blue}}$ leaves the green region at about $x=1.9$, which explains the bad quality of your approximation at $x=2$. If you want to approximate $f$ at $x=3$ to $0.1$ error, you will need to use at least 12 terms; this is the $\color{purple}{\text{purple}}$ graph.
,