# Solve a very simple second order ODE using Laplace Transforms. (5.4-9)

My question is where did I go wrong? I cannot seem to duplicate the answer given in text.

The Problem: Solve the following differential equation using Laplace Transforms given that $y(0)=0$, $y'(0)=0$, $r(t)=sin(2t)$ on the interval $(0<t<\pi)$. The value of the function $r(t)$ is zero everywhere else.

$$y''+y=r(t)$$

My solution:

Express our problem using the unit step function...

$$y''+y=sin(2t)u(t)-sin(2t)u(t-\pi)$$

Taking Laplace transforms renders the following subsidiary equation...

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

Solving for Y...

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

We now need to decompose each of the two terms into partial fractions...

An online calculator was used for this. It can be found here.

$$Y= \left[\frac{2}{3(s^2+1)}-\frac{2}{3(s^2+4)}\right]_1-\left[-\frac{2s}{3(s^2+1)}+\frac{s}{6(s^2+4)}+\frac{1}{2s}\right]_2\cdot e^{-\pi s}$$

We can now take inverse Laplace Transforms but being careful to keep all terms within their original brackets...

$$y(t)= \left[\frac{2}{3}sin(t)-\frac{1}{3}sin(2t)\right]_1-\left[-\frac{2}{3}cos(t-\pi)+\frac{1}{12}cos(2(t-\pi))+\frac{1}{2}u(t-\pi)\right]_2$$

We can now simplify some of the terms in bracket $2$...

$$y(t)= \left[\frac{2}{3}sin(t)-\frac{1}{3}sin(2t)\right]_1-\left[\frac{2}{3}cos(t)-\frac{1}{12}cos(2t)+\frac{1}{2}\right]_2$$

The answers:

When $0<t<\pi$ we have the terms in bracket $1$...

$$y(t)=\frac{2}{3}sin(t)-\frac{1}{3}sin(2t)$$

When $t>\pi$ we have the terms in bracket $1$ minus bracket 2...

$$y(t)=\frac{2}{3}sin(t)-\frac{1}{3}sin(2t)-\frac{2}{3}cos(t)+\frac{1}{12}cos(2t)-\frac{1}{2}$$

The answer in text:

When $0<t<\pi$ the text has the following which agrees with my solution for this part of the problem...

$$y(t)=\frac{2}{3}sin(t)-\frac{1}{3}sin(2t)$$

When $t>\pi$ the text has the following which DOES NOT agree with my solution for this part of the problem...

$$y(t)=\frac{4}{3}sin(t)$$

My question:

What did I do wrong and how can I fix it?

• What is your independent variable, $x$ or $t$? – Ron Gordon Feb 9 '15 at 13:05
• My interdependent variable is t not x. It was made an x by mistake. – Jules Manson Feb 9 '15 at 15:23

## 1 Answer

The calculation of the Laplace transform of $r$ is wrong: the Laplace transform of a product is not the product of the Laplace transforms. $$(\mathcal{L}r)(x)=\int_0^\pi e^{-sx}\sin(2\,x)\,dx=\frac{2-2\,e^{-\pi s}}{4+s^2}.$$

• Thank you for the help but I am still left with a few questions. 1. Based on the interval given for r(t) was my setup correct? Here it is again: $y''+y=sin(2t)u(t)-sin(2t)u(t-2\pi)$ on the interval $(0<t<2\pi)$ 2. How could I have found the Laplace transform of r(t) using the traditional convenient methods provided by the unit step function? In other words without having to resort to the definition (integral formula) of the transform? – Jules Manson Feb 9 '15 at 15:21
• Your setup is correct. You could use the properties of the Laplace transform and convolution, but the computations would be more involved. – Julián Aguirre Feb 9 '15 at 15:44
• Thank you again for your help. I think I figured it out. I did not have the functions properly windowed or shifted properly for taking the Laplace transforms of a sine when combined with unit step functions. I guess I got the methodology for that confused with that for constant terms when combined with unit steps. – Jules Manson Feb 9 '15 at 18:53