Solving linear differential equation with Fourier transform I want to solve $$y''(x)+2y'(x)+y(x)=f(x)$$ for $y(x)$ with the Fourier transform. $f$ is from Schwartz space.
EDIT: I removed my old incorrect derivation and gave a correct answer below. - This equation can be solved easier using integrating factors. - Thanks to Physicist137 for the help!
 A: I finally got some time. Here is the correct full answer using the following definition of the Fourier-transform  $\mathcal{F}(y(x))$ for a function  $y(x)$ $$\mathcal{F}(y(x))(k):=\frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}}y(x)e^{-ikx} dx.$$
FT is linear so $$ \mathcal{F}(y''+2y'+y)=\mathcal{F}(f)$$
$$\Rightarrow\mathcal{F}(y'')+2\mathcal{F}(y')+\mathcal{F}(y)=\mathcal{F}(f).$$
With the property $\mathcal{F}(y')=ik\mathcal{F}(y)$ the equation turns into
$$(-k^2+2ik+1)\mathcal{F}(y)=-(k-i)^2\mathcal{F}(y)=\mathcal{F}(f).$$
To make things more compact let's define
$$\mathcal{F}(y)=\frac{-1}{(k-i)^2}\mathcal{F}(f)=:\mathcal{F}(h)\mathcal{F}(f),$$
assuming that $h(x)$ exists.
Using the convolution theorem, we obtain
 $$\mathcal{F}(y)=\mathcal{F}(h)\mathcal{F}(f)=\mathcal{F} (h* f).
$$
Using inverse FT we get 
$$y(x)=(h* f)(x)$$
Now, let's solve the integral 
$$h(x)=\frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}}\mathcal{F}(h(x))(k)e^{ikx} dk=\frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}}\frac{-1}{(k-i)^2}e^{ikx} dk$$
Here we have to be careful what $x\in \mathbb{R}$  we put into that integral but more about that later. Solving this real integral using the residue theorem is quite nice. In order to be able to do that, we need a complex function and a closed path on the complex plane.
Let's make another definition 
$$ \mathcal{F}(h(x))(\alpha):=\tilde{h}(\alpha), \quad \text{for}\quad \alpha\in \mathbb{K}. $$
For clarification: $\tilde{h}(k)$ is the function $\tilde{h}$ with a real input $k$ and $\tilde{h}(z)$ is the same function with a complex input $z$.
Now, $\tilde{h}(z)$ has a singularity of second order at $z=i$ and analytic everywhere else in $\mathbb{C}$. This is our complex function for the residue theorem. Let the closed path be $\gamma$, the upper half of a circle with radius $R$ and center located at the origin of the complex plane and the interval (-R,R). Let the orientation of $\gamma$ be positive, i.e. it goes from $-R$ to $R$ then from $R$ to $iR$ on a quater circle and from $iR$ to $-R$ on a quater circle. The circle part of $\gamma$ I will call $\gamma '$. $\gamma ' $ has the same oriention as $\gamma.$ When we let $R\rightarrow\infty,$ we get
\begin{equation}
\lim_{R\rightarrow\infty}\oint_{\gamma} \tilde{h}(z) e^{izx}dz=\lim_{R\rightarrow\infty}\left(\int_{-R}^R \tilde{h}(k) e^{ikx}dk+\int_{\gamma '}\tilde{h}(z)e^{izx}dz\right).
\label{one}
\tag{1}
\end{equation}
Assuming that 
$$
\lim_{R\rightarrow\infty}\int_{-R}^R \tilde{h}(k) e^{ikx}dk=\int_{\mathbb{R}} \tilde{h}(k) e^{ikx}dk, \tag{*}\label{star}
$$
we just have to calculte the two complex integrals and set the result equal the real integral. - With the residue theorem we get that, for any $R>1$
$$
\oint_{\gamma} \tilde{h}(z) e^{izx}dz=\oint_{\gamma} \frac{-1}{(z-i)^2}  e^{izx}dz=2\pi i\cdot \mathrm{Res}\left(\tilde{h}(z) e^{izx},i\right)=
$$
$$
2\pi i \cdot\lim_{z\rightarrow i}\frac{d}{dz}\left((z-i)^2 \frac{-1}{(z-i)^2}  e^{izx}\right)=2\pi i \cdot\lim_{z\rightarrow i}\left(-ixe^{izx} \right)=2\pi x e^{-x}.
$$
$R>1$ otherwise the singularity at $z=i$ would not be included and the value of the integral would be zero.
Let's now look at the second complex inegral
$$
\lim_{R\rightarrow\infty}\int_{\gamma '}\tilde{h}(z)e^{izx}dz.
$$
If we look at the absolute value as $R\rightarrow \infty$
$$
\lim_{R\rightarrow\infty}\left| \int_{\gamma '}\tilde{h}(z)e^{izx}dz\right|\leq\lim_{R\rightarrow\infty}\mathrm{max}\left| \tilde{h}(z)e^{izx}\right|\pi R=\lim_{R\rightarrow\infty}\mathrm{max}\left| \frac{-1}{(z-i)^2}e^{iax}e^{-bx}\right|\pi R=\lim_{R\rightarrow\infty}\mathrm{max}\left( \frac{1}{\sqrt{R^4+...}}|e^{iax}|e^{-bx}\right)\pi R.
$$
The $...$ is non negative.
Now we understand why we had to be careful what x to put in! In this case we are in the upper half of the semi circle, i.e. $z=a+bi$ with $|z|=R$ where $a\in \mathbb{R}$ and $b\in \mathbb{R^+}.$ That means the limit is only zero if $x\geq 0.$
From \eqref{star} we get that \eqref{one} is 
$$
2\pi x e^{-x}=\int_{\mathbb{R}} \tilde{h}(k) e^{ikx}dk \quad \forall x\geq 0
$$
This means that $$
h(x)=\sqrt{2\pi} x e^{-x} \quad\forall x\geq 0
$$
To find out what h(x) is $\forall x<0$ we can give a very simliar argument. We integrate the lower half of the semi circle with the $(-R,R)$ real segment where $\gamma$ and $\gamma '$ have both negative orientation. Then we would get 
$$
h(x)=0 \quad \forall x\leq 0
$$ 
So finally this gives us 
$$
h(x)=\sqrt{2\pi} x e^{-x}\theta(x),
$$
where $\theta(x)$ is the Heaviside step function and
$$
y(x)=(h*f)(x)=\frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}}f(\alpha)h(x-\alpha) d\alpha=\int_{-\infty}^x f(\alpha)(x-\alpha)e^{\alpha -x}d\alpha.
$$
Thanks to Physicist137 for the hint!
Note: This is not the way I would have solved this equation. It is much easier to solve via the method of integrating factor. (sorry I can only post two links it seems..)
A: Well... Apparently you have took the longer way in almost all steps. =(. Anyway.. the problem is the residue. You computed it wrong.
Notice:
$$
(z-i) = -i(iz+1) = -i(1+iz) \quad\implies\quad
(z-i)^2 = (1+iz)^2
$$
Therefore: $(z-i)^2 f(z) = e^{ixz}$. So, the residue is its derivative:
$$
Res\{f(z), i\} = \frac{d}{dz}\left[(z-i)^2 f(z)\right]_{z=i}
= \frac{d}{dz}\left[e^{ixz}\right]_{z=i}
= \left[ix e^{ixz}\right]_{z=i}
= ix e^{-x}
$$
As you can see we don't have the minus sign. Thus inverse fourier transform is actually $-\sqrt{2\pi}x e^{-x}$.
About the interval.. I don't quite know. It has definitly something to do about convergence of the fourier transform of the function $-\sqrt{2\pi}x e^{-x}$.
