# Thread: 2nd Order Non-Homogeneous DE

1. ## 2nd Order Non-Homogeneous DE

Firstly Sorry for all the threads, but i have a test on DE's quite soon and i want to clarify as much as possible really without getting on my tutors bad books(i.e. annoying the hell out of her )

I can solve this sort

$\displaystyle y'' + Ay' + B' = Ax^2 + Bx^2 + C$

However this question is like this

$\displaystyle y'' - y = 2cosx - 2sinx$

I haven't a clue how to solve the particular when it ends like that. With my first example you just say $\displaystyle Ax^2 + Bx^2 + C$ and work out the constants, but with this i am unsure.

I have worked out the $\displaystyle y_{c}(x)$ part

and get

$\displaystyle y_{c}(x) = c_{1}e^{-x}+c_{2}e^x$

But i haven't a clue where to start with $\displaystyle y_{p}(x)$

2. Originally Posted by Rapid_W
Firstly Sorry for all the threads, but i have a test on DE's quite soon and i want to clarify as much as possible really without getting on my tutors bad books(i.e. annoying the hell out of her )

I can solve this sort

$\displaystyle y'' + Ay' + B' = Ax^2 + Bx^2 + C$

However this question is like this

$\displaystyle y'' - y = 2cosx - 2sinx$

I haven't a clue how to solve the particular when it ends like that. With my first example you just say $\displaystyle Ax^2 + Bx^2 + C$ and work out the constants, but with this i am unsure.

I have worked out the $\displaystyle y_{c}(x)$ part

and get

$\displaystyle y_{c}(x) = c_{1}e^{-x}+c_{2}e^x$

But i haven't a clue where to start with $\displaystyle y_{p}(x)$

Use $\displaystyle y_p = A \cos (x) + B \sin (x)$.

3. Thanks ever so much!

If for example it was = to 10cosx, what would my plan of action be then?

4. Originally Posted by Rapid_W
Thanks ever so much!

If for example it was = to 10cosx, what would my plan of action be then?
Use $\displaystyle y_p = A \cos (x) + B \sin (x)$.

5. The easiest way of finding $\displaystyle y_p$ when function on the right is a sum of trigonometric functions is to try

$\displaystyle y_p = A \sin x + B \cos x$

and equate coefficients.

I.e.

$\displaystyle y_{p}' = A \cos x - B \sin x$

$\displaystyle y_{p}'' = - (A \sin x + B \cos x) = - y_p$

so substituting for $\displaystyle y_{p}''$ in your equation gives

$\displaystyle y_{p}'' - y_{p} = -2 y_{p} = 2 \cos x - 2 \sin x$

$\displaystyle \Leftrightarrow -A \sin x - B \cos x = \cos x - \sin x$.

I.e. $\displaystyle A = 1$ and $\displaystyle B = -1$ .

So the final solution given by $\displaystyle y = y_c + y_p$ is

$\displaystyle \boxed{ y= c_1 e^{-x} + c_2 e^{x} + \sin x - \cos x }$ .

6. Sorry, Mr. Fantastic's posts weren't there when I started posting.

7. Originally Posted by the_doc
The easiest way of finding $\displaystyle y_p$ when function on the right is a sum of trigonometric functions is to try

$\displaystyle y_p = A \sin x + B \cos x$

and equate coefficients.

I.e.

$\displaystyle y_{p}' = A \cos x - B \sin x$

$\displaystyle y_{p}'' = - (A \sin x + B \cos x) = - y_p$

[snip]
@OP: I will add that this type of particular solution will not work when the non-homogeneous bit of the DE contains $\displaystyle \cos (\lambda x)$ or $\displaystyle \sin (\lambda x)$ terms where $\displaystyle \lambda$ is a solution to the auxillary equation.

8. Thanks i know your answer is correct, but my arithmatic is wrong and i can't work out where

$\displaystyle y_{p}(x)=Asinx+Bcosx$
$\displaystyle y'=Acosx-Bsinx$
$\displaystyle y''=-Asinx - Bsinx$
so
$\displaystyle (-A-B)sinx+(A-B)cosx$
giving
$\displaystyle -A-B=-2$
$\displaystyle A-B=2$
and i keep getting B=0 and A=-2.

i'll run through what you have done again but i can't work out the jump where you have used the iff symbol

9. Worked out where i've gone wrong. I used y', where i should have used y. I've been awake too long lol, thanks everyone for all your help, i think i've cracked this type of DE now!

10. Hit another obstacle, sorry guys...

$\displaystyle y''-7y'+10y=9e^{2x}$

$\displaystyle y_{c}(x) = c_{1}e^{2x}+c_{2}e^{5x}$

and i took what i though was a logical step for $\displaystyle y_{p}(x)$

$\displaystyle y_{p}(x)=Ae^{2x}$

however when i simplified all the substituting i ended up with $\displaystyle 0Ae^{2x}$
giving $\displaystyle 0A=9$

which is obviously no help because i highly doubt $\displaystyle y_{p}(x)$ can equal $\displaystyle \infty$.

Thanks.

11. Try:

$\displaystyle y_p (x) = A \,x \,e^{2x}$.

When the non-homogeneous part is a multiple of a part of your complementary function (in this case $\displaystyle e^{2x}$) then you should try $\displaystyle x$ times it.

In general you can always use the method of 'Variation of parameters' but it can be alot of work!

12. Thanks, i had just started to try that, there is a lot of work, but i get it down to this

$\displaystyle y_{p}=Axe^{2x}$
$\displaystyle y_{p}'=2Axex^{2x} + Ae^{2x}$
$\displaystyle y_{p}''=4Axe^{2x} + 4Ae^{2x}$

and plugged back in give

$\displaystyle -3Ae^{2x}$

So $\displaystyle -3A = 9$
$\displaystyle A=-3$

so $\displaystyle y_{p}(x)=-3xe^{2x}$

Now, i'm not fully confident with this as Wolfram Alpha lists the particular interval as $\displaystyle -e^{2x}(3x+1)$

y''-7y'+10y=9e^(2x) - Wolfram|Alpha

I understand why the 3x is in the bracket, but where has the +1 come from?

13. Originally Posted by Rapid_W
Thanks, i had just started to try that, there is a lot of work, but i get it down to this

$\displaystyle y_{p}=Axe^{2x}$
$\displaystyle y_{p}'=2Axex^{2x} + Ae^{2x}$
$\displaystyle y_{p}''=4Axe^{2x} + 4Ae^{2x}$

and plugged back in give

$\displaystyle -3Ae^{2x}$

So $\displaystyle -3A = 9$
$\displaystyle A=-3$

so $\displaystyle y_{p}(x)=-3xe^{2x}$

Now, i'm not fully confident with this as Wolfram Alpha lists the particular interval as $\displaystyle -e^{2x}(3x+1)$

y''-7y'+10y=9e^(2x) - Wolfram|Alpha

I understand why the 3x is in the bracket, but where has the +1 come from?
$\displaystyle y_p = -3x e^{2x}$ is the correct particular solution.

If you add the Wolfram Alpha particular solution to $\displaystyle y_c$ you will see why the +1 is irrelevant.

14. Originally Posted by Rapid_W
Firstly Sorry for all the threads, but i have a test on DE's quite soon and i want to clarify as much as possible really without getting on my tutors bad books(i.e. annoying the hell out of her )

I can solve this sort

$\displaystyle y'' + Ay' + B' = Ax^2 + Bx^2 + C$

However this question is like this

$\displaystyle y'' - y = 2cosx - 2sinx$

I haven't a clue how to solve the particular when it ends like that. With my first example you just say $\displaystyle Ax^2 + Bx^2 + C$ and work out the constants, but with this i am unsure.

I have worked out the $\displaystyle y_{c}(x)$ part

and get

$\displaystyle y_{c}(x) = c_{1}e^{-x}+c_{2}e^x$

But i haven't a clue where to start with $\displaystyle y_{p}(x)$

Alternatively, we could take the Laplace transform of both sides. Let $\displaystyle \mathcal{L} \{y(x) \} = Y(s)$. We have $\displaystyle y'' - y = 2 \cos x - 2 \sin x$. Then $\displaystyle \mathcal{L} \{y'' - y \} = \mathcal{L} \{2 \cos x - 2 \sin x \}$. Solve for $\displaystyle Y(s)$. Then take inverse Laplace transforms to get $\displaystyle y(x)$.