# 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 fourer 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.

-
The other easier way could be to use Laplace Transform instead, which is more suitable for this case, if you are fine with it. also see –  user45099 Apr 29 '13 at 10:23
Actually, it is an exercise in a book that I am studying, which specifically asks to use the fourier transform method. –  ramanujan_dirac Apr 29 '13 at 10:25
@user57: please see edit. –  ramanujan_dirac Apr 29 '13 at 10:28
The Fourier transform gives you a particular solution to the DE. The total solution is going to be the sum of the particular solution and the solution to the homogeneous equation $y^{\prime \prime} - 2 y^{\prime}+y= 0$, which you would solve by ordinary methods and apply your initial conditons. –  Bitrex Apr 29 '13 at 10:57
@Bitrex: Won't the homogeneous solutions have just one constant of integration? As we don't want positive exponents. Then why are there two initial conditions? –  ramanujan_dirac Apr 29 '13 at 11:04

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_1)+\beta\,\delta(\xi-\xi_2)=\\ =-\frac{\pi}{2i}\delta(\xi-1)+\frac{\pi}{2i}\delta(\xi+1)+\alpha\,\delta(\xi-\xi_1)+\beta\,\delta(\xi-\xi_2), \end{align} where $\alpha,\beta$ are arbitrary constants and $\xi_{1,2}$ denote the two solutions 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, so in our case $\alpha=\beta=0$ and we have $$\hat{u}=-\frac{\pi}{2i}\delta(\xi-1)+\frac{\pi}{2i}\delta(\xi+1).$$ Taking the inverse Fourier trasform we get $$y(x)=\frac{1}{2\pi}\int_{-\infty}^{\infty}\hat{u}(\xi) e^{i\xi x}d\xi=-\frac{1}{4i}\int_{-\infty}^{\infty}\left[\delta(u-1)-\delta(u+1)\right] e^{i\xi x}d\xi=-\frac{e^{ix}-e^{-ix}}{4i}=-\frac{\sin x}{2}.$$ 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).
Thanks a lot for the answer. Would it work, if I solve the homogeneous differential equation separately, and then add it to inverse fourier transform that has been found out to form the general solution? So in the example that I have mentioned in the last sentence: I add $e^x(A \cos{2x}+B\sin{2x})$ to the solution obtained by the inverse fourier transform and then substitute in the initial conditions? Just want to make sure if this would work. –  ramanujan_dirac Apr 29 '13 at 11:11