how to regularize $ \int_{-\infty}^\infty x \sin x \, dx $? In a physics problem I am confronted with a divergent integral
$$  \int_{-\infty}^\infty  x \sin x \, dx 
= 
 \sin x -
x \cos x 
\bigg|_{-\infty}^\infty   \approx 0$$

How to regularize it?

in order to regularize this sum I would argue this is zero. another possibility is 
$$  \int_{-L}^L  x \sin x \, dx = 
 \sin x -
x \cos x 
\bigg|_{-L}^L  = 2(  \sin L -
L\cos L)$$
which is oscillating.   if $L \in 2 \pi \mathbb{  Z  }$ the integral is $\int = \pm L$ if  $L \in \pi/2+ 2 \pi \mathbb{  Z  }$  then $\int = \pm 2$.
so even if this integral is oscillatory maybe theory of distributions can save us.
 A: Since the integrand is even, consider $\int_0^\infty x \sin x \, dx $. For this integral there's a convenient regularization: multiply the integrand by $e^{-cx}$ where $c>0$. This integrates without much work (write $\sin x = (e^{ix}-e^{-ix})/(2i)$, then integrate $xe^{ax}$ by parts, and simplify). The antiderivative is 
$$
- \frac{e^{-cx}}{\left(c^{2} + 1\right)^{2}} \left((c^{3} x+cx+c^2-1) \sin x + (c^{2} x +x + 2 c)\cos x \right)
$$
so the integral from $0$ to $\infty $ is 
$$\frac{2c}{(c^2+1)^2}$$
and this tends to $0$ as $c\to 0$. 
A: Suppose we replace the integrand by an even function $f(x,p)$ such that $f(x,0) = x\sin(x)$, and suppose that the series expansion coefficients of the expansion of $f(x,p)$ around $x = 0$ tends to those of $x\sin(x)$ for $p$ to zero uniformly. Then if $\int_0^\infty f(x,p)dx$ exists for $p>0$, then Glaisher's theorem says that:
$$\int_0^{\infty}f(x,p)dx = \frac{\pi}{2}c_{-\frac{1}{2}}(p)$$
where for integer $n$, $c_n(p)$ is the coefficient of $(-1)^nx^{2n}$ in the series expansion of $f(x,p)$ around zero. For fractional $n$ the $c_n$ are defined using analytic continuation. We can then define the regularized integral by taking the limit of $p$ to zero in the above expression, this then doesn't depend on the regularization method is the series coefficients tend to those of the original integrand uniformly. In this case, one then finds that the integral is given as $\frac{\pi}{2 (-2)!} = 0$.
