Solving an initial value ODE problem using Fourier transform I am a physics undergrad and studying some transform methods.
The question is as follows:
$$y^{\prime \prime} - 2 y^{\prime}+y=\cos{x}\,\,\,\,y(0)=y^{\prime}(0)=0\,\,\, x>0$$
I am having some confusing doing this using Fourier transforms. I took the transform of the entire equations after which i got
$\hat{u}=\frac{\mathcal{F}(\cos{x})}{-\xi^2 -2i \xi +1}$, where $\xi$ is the variable of the Fourier transform of the solution.
The solution of the ODE is $$\mathcal{F}^{-1}=\cos{x} \star \mathcal{F}^{-1}(\frac{1}{-\xi^2 -2i \xi +1})$$ where I have used the fact, that the inverse Fourier transform of the product is the convolution. How do I find the inverse transform of the second factor? I know the method of using complex contour integral, and using the residue theorem. Is this the only way? Is there any shorter way in which I can reduce it to the inverse transform of some other function?
After calculating the convolution, what do I do? As far as I can see, the problem ends here, but where do I apply the initial condition?
EDIT: The source of this problem specifically asks to do it using the Fourier transform method. I have been unable to to solve similiar problems e.g. $$(D^2-2D+5)y=xe^{2x}\,\,\,y(0)=y^{\prime}(0)=0\,,x>0~.$$ I am utterly confused as to what to do with the initial conditions.
 A: Using Fourier transform to solve such kind of equations is rather non-standard (Laplace transform would work in a simpler way) but possible. It goes as follows.
Applying  Fourier transform to the left side of the equation, one finds $\left(-\xi^2-2i\xi+1\right)\hat{u}$, as you wrote above. Applying it to the right, we get
$$\mathcal{F}(\cos(x))=\int_{-\infty}^{\infty}e^{-i\xi x}\cos x\,dx=\frac12\int_{-\infty}^{\infty}\left(e^{-i(\xi-1) x}+e^{-i(\xi+1) x}\right)dx=\frac12\left[2\pi\delta(\xi-1)+2\pi\delta(\xi+1)\right],$$
where $\delta(x)$ denotes Dirac delta function. We then obtain the equation
$$ \left(-\xi^2-2i\xi+1\right)\hat{u}=\pi\left[\delta(\xi-1)+\delta(\xi+1)\right].$$
Its solution is given by
\begin{align} \hat{u}=\frac{\pi\left[\delta(\xi-1)+\delta(\xi+1)\right]}{-\xi^2-2i\xi+1}+\alpha\,\delta(\xi-\xi_0)+\beta\,\delta'(\xi-\xi_0)=\\
=-\frac{\pi}{2i}\delta(\xi-1)+\frac{\pi}{2i}\delta(\xi+1)+\alpha\,\delta(\xi-\xi_0)+\beta\,\delta'(\xi-\xi_0),
\end{align}
where $\alpha,\beta$ are arbitrary constants and $\xi_{0}=-i$ denotes the double root of the characteristic equation $-\xi^2-2i\xi+1=0$. We used that $\delta(x)$ vanishes outside $x=0$. I especially draw your attention to the last two terms (you should think on why and how do they appear). They represent the general solution of the homogeneous equation.
Taking the inverse Fourier trasform we get
\begin{align} y(x)=&\frac{1}{2\pi}\int_{-\infty}^{\infty}\hat{u}(\xi) e^{i\xi x}d\xi=\\=&\int_{-\infty}^{\infty}\left[\frac{\alpha\,\delta(\xi-\xi_0)+\beta\,\delta'(\xi-\xi_0)}{2\pi}-\frac{\delta(u-1)-\delta(u+1)}{4i}\right] e^{i\xi x}d\xi=\\=&\frac{\alpha\,e^{i\xi_0 x}- i \beta x\,e^{i\xi_0 x}}{2\pi}-\frac{e^{ix}-e^{-ix}}{4i}.
\end{align}
Applying the initial conditions, we find that $\alpha=0$ and $\beta=\pi i$, so that
$$y(x)=\frac12\left(xe^{-x}-\sin x\right).$$
So we indeed find the solution of our problem, but it is clear that Fourier is not the most efficient method here (one already should know something about distributions).
A: we can't use Fourier transform because we need that the solution vanished at +-\infty.
Since we have (IVP), then the right method is to use Laplace Transform. You can also use the undetermined Coefficient method because the equation is linear and the its coefficients are constant and the second member is the form exponential*\cosine.
best regards, 
