How do I solve differential equation?

skrat
Messages
740
Reaction score
8

Homework Statement


Solve ##y''+y-sinx=0##.


Homework Equations





The Attempt at a Solution



I am actually working on variational problems which brought me to this differential equation. I thought that taking ##y=Asinx+Bcosx## would solve it, yet it does nothing useful.

In other words, I tried everything I could remember. Could somebody help me?
 
Physics news on Phys.org
sin(x) and cos(x) as you've discovered are a solutions to the homogeneous equation. So, you need to try a variation of sin(x) and cos(x) to get a particular solution.

Can you remember how to do this?
 
Last edited:
skrat said:

Homework Statement


Solve ##y''+y-sinx=0##.


Homework Equations





The Attempt at a Solution



I am actually working on variational problems which brought me to this differential equation. I thought that taking ##y=Asinx+Bcosx## would solve it, yet it does nothing useful.

In other words, I tried everything I could remember. Could somebody help me?

PeroK said:
sin(x) and cos(x) as you've discovered are a solutions to the homogeneous equation. So, you need to try a variation of sin(x) and cos(x) to get a particular solution.

Can you remember how to do this?
To elaborate on what PeroK said, the homogeneous DE is y'' + y = 0. The nonhomogeneous DE is y'' + y = sin(x).

The general solution of the homogeneous equation is yc = Asin(x) + Bcos(x).
 
Agree, BUT

##y^{'}=A^{'}sin(x)+Acos(x)+B^{'}cos(x)-Bsin(x)## and

##y^{''}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)-Asin(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)-Bcos(x)##.

The sum ##y^{''}+y^{'}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)##.

Don't even dare to say that is is what I have to solve now. -.-
 
skrat said:
Agree, BUT

##y^{'}=A^{'}sin(x)+Acos(x)+B^{'}cos(x)-Bsin(x)## and

##y^{''}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)-Asin(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)-Bcos(x)##.

The sum ##y^{''}+y^{'}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)##.

Don't even dare to say that is is what I have to solve now. -.-

A and B are just constants, so it makes no sense to write them with A' (= 0) and A'' (= 0).

If y is any linear combination of sin(x) and cos(x), then y'' + y will be identically zero.

To get you thinking the right way, here is a related example.
Homogeneous DE: y' - y = 0
Solution basis : {et}
(Meaning that the general solution is all linear combinations of et.)
Nonhomogeneous DE: y' - y = 3et
No constant multiple of et could possibly be a solution of the nonhomogeneous equation, because d/dt(Aet) - Aet = 0 identically.

The trick is to try a particular solution of the form Btet.

Let yp = Btet. Then yp' = Bet + Btet.

So yp' - yp = 3et
##\Rightarrow## Bet + Btet - Btet = 3et
##\Rightarrow## Bet = 3et
##\Rightarrow## B = 3
So our particular solution is yp = 3tet

Hopefully, this is similar to other examples you have seen.
 
Mark44 said:
A and B are just constants, so it makes no sense to write them with A' (= 0) and A'' (= 0).

No? O.o

For example take a look at: http://www.math.vt.edu/people/renardym/class_home/firstorder/node1.html

So in general ##A=A(x)## and ##B=B(x)## unless you somehow saw that in this case they are actual constants.


That is in fact something I remember very well, unless I've mixed up things big time!?
 
skrat said:
No? O.o

For example take a look at: http://www.math.vt.edu/people/renardym/class_home/firstorder/node1.html

So in general ##A=A(x)## and ##B=B(x)## unless you somehow saw that in this case they are actual constants.


That is in fact something I remember very well, unless I've mixed up things big time!?

Variation of parameters is overkill for this problem. Look up "undetermined coefficients".
 
The method I used is called the method of undetermined coefficients, which is simpler to use when you have a DE with constant coefficients, as you have.

There's another method that uses annihilators to convert an nonhomogeneous constant coefficient DE into a higher order homogeneous DE. Not all textbooks present this method, so it might not be in your book or if it is, you might not have seen it yet.

Using operator notation, where D means d/dx and D2 means ##\frac{d^2}{dx^2}##, the equation of my example can be represented as (D - 1)y = 3ex.

The operator that annihilates ex is the D - 1 operator, meaning that (D - 1)ex = d/dx(ex) - ex = 0.

To convert the nonhomogeneous first order equation of my example to a homogeneous equation, we apply the operator that will annihilate the right side, to both sides, like so:
(D + 1)[(D + 1)y] = (D + 1)(3ex) = 0

In the process, the first order nonhomogeneous equation has become second order.

(D + 1)2y = 0

The general solution of the above is y = Aex + Bxex. The first function is the general solution of the original homogeneous problem. The second function is the particular solution of the original nonhomogeneous problem. If you substitute this general solution into the original problem, you'll find (again) that B = 3.

Edit: Apologies if the above seems like drinking from a fire hose. There is a lot I left out, as I needed to take my dogs for their morning walk.
 
Last edited:
skrat said:
Agree, BUT

##y^{'}=A^{'}sin(x)+Acos(x)+B^{'}cos(x)-Bsin(x)## and

##y^{''}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)-Asin(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)-Bcos(x)##.
You didn't give any indication that A and B were actually functions, so I assumed that they were constants.
 
  • #10
Method of undetermined coefficients ... Yup, I know this one and also should have remembered it.

Thanks to all and apologize for standing up and saying that ##A=A(x)##... :)

The solution is ##y=-\frac{xcos(x)}{2}##
 
  • #11
skrat said:
Agree, BUT

##y^{'}=A^{'}sin(x)+Acos(x)+B^{'}cos(x)-Bsin(x)## and

##y^{''}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)-Asin(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)-Bcos(x)##.

The sum ##y^{''}+y^{'}=A^{''}sin(x)+A^{'}cos(x)+A^{'}cos(x)+B^{''}cos(x)-B^{'}sin(x)-B^{'}sin(x)##.

Don't even dare to say that is is what I have to solve now. -.-

Set the coefficient of cos(x) identically equal to 0 and the coefficient of sin(x) identically equal to 1. This gives you two simple coupled constant-coefficient first-order linear DEs for ##A_1 = dA/dx## and ##B_1 = dB/dx##. Remember that ##A(x) = \int_0^x A_1(t) \, dt + \text{const.}##, etc.
 
Back
Top