0

I am asked to approximate $\displaystyle\int_{-1/2}^{1/2}\cosh(x^2)dx$ with an error less than $\frac{1}{1000}$. I know so far that $\displaystyle\cosh(x) = \displaystyle\sum_{i=0}^{\infty} \dfrac{i^{2n}}{2n!}x^{2n}$ and I can approximate values of $\cosh(x)$ with an error as small as I want to. I know that to approximate the integral I must integrate the series I found but I don't really know at what point I should stop it.

mrtaurho
  • 16,663
McNuggets666
  • 1,613
  • I am not sure about your Taylor series for $\cosh(x)$ since your are using the variable $n$ for the power of $x$ as well as for the factorial. Your actual index $i$ is only used as $i^{2n}$. I would guess that you meant to write $$\cosh(x)=\sum_{n=0}^{\infty}\frac{x^{2n}}{(2n)!}$$ Even by considering the $i$ as imaginary unit your expansion would equal the cosine series and not the hyperbolic cosine as you claimed. For this purpose you have to use the identity $$\cos(ix)=\cosh(x)\text{ and therefore }\sum_{n=0}^{\infty}(-1)^n\frac{(ix)^{2n}}{(2n)!}$$ in order to obtain the right expansion. – mrtaurho Nov 16 '18 at 16:04

1 Answers1

1

Here is a way to bound $M$. First note that$$\cosh x^2=\sum_{n=0}^{\infty}{x^{4n}\over 2n!}$$therefore$$I=\int_{-1\over 2}^{1\over 2}\cosh x^2dx=2\int_{0}^{1\over 2}\cosh x^2dx=2\int_{0}^{1\over 2}\sum_{n=0}^{\infty}{x^{4n}\over 2n!}dx=2\sum_{n=0}^{\infty}{\left({1\over 2}\right)^{4n+1}\over 2n!(4n+1)}$$if we approximate the integral up to $M$ terms we have:$$\hat I=2\sum_{n=0}^{M}{\left({1\over 2}\right)^{4n+1}\over 2n!(4n+1)}$$therefore the approximation error would become:$$|I-\hat I|=2\sum_{n=M+1}^{\infty}{\left({1\over 2}\right)^{4n+1}\over 2n!(4n+1)}<\sum_{n=M+1}^{\infty}\left({1\over 2}\right)^{4n}={1\over 15}\left({1\over 16}\right)^{M}$$if we wish to have the error below $0.001$ we should have:$${1\over 15}\left({1\over 16}\right)^{M}<0.001$$or equivalently $$M=2$$

Mostafa Ayaz
  • 33,056