Given the integral
$$\int_0^1 \frac{\sin(x)}{x}dx$$
I have to find the value of the integral with an accuracy better than $10^{-4}$, however, I am pretty lost.
I am given a hint saying that I should replace $\sin(x)$ with the Taylor polynomium of order $2n$ and evaluate the remainder $Rnf(x)$. I know that the Taylor series is given by $$ \sum_{n=1}^\infty \frac{f^{(n)}(x_0)}{n!}(x-x_0)^n $$ so by replacing with $2n$ we have $$ \sum_{n=1}^\infty \frac{f^{(2n)}(x_0)}{2n!}(x-x_0)^{2n} $$ but am I really expected to calculate this? And if so how would I even do this?
Can you help me in the right direction? Thanks in advance.
We know that the Taylor Series for $\sin x$ is $$ \sin x = \sum_{n=0}^\infty (-1)^n \dfrac{x^{2n+1}}{(2n+1)!} $$ Then the Taylor Series for $\dfrac{\sin x}{x}$ is $$ \dfrac{\sum_{n=0}^\infty (-1)^n \dfrac{x^{2n+1}}{(2n+1)!}}{x} = \sum_{n=0}^\infty (-1)^n \dfrac{x^{2n}}{(2n+1)!} $$ Then we have $$ \begin{aligned} \int_0^1 \dfrac{\sin x}{x} \;dx&= \int_0^1 \sum_{n=0}^\infty (-1)^n \dfrac{x^{2n}}{(2n+1)!} \;dx \\ &=\sum_{n=0}^\infty \int_0^1 (-1)^n \dfrac{x^{2n}}{(2n+1)!} \;dx \\ &= \sum_{n=0}^\infty (-1)^n \dfrac{x^{2n+1}}{(2n+1)(2n+1)!} \bigg|_0^1 \\ &= \sum_{n=0}^\infty \dfrac{(-1)^{n}}{(2n+1)(2n+1)!} \end{aligned} $$ But this is an Alternating Series so the error in summing the first $k$ terms (compared to the final infinity sum) is at most the magnitude of the $k+1$ term. You want the error to be at most $10^{-4}=0.0001$. So you just want a $k$ so that $$ \bigg|\dfrac{(-1)^{n}}{(2k+1)(2k+1)!}\bigg| < 0.0001 $$ Trying a few terms we find that $k=3$ works. So we need only sum $$ \sum_{n=0}^{2} \dfrac{(-1)^{n}}{(2n+1)(2n+1)!}= 1-\dfrac{1}{18}+\dfrac{1}{600} \approx 0.946111 $$ We can check this as $$ \int_0^1 \dfrac{\sin x}{x} \;dx \approx 0.9460830703671841 $$ Note that I used the properties of Alternating Series, but here this is equivalent to using Taylor's Remainder Theorem, that if you only sum the first $k$ terms of a convergent Taylor Series, the magnitude error in the sum is at most $$ M \dfrac{R^{k+1}}{(k+1)!} $$ where $R$ is the distance from the center you chose for the Taylor Series and the point you are evaluating at and $M$ is a bound on your derivative, i.e. if you are using the Taylor Series centered at $x=a$ and you are evaluating the series at $x=b$, then $R= |b-a|$ and $M$ is a number so that $|f^{(k+1)}(x)| \leq M$ for all $x$ between $a$ and $b$.