# Thread: Second Order Inhomogeneous Differential Equation

1. ## Second Order Inhomogeneous Differential Equation

Hey guys, I thought I had this question solved, wrote it out in final copy and everything and then I realised I'd made a big mistake. Was hoping someone here would be able to give me a few pointers.

a) Solve the initial value problem: $x'' + x = 2cos(\omega t)$

So first I solved homogeneous general solution: $\lambda^2 + 1 = 0$

Therefore the solution looks like: $Ae^{it} + Be^{-it}$

But I only want real answers, so I use complex exponential to achieve:

$C_1cos(t) + C_2sin(t)$

Where C1 and C2 are real arbitrary constants.

Then I have to solve for inhomogeneous solution. My error was that the first time I did this I took the form to be $x = acos(\omega t) + bsin(\omega t)$

However it was pointed out to me that I can't use sine and cosine on their own because they are in the homogeneous general solution. So I think I have to change the form to: $x = atcos(\omega t) + btsin(\omega t)$

Then I differentiate twice to get $x'' = -2a\omega sin(\omega t) - at\omega^2 cos(\omega t) + 2b\omega cos(\omega t) - bt\omega^2 sin(\omega t)$

Subbing these in to $x'' + x = 2cos(\omega t)$

Gives me: $-2a\omega sin(\omega t) - at\omega^2 cos(\omega t) + 2b\omega cos(\omega t)$ $- bt\omega^2 sin(\omega t) + atcos(\omega t) + btsin(\omega t) = 2cos(\omega t)$

Then I equate the co-efficients and get:

$sin(\omega t) : -2a\omega = 0$
$cos(\omega t) : 2b\omega = 2$
$tsin(\omega t) : b - b\omega^2 = 0$
$tcos(\omega t) : a - a\omega^2 = 0$

By here I think I've done something drastically wrong. If anyone is able to see if I'm even on the right track it would be greatly appreciated. This is quite urgent, but anything will help! Thanks a lot in advance,
U-god

2. I'm beginning to think perhaps $x = atcos(\omega t) + btsin(\omega t)$ is the wrong form..

3. Originally Posted by U-God
Hey guys, I thought I had this question solved, wrote it out in final copy and everything and then I realised I'd made a big mistake. Was hoping someone here would be able to give me a few pointers.

a) Solve the initial value problem: $x'' + x = 2cos(\omega t)$

So first I solved homogeneous general solution: $\lambda^2 + 1 = 0$

Therefore the solution looks like: $Ae^{it} + Be^{-it}$

But I only want real answers, so I use complex exponential to achieve:

$C_1cos(t) + C_2sin(t)$

Where C1 and C2 are real arbitrary constants.

Then I have to solve for inhomogeneous solution. My error was that the first time I did this I took the form to be $x = acos(\omega t) + bsin(\omega t)$

However it was pointed out to me that I can't use sine and cosine on their own because they are in the homogeneous general solution. So I think I have to change the form to: $x = atcos(\omega t) + btsin(\omega t)$

Then I differentiate twice to get $x'' = -2a\omega sin(\omega t) - at\omega^2 cos(\omega t) + 2b\omega cos(\omega t) - bt\omega^2 sin(\omega t)$

Subbing these in to $x'' + x = 2cos(\omega t)$

Gives me: $-2a\omega sin(\omega t) - at\omega^2 cos(\omega t) + 2b\omega cos(\omega t)$ $- bt\omega^2 sin(\omega t) + atcos(\omega t) + btsin(\omega t) = 2cos(\omega t)$

Then I equate the co-efficients and get:

$sin(\omega t) : -2a\omega = 0$
$cos(\omega t) : 2b\omega = 2$
$tsin(\omega t) : b - b\omega^2 = 0$
$tcos(\omega t) : a - a\omega^2 = 0$

By here I think I've done something drastically wrong. If anyone is able to see if I'm even on the right track it would be greatly appreciated. This is quite urgent, but anything will help! Thanks a lot in advance,
U-god
Using $x = a \cos(\omega t) + b \sin(\omega t)$ as the form of the particular is OK provided $\omega \neq 1$.

If $\omega = 1$ then the DE is $x'' + x = 2 \cos t$. In this case use $x = (t + ct^2)(a \cos t + b \sin t)$ as the form of the particular solution.

4. Ok thanks for that,
However, I was taught that if a term is in the homogeneous general solution, you cannot use that term in your form for the inhomogeneous solution. And in the case of this I would have to multiply through by t. Why is it valid if $\omega$ does not equal 1, despite the fact that sines and cosines are still present in the general homogeneous solution?

Also, if you wouldn't mind explaining where you got $x = (t + ct^2)(a \cos t + b \sin t)$ from it would be nice? Is it something that you just derived, or is it a rule of thumb?

Cheers.

5. Hang on, I tried and was left with,

$a-a{\omega}^2=2$

$b-b{\omega}^2=0$

What did i do wrong?

6. This is starting to confuse me :S

I think $x = acos(\omega t) + bsin(\omega t)$ will work despite it goes against what I was initially taught. And I can sort of accept that, but with the second form you gave:

$x = (t + ct^2)(a \cos t + b \sin t)$ why is there no omega in the sine and cosine functions?
I derived it and put it into x'' + x and got: $(2bc - 2a)sin(t) + (2ac + 2b)cos(t) - 4actsin(t) + 4bctcos(t)$

Where would I go from here?
Thanks

Hang on, I tried and was left with,

$a-a{\omega}^2=2$

$b-b{\omega}^2=0$

What did i do wrong?
I did that and got the same thing, and everything simplified very nicely. But someone whose opinion I respect pointed out that I cannot use that form if there are sines and cosines in the homogeneous general solution. So apparently it's incorrect.

8. Originally Posted by U-God
$x = (t + ct^2)(a \cos t + b \sin t)$ why is there no omega in the sine and cosine functions?
In this particular solution omega must equal one, that's why its not there

In this particular solution omega must equal one, that's why its not there
Wow! I swear I am getting dumber haha!!

Do you know why this is the form of the equation though?

10. Originally Posted by U-God
Ok thanks for that,
However, I was taught that if a term is in the homogeneous general solution, you cannot use that term in your form for the inhomogeneous solution. And in the case of this I would have to multiply through by t. Why is it valid if $\omega$ does not equal 1, despite the fact that sines and cosines are still present in the general homogeneous solution?

Also, if you wouldn't mind explaining where you got $x = (t + ct^2)(a \cos t + b \sin t)$ from it would be nice? Is it something that you just derived, or is it a rule of thumb?

Cheers.
The sines and cosines in the general solution have a different period ( namely $\frac{2 \pi}{\omega}$ ) to that of $\cos t$ except when $\omega = 1$.

You should treat $\omega \neq 1$ and $\omega = 1$ as two seperate cases. Re-read post #3.

You've misunderstood the 'respected opinion', I think. But hopefully this thread has cleared things up.