# Homework Help: Differential Equation with unit step function and Laplace transforms

1. Apr 15, 2013

### Mangoes

EDIT:

Nevermind I see what I did wrong near the end.

1. The problem statement, all variables and given/known data

$$x'' + 4x = f(t)$$

Where f(t) is 1 if t is between 0 and π, 0 if t > π. Initial conditions are x(0) = x'(0) = 0.

2. Relevant equations

Transform of a derivative:
$$L(f^{(n)}(t)) = s^nF(s) - s^{n-1}f(0) -...-f^{n-1}(0)$$

Transform of unit step function:
$$L(u(t-a)) = \frac{e^{-as}}{s}$$

3. The attempt at a solution

Letting u(t) be the step function, I wrote:

$$f(t) = 1 - u(t - π)$$

So I rewrote the equation as

$$x'' + 4x = 1 - u(t - π)$$

To take the Laplace transform of the left side, I used the transform of a derivative. Since the initial conditions are 0, the transform simplifies quite a bit. For the right side of the equation, I had to use the transform of the unit step function and the transform of 1.

$$s^2X(s) + 4X(s) = \frac{1}{s} - \frac{e^{-πs}}{s}$$

Factored and moved around a bit to get:

$$X(s)(s^2 + 4) = \frac{1}{s}(1 - e^{-πs})$$

$$X(s) = \frac{1 - e^{-πs}}{(s)(s^2 + 4)}$$

$$X(s) = \frac{1}{s(s^2 + 4)} - \frac{e^{-πs}}{s(s^2 + 4)}$$

At this point I had a choice to do either a convolution or use partial fractions. Since I hate partial fractions, I went for a convolution, but it didn't work out and I had to end up using partial fractions.

Making up a new name:

$$G(s) = \frac{1}{s(s^2 + 4)}$$

I used partial fractions and got this:

$$G(s) = \frac{1}{4s} - \frac{s}{4(s^2 + 4)}$$

With the above I can easily do the inverse Laplace transform of the first term in X(s). But for the second term, I wanted to use the fact that

$$u(t-a)f(t-a) = e^{-as}F(s)$$

where a = π and F(s) would be the same as G(s). The inverse Laplace transform of G(s) is

$$4 - \frac{1}{4}cos(2t)$$

And by just following the fact I just mentioned above, I would think that the Laplace transform of the second term in X(s) would be:

$$u(t - π)(4 - \frac{1}{4}cos(2(t - π))$$

cos(2t - 2pi) simplifies to cos(2t) due to periodicity of cosine.

So finally my final answer would be

$$f(t) = 4 - \frac{1}{4}cos(2t) - u(t - π)(4 - \frac{1}{4}cos(2t))$$

When I checked the answers, my answer was a little off. Normally, this really wouldn't bother me too much because there's a very good chance I made a small error somewhere, but I'm not too used to doing questions like these and I was wondering if anyone could find a really obvious glaring error the procedure I did. I have an exam tomorrow and it would be nice to make sure.

Last edited: Apr 15, 2013