Calculus – How to Compute Integral of sin(x)/x^2 Sum of sin(nx)/n!

calculusintegration

$$\int_{0} ^{\infty} \frac{\sin(x)}{x^2}\sum_{n=1}^{\infty}\frac{\sin(nx)}{n!}\,dx$$
I know that the sum definitely converges, and WolframAlpha gives the function

$$\sin(\sin(x))e^{\cos(x)}$$
for the closed form of the sum.

I have no idea how I can get to here, though. I have tried moving in the $\frac{\sin(x)}{x^2}$ into the sum, and using a product-to-sum formula, and moving the sum outside the integral but that got me nowhere. I have also tried to expand out the series in an attempt to find a pattern that looks familiar, which also ended with nothing. Maybe my knowledge of math is just insufficient, but I am really quite lost here. I've mainly tried to simplify the integrand, haven't tried any actual integration yet.

Thanks in advance.

Best Answer

The following is a generalization.

Let $f(z)$ be any function that has a Maclaurin series expansion that has a radius of convergence greater than $1$.

Then for $a>0$ we have

$ \begin{align} \frac{1}{2i}\int_{0}^{\infty} \frac{\sin(x)}{x^{2}+a^{2}} \left(f(e^{ix})-f(e^{-ix}) \right) \, \mathrm dx &=\int_{0}^{\infty} \frac{\sin(x)}{x^{2}+a^{2}} \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} \sin(nx) \, \mathrm dx \\ &= \int_{0}^{\infty} \frac{\sin(x)}{x^{2}+a^{2}} \sum_{n=\color{red}{1}}^{\infty} \frac{f^{(n)}(0)}{n!} \sin(nx) \, \mathrm dx \\ &= \sum_{n=1}^{\infty} \frac{f^{(n)}(0)}{n!} \int_{0}^{\infty} \frac{\sin(x)\sin(nx)}{x^{2}+a^{2}} \, \mathrm dx \\ &= \sum_{n=1}^{\infty} \frac{f^{(n)}(0)}{n!} \frac{1}{2}\int_{0}^{\infty} \frac{\cos\left((n-1)x\right)- \cos \left((n+1)x \right)}{x^{2}+a^{2}} \, \mathrm dx \\ &\overset{\spadesuit}{=} \frac{1}{2}\sum_{n=1}^{\infty} \frac{f^{(n)}(0)}{n!} \left(\frac{\pi}{2a}e^{-(n-1)a}-\frac{\pi}{2a}e^{-(n+1)a} \right) \\ &= \frac{\pi}{4a} \left(e^{a}-e^{-a} \right)\sum_{n=1}^{\infty} \frac{f^{(n)}(0)}{n!}e^{-na} \\ &= \frac{\pi \sinh (a)}{2a} \left(f(e^{-a})-f(0) \right). \end{align}$

Taking the limit as $a \to 0^{+}$, we get $$\begin{align} \frac{1}{2i}\int_{0}^{\infty} \frac{\sin(x)}{x^{2}} \left(f(e^{ix})-f(e^{-ix}) \right) \, \mathrm dx &= \int_{0}^{\infty} \frac{\sin (x)}{x^{2}} \sum_{n=1}^{\infty} \frac{f^{(n)}(0)}{n!} \sin(nx) \, \mathrm dx \\ &= \frac{\pi}{2} \left(f(1)-f(0) \right). \end{align}$$

Your integral is the case $f(z) = e^{z}$.


$\spadesuit$ Calculating the integral $\int_0^\infty \frac{\cos x}{1+x^2}\, \mathrm{d}x$ without using complex analysis


For a particular function and a particular value of $a$, Wolfram Alpha either returns a lousy approximation or needs more computation time.

To get an approximation that is correct to at least a few digits after the decimal point, make the upper limit somewhat large, and tell Wolfram Alpha to use the midpoint method with as many intervals that it can handle without timing out.

For example, see here and here.

Related Question