Using the series representation of $\sin x$, I want to prove that:
$$\int_0^\infty e^{-x^2} \sin(x) dx = \frac{1}{2} \sum_{k=0}^\infty (-1)^k \frac{k!}{(2k+1)!}$$
My attempt: I've started by substituting $\sin$ with his power series representation:
$$\int_0^\infty e^{-x^2} \sin(x) dx = \int_0^\infty e^{-x^2} \sum_{k=0}^\infty \frac{(-1)^k x^{1+2k}}{(1+2k)!} dx \space\space\space\space\space\space\space(1)$$
I don't really know how to continue from there. It seems obvious that I also need to replace $e^{-x^2}$ with it's power series representation $\sum_{k=0}^\infty \frac{({-x^2})^k}{k!}$, but should I pull $e^{-x^2}$ into the sum that I replaced $\sin$ with, before I insert this second sum? Or should I rather keep these two sums seperate?
Either way, I'll end up with two sums. One of the theorems that I can use states that, given a sequence $f_n: \mathbb{R} \to [0, ∞]$ of measurable functions, I have that
$$\int_\mathbb{R} (\sum_{k=0}^\infty f_n) d\mu = \sum_{k=0}^\infty \int_\mathbb{R} f_n d\mu$$
So what I would want to do, is rearrange the expression $(1)$ so that I can use this theorem and pull the integral into the sum, in order to then evaluate the integral by integrating each of the $f_n$. But the problem is that $\frac{(-1)^k x^{1+2k}}{(1+2k)!}$ is negative for each odd $k \in \mathbb{N}$, and therefore, $\frac{(-1)^k x^{1+2k}}{(1+2k)!}$ isn't always $≥ 0$, as I needed to be, if I wanted to use the theorem. (And since $e^{-x^2} ≥ 0 \forall x \in \mathbb{R}$, the product of $\frac{(-1)^k x^{1+2k}}{(1+2k)!}$ and $e^{-x^2}$ would give me the same problem, would it?)
Thanks in advance.
The first step you have done is on the right track. We have $$I=\int_0^{\infty} e^{-x^2} \sin(x)dx = \int_0^{\infty} e^{-x^2} \sum_{k=0}^{\infty} \dfrac{(-1)^kx^{2k+1}}{(2k+1)!}dx$$ and using dominated convergence theorem, you can pull out the summation from the integral to obtain $$I = \sum_{k=0}^{\infty} \dfrac{(-1)^k}{(2k+1)!} \int_0^{\infty} x^{2k+1} e^{-x^2}dx$$ Setting $x^2 = t$, we obtain $2xdx = dt$, which in turn reduces the integral to $$I = \sum_{k=0}^{\infty} \dfrac{(-1)^k}{(2k+1)!}\cdot \dfrac12 \int_0^{\infty} t^{k} e^{-t}dt$$ and the integral is nothing but the Gamma function and hence $$I = \sum_{k=0}^{\infty} \dfrac{(-1)^k}{(2k+1)!}\cdot \dfrac12 \Gamma(k+1) = \dfrac12 \sum_{k=0}^{\infty}(-1)^k \dfrac{k!}{(2k+1)!}$$