# Dirac Delta Function in Differential Equation

## Homework Statement

Find the solution to:

$$\frac{d^2}{dt^2} x + \omega^2 x = \delta (t)$$

Given the initial condition that ##x=0## for ##t<0##. First find the general solution to ##t>0## and ##t<0##.

## The Attempt at a Solution

This looks like a non-homogeneous second order DE since it has the form ##ax''+bx'+cx=G(t)##. I think the general solution to this kind of DE is of the form:

$$x(t) = x_p(t)+x_c (t)$$

where xp is a particular solution of the equation, and xc is the general solution of the complementary equation ##ax''+bx'+cx=0##.

So, to find xc we can find the roots of the auxiliary equation of ##x''+\omega^2 x =0##:

$$r^2+\omega^2 = 0 \implies r=\sqrt{-\omega^2} = j \omega$$

Therefore ##x_c = c_1 e^{j \omega t}##.

Now to find xp we must solve

$$x'' + \omega^2 x = \delta(t) = \left\{\begin{matrix} 0 \ \ if \ \ t \neq 0\\ \infty \ \ if \ \ t=0 \end{matrix}\right.$$

How can we find the particular solution to this equation?

Is this the correct approach so far? How does the given initial condition factor into the calculations?

Any help is greatly appreciated.

## Answers and Replies

BvU
Homework Helper
My first association is with impulse response. See if you can do anything with that.

Physicswise, this is like a mass hanging from a spring that gets a kick (or a hammer stroke) to start oscillating up and down.

roam
Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

Find the solution to:

$$\frac{d^2}{dt^2} x + \omega^2 x = \delta (t)$$

Given the initial condition that ##x=0## for ##t<0##. First find the general solution to ##t>0## and ##t<0##.

## The Attempt at a Solution

This looks like a non-homogeneous second order DE since it has the form ##ax''+bx'+cx=G(t)##. I think the general solution to this kind of DE is of the form:

$$x(t) = x_p(t)+x_c (t)$$

where xp is a particular solution of the equation, and xc is the general solution of the complementary equation ##ax''+bx'+cx=0##.

So, to find xc we can find the roots of the auxiliary equation of ##x''+\omega^2 x =0##:

$$r^2+\omega^2 = 0 \implies r=\sqrt{-\omega^2} = j \omega$$

Therefore ##x_c = c_1 e^{j \omega t}##.

Now to find xp we must solve

$$x'' + \omega^2 x = \delta(t) = \left\{\begin{matrix} 0 \ \ if \ \ t \neq 0\\ \infty \ \ if \ \ t=0 \end{matrix}\right.$$

How can we find the particular solution to this equation?

Is this the correct approach so far? How does the given initial condition factor into the calculations?

Any help is greatly appreciated.

It is more convenient to use trig functions instead of complex exponentials, so you can write ##x = A \sin(\omega t) + B \cos(\omega t)##, but for simpler typing, I will write "##w##"instead of "##\omega##" from now on. So, you have ##x''(t) +w^2 x(t) = \delta(t)##. For ##x(t)## continuous (but not smooth) we have ##x''(t) + w^2 x(t) = 0## for ##t < 0## ant for ##t > 0##. Furthermore, integrating both sides of the DE from ##t = -\epsilon## to ##t = +\epsilon## we have
$$x'(\epsilon) - x'(-\epsilon) + w^2 \int_{-\epsilon}^{\epsilon} x(t) \, dt = 1,$$
so in the limit ##\epsilon \to 0+## we have ##x'(+0) - x'(-0) = 1## (jump condition).

So, writing
$$x(t) = \begin{cases} A_1 \sin(wt) + B_1 \cos(wt),& t < 0\\ A_2 \sin(wt) + B_2 \cos(wt),& t > 0 \end{cases}$$
we must fit ##A_1, B_1, A_2, B_2## so that ##x(t) = 0## for all ##t < 0##, ##x(-0) = x(+0)## (continuity) and ##x'(+0) - x'(-0) = 1## (jump condition).

Basically, the problem is asking you to find the so-called Green's function ##x(t) = G(t)## for the DE ##x''(t) + w^2 x(t) = f(t)##. That is a handy thing to do, because once you have found ##G## you can find a particular solution ##x_p(t)## to that DE as
$$x_p(t) = \int_{s=-\infty}^{\infty} G(t-s) f(s) \, ds$$

Last edited by a moderator:
roam
vela
Staff Emeritus
Homework Helper
$$x'' + \omega^2 x = \delta(t) = \left\{\begin{matrix} 0 \ \ if \ \ t \neq 0\\ \infty \ \ if \ \ t=0 \end{matrix}\right.$$

How can we find the particular solution to this equation?

Is this the correct approach so far? How does the given initial condition factor into the calculations?
This approach doesn't work because ##\delta(t)## isn't a normal function. Instead, you need to take the approach Ray outlined, where you find solutions in the two regions and then match them up at the boundary at ##t=0##.

Another approach would be to use Laplace transforms, which works out because of the initial condition ##x=0## for ##t<0##.

roam
Thank you Ray but how did you get "1" on the right hand side of the first equation? Because on the RHS the definite integral of zero is just 0:

$$\int^\epsilon_{-\epsilon} x'' (t) + \omega^2 x(t) \ dt = \int^\epsilon_{-\epsilon} 0 \ dt \implies x'(\epsilon) - x'(-\epsilon) + w^2 \int_{-\epsilon}^{\epsilon} x(t) = 0$$

We have x' and x'' as follows:

$$x'(t) = \begin{cases} A_1 w \cos(wt) - B_1 w \sin(wt),& t < 0\\A_2 w \cos(wt) - B_2 w \sin(wt),& t > 0 \end{cases}$$

$$x''(t) = \begin{cases} -A_1 w^2 \sin(wt) - B_1 w^2 \cos(wt),& t < 0\\-A_2 w^2 \sin(wt) - B_2 w^2 \cos(wt),& t > 0 \end{cases}$$

So, how do we work out the coefficients from here? Because as soon as I substitute into ##x''(t) + w^2 x(t) = 0## the expression cancels out. For the t<0 case:

$$\underbrace{-A_1 w^2 \sin(wt) - B_1 w^2 \cos(wt)}_{\text{x''(t)}} + w^2 \underbrace{(A_1 \sin(wt) + B_1 \cos(wt)}_{\text{x(t)}} = 0$$

Likewise for the t>0 case:

$$-A_2 w^2 \sin(wt) - B_2 w^2 \cos(wt )+ w^2 (A_2 \sin(wt) + B_2 \cos(wt)) = 0$$

So we can't really use continuity to work out the coefficients. I'm also not sure how the jump condition is used here.

P.S. We haven't covered the impulse response (Green's function) or Laplace transforms yet, so I think we are expected to solve this using the definition and properties of the Dirac Delta function (that's what we have covered so far).

Ray Vickson
Homework Helper
Dearly Missed
Thank you Ray but how did you get "1" on the right hand side of the first equation? Because on the RHS the definite integral of zero is just 0:

$$\int^\epsilon_{-\epsilon} x'' (t) + \omega^2 x(t) \ dt = \int^\epsilon_{-\epsilon} 0 \ dt \implies x'(\epsilon) - x'(-\epsilon) + w^2 \int_{-\epsilon}^{\epsilon} x(t) = 0$$

We have x' and x'' as follows:

$$x'(t) = \begin{cases} A_1 w \cos(wt) - B_1 w \sin(wt),& t < 0\\A_2 w \cos(wt) - B_2 w \sin(wt),& t > 0 \end{cases}$$

$$x''(t) = \begin{cases} -A_1 w^2 \sin(wt) - B_1 w^2 \cos(wt),& t < 0\\-A_2 w^2 \sin(wt) - B_2 w^2 \cos(wt),& t > 0 \end{cases}$$

So, how do we work out the coefficients from here? Because as soon as I substitute into ##x''(t) + w^2 x(t) = 0## the expression cancels out. For the t<0 case:

$$\underbrace{-A_1 w^2 \sin(wt) - B_1 w^2 \cos(wt)}_{\text{x''(t)}} + w^2 \underbrace{(A_1 \sin(wt) + B_1 \cos(wt)}_{\text{x(t)}} = 0$$

Likewise for the t>0 case:

$$-A_2 w^2 \sin(wt) - B_2 w^2 \cos(wt )+ w^2 (A_2 \sin(wt) + B_2 \cos(wt)) = 0$$

So we can't really use continuity to work out the coefficients. I'm also not sure how the jump condition is used here.

P.S. We haven't covered the impulse response (Green's function) or Laplace transforms yet, so I think we are expected to solve this using the definition and properties of the Dirac Delta function (that's what we have covered so far).

The integral on the right is not zero, because ##\int_{-\epsilon}^{\epsilon} \delta(t) \, dt = 1##. You did say the RHS was ##\delta(t)##, not zero. That result is using just elementary properties of ##\delta##, specifically: ##\int_I g(t) \delta(t) \, dt = g(0)## for any smooth function and any open interval ##I## that contains zero. Apply it to the function ##g(t) \equiv 1##.

Last edited:
roam
Thank you. I have another question. In your first post you said:

we must fit ##A_1, B_1, A_2, B_2## so that ##x(t) = 0## for all ##t < 0##, ##x(-0) = x(+0)## (continuity) and ##x'(+0) - x'(-0) = 1## (jump condition).

Could you please explain how exactly you evaluated the limit ##\epsilon \to 0## of ##x'(\epsilon)-x'(-\epsilon)+ \omega^2 \int^{+ \epsilon}_{-\epsilon} x(t)dt =1##?

Are we justified to ignore the ##\omega^2 \int^{+ \epsilon}_{-\epsilon} x(t)dt## term?

Anyway, if we have x'(0+)=x'(0-)=1, and x(0+)=x(0-)=0 (how do we prove this?) we can substitute to find B and A as follows:

$$x(0)=A \sin(0) + B \cos(0) \implies B =0$$

$$x'(0^+) = A \omega \cos(\omega(0)) - B \omega \sin(\omega(0)) = A \omega = 1 \implies \therefore A = \frac{1}{\omega}$$

So the DE solution has to be:

$$x(t) = \frac{1}{\omega} \sin(\omega t)$$

This solution is for t>0, the harmonic oscillator is at rest for t<0. Is that right?

Last edited:
Ray Vickson
Homework Helper
Dearly Missed
Thank you. I have another question. In your first post you said:

Could you please explain how exactly you evaluated the limit ##\epsilon \to 0## of ##x'(\epsilon)-x'(-\epsilon)+ \omega^2 \int^{+ \epsilon}_{-\epsilon} x(t)dt =1##?

Are we justified to ignore the ##\omega^2 \int^{+ \epsilon}_{-\epsilon} x(t)dt## term?

Anyway, if we have x'(0+)=x'(0-)=1, and x(0+)=x(0-)=0 (how do we prove this?) we can substitute to find B and A as follows:

$$x(0)=A \sin(0) + B \cos(0) \implies B =0$$

$$x'(0^+) = A \omega \cos(\omega(0)) - B \omega \sin(\omega(0)) = A \omega = 1 \implies \therefore A = \frac{1}{\omega}$$

So the DE solution has to be:

$$x(t) = \frac{1}{\omega} \sin(\omega t)$$

This solution is for t>0, the harmonic oscillator is at rest for t<0. Is that right?

As I said, ##x(t)## is continuous, so
$$\lim_{\epsilon \to 0} \int_{-\epsilon}^{\epsilon} x(t) \, dt = 0$$

roam
vela
Staff Emeritus
Homework Helper
$$x(t) = \frac{1}{\omega} \sin(\omega t)$$