Evaluating Diverging Integral? I'm looking at:
$$\int_{-\infty}^\infty \sin(2cx)\frac{1-2x^2-\cos(2x)}{2x^3}dx$$
How come this converges for $c \in \mathbb{R}$? And how does mathematica compute it as:
$$\frac{\pi  \left(-2 \left(c^2+1\right) \left| c\right| +(c-1) c \left| c-1\right| +c (c+1)
   \left| c+1\right| \right)}{2 c}$$
 A: First, the convergence analysis:


*

*Observe that for $x$ small we have $1 - 2x^2 - \cos(2x) = O(x^4)$, and so the integral is not singular near the origin. 

*When $|x|$ is large, the integral $\displaystyle \int\sin(2cx) \frac{1 - \cos(2x)}{2x^3} dx$ is absolutely integrable. 

*The remaining term is $\displaystyle \int \frac{\sin(2cx)}{x} dx$ which rescales to the well-known sinc integral. 


To evaluate the integral $\displaystyle \int \sin(2cx) \frac{1 - \cos(2x)}{2x^3} dx$ observe that since the function is even we can write it as
$$ 2 \lim_{a \to 0^+} \lim_{b \to \infty} \int_a^b \frac{\sin(2cx)}{2x^3} - \frac{\sin(2cx + 2x) + \sin(2cx - 2x)}{4x^3} dx $$
Integrating by parts we have that 
$$ \int \frac{\sin(2Ax)}{2x^3} dx = - \frac{\sin(2Ax)}{x^2} + 2A \int \frac{\cos(2Ax)}{x^2} dx \\= - \frac{\sin(2Ax)}{x^2} - 2A \frac{\cos(2Ax)}{x} + (2A)^2 \int \frac{\sin(2Ax)}{x} ~dx $$
Doing some algebra we are essentially down to looking at
$$ \lim_{a \to 0^+}  \frac{\sin(2ca)}{a^2} + 2c \frac{\cos(2ca)}{a} - \frac{\sin(2(c+1)a)}{2a^2} - (c+1) \frac{\cos(2(c+1)a)}{a} - \frac{\sin(2(c-1)a)}{2a^2} - (c-1) \frac{\cos(2(c-1)a)}{a} $$
plus a bunch of sinc integrals. This limit can be evaluated using L'Hospital's rule to yield zero. 
This means that the original integral can be simplified as the sum of a bunch of sinc integrals. 
