# 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. – user23238 Apr 29 '13 at 10:25
• @user57: please see edit. – user23238 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? – user23238 Apr 29 '13 at 11:04

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).

• 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. – user23238 Apr 29 '13 at 11:11
• Yes, that would work. – Start wearing purple Apr 29 '13 at 11:14
• @O.L.: (1) The last two terms " represent the general solution of the homogeneous equation, so in our case α=β=0." I don't understand why "α=β=0", i.e. why there should not be the general solution of the homogeneous equation in the solution? (2) I don't see how the initial conditions are used in the method by Fourier transform. Does the method by Fourier transform solve an ODE with or without its initial conditions? – Tim Feb 17 '14 at 17:28
• +1. Very nice answer. I like very much those solutions that involve the Dirac Delta function. – Felix Marin Dec 29 '14 at 7:51
• a.elkhali left a comment: "In the answer of O.L the solution is false because $y'(x) = -\cos(x)/2$ and then $y'(0)=-1/2 \neq 0$". – user147263 Dec 29 '14 at 8:16

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,