How do I solve differential equation?

In summary: Just try to summarize the gist of what was said, and I'll fill in the blanks. In summary, PeroK is having trouble solving a differential equation and has tried all of the variations he remembers. He's been helped by another student who has told him how to solve the equation using the method of undetermined coefficients.
  • #1
skrat
748
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
  • #2
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:
  • #3
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).
 
  • #4
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. -.-
 
  • #5
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.
 
  • #6
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!?
 
  • #7
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".
 
  • #8
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:
  • #9
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.
 

FAQ: How do I solve differential equation?

1. What is a differential equation?

A differential equation is a mathematical equation that describes the relationship between a function and its derivatives. It involves one or more independent variables and the derivatives of the dependent variable with respect to those independent variables.

2. Why is it important to solve differential equations?

Differential equations are used to model and describe many real-world phenomena, from the growth of populations to the motion of objects. Solving them allows us to understand and predict the behavior of these systems, making them essential in many fields of science and engineering.

3. What methods can be used to solve differential equations?

There are several methods for solving differential equations, including separation of variables, substitution, and variation of parameters. Other techniques like Laplace transforms, numerical methods, and series solutions can also be used depending on the type of differential equation.

4. Can all differential equations be solved analytically?

No, not all differential equations can be solved using analytical methods. Some equations may have no solution or may require advanced mathematical techniques that have not yet been developed. In such cases, numerical methods can be used to approximate the solution.

5. Are there any applications of differential equations in everyday life?

Yes, there are many applications of differential equations in everyday life. For example, they are used in modeling the spread of diseases, predicting weather patterns, and optimizing financial investments. They also play a crucial role in engineering, physics, and chemistry, among other fields.

Similar threads

Back
Top