# Math Help - Solving a nonhomogeneous second order ODE using Laplace transform

1. ## Solving a nonhomogeneous second order ODE using Laplace transform

$y'' - 2y' + 2y = cost; \, y(0) = 1, \, y'(0)=0$

So I know $s^{2}L[y] - sy(0) - y'(0) -2sL[y] + 2y(0) + 2L[y] = \frac{s}{s^{2}+1}$

$L[y](s^{2} -2s +2) - s + 2 = \frac{s}{s^{2} + 1}$

$L[y] = \frac{s(s^{2} - 2s + 2) -2}{(s^{2} + 1)(s^{2} - 2s +2)}$

$L[y] = \frac{s}{s^{2} + 1} - \frac{2}{(s^{2}+1)(s^{2}-2s+2)}$

I am pretty sure I am right up to this part and I know I have to use partial fractions, but everytime I do I get a different answer and they are never close to what the answer key's answer is:

$y = \frac{1}{5}(cost - 2sint +4e^{t}cost - 2e^{t}sint)$

Much help would be appreciated!

2. Originally Posted by Pinkk
$y'' - 2y' + 2y = cost; \, y(0) = 1, \, y'(0)=0$

So I know $s^{2}L[y] - sy(0) - y'(0) -2sL[y] + 2y(0) + 2L[y] = \frac{s}{s^{2}+1}$

$L[y](s^{2} -2s +2) - s + 2 = \frac{s}{s^{2} + 1}$

$L[y] = \frac{s(s^{2} - 2s + 2) -2}{(s^{2} + 1)(s^{2} - 2s +2)}$

$L[y] = \frac{s}{s^{2} + 1} - \frac{2}{(s^{2}+1)(s^{2}-2s+2)}$

I am pretty sure I am right up to this part and I know I have to use partial fractions, but everytime I do I get a different answer and they are never close to what the answer key's answer is:

$y = \frac{1}{5}(cost - 2sint +4e^{t}cost - 2e^{t}sint)$

Much help would be appreciated!
Well, you need to get the correct partial fraction decomposition and that's just paleontological spade work. After which you get:

$\frac{s}{s^2 + 1} - \frac{1}{5} \left( \frac{6 - 4s}{(s - 1)^2 + 1} + \frac{4s + 2}{s^2 + 1}\right)$

$= \frac{1}{5} \left( \frac{4s}{(s - 1)^2 + 1} - \frac{6}{(s - 1)^2 + 1} - \frac{2}{s^2 + 1} + \frac{s}{s^2 + 1}\right)$

and the inversion is simple. However, the 6 is clearly wrong (it should be a 2) so I suspect there's a small error somewhere in your expression for L[y].