0

I need to evaluate the following integral $$\int_0^1 sin(x^2) /(x) \,dx$$ with precision of $0.00000003$ ,meaning the remainder is bounded by that number.

my attempt: substitute $x^2$ = t, and the integral transforms into: $\int_0^1 sin(t) /(2t) \,dx$ now observe that we can substitute the integrad with its taylor expansion (to avoid getting into complex valued functions) which is $\sum_{i=1}^{\infty} (-1)^{n}x^{2n}/(2n+1)!$ since the integrad converges uniformly (this is given), we can perform "term by term" integration, or exchange the sum and the integral which in turn gives us a polynomial of degree 2n+1 which we can evaluate between 0 and 1 easily by N.L.

Now for the tricky part: if the remainder of order m is defined to be:

$\sum_{i=1}^{\infty} (-1)^{n}x^{2n+1}/(2n+1)(2n+1)!$ - $\sum_{i=1}^{m} (-1)^{n}x^{2n+1}/(2n+1)(2n+1)!$

It seems like i can start calculating the first few terms of the taylor expansion and keep going until I'm within the desired precision?

And secondly, the title question, how do I know if the value i get from summing the first m terms is larger or smaller than the actual value of the original integral?

Noam
  • 381

1 Answers1

0

$$\frac{\sin \left(x^2\right)}{x}=\sum_{n=0}^p (-1)^n \frac {x^{4n+1}}{(2n+1)!}+\sum_{n=p+1}^\infty (-1)^n \frac {x^{4n+1}}{(2n+1)!}$$ So, for $$\int_0^1\frac{\sin \left(x^2\right)}{x}\,dx$$ the remainder is $$R_p=\frac{1}{2 (2 p+3) (2 p+3)!}$$ what you want to be smaller than $\epsilon$. That is to say that you look for $p$ such that $$2 (2p+4)! > 2 (2 p+3) (2 p+3)! \geq \frac 1 \epsilon$$ Now, have a look at the superb approximation @Gary gave for the inverse of the factorial function.

Applied to your case, this will give $$2p+4 \sim \frac{\log \left(\frac{1}{2 \epsilon \sqrt{2 \pi } }\right)}{W\left(\frac{1}{e}\log \left(\frac{1}{2 \epsilon\sqrt{2 \pi } }\right)\right)}-\frac 12$$ Using your number $\epsilon=3\times 10^{-8}$, this gives, as a real, $p=3.31928$ then use $p=4$.

To give you an idea of the accuracy, the exact solution for the exact remainder is $p=3.34043$.

Just checking $$R_3=\frac{1}{6531840}=1.531\times 10^{-7}$$ $$R_4=\frac{1}{878169600}=1.139\times 10^{-9}$$