Separation of variables to solve DE

beetle2
Messages
110
Reaction score
0

Homework Statement



y' + (2/x)y = 3/x^2

Homework Equations



separation of variables

The Attempt at a Solution



First I turned it into

dy/dx + (2/x)y = 3/x^2 dx


then multiplied both sides by dx

dy + (2/x)y = 3/x^2 dx

I then tried to divide both sides by 2/x and got

dy + y = 3/2x

Do I just integrate both sides now?
 
Last edited:
Physics news on Phys.org
Separation of variables won't help (you also made an error when multiplying through the equation with dx). It looks like you'll have to solve this using an integrating factor.
 
You also made an error when dividing by (2/x). Make sure that what you do to one term goes for all terms.
 
The integrating factor is e^{\int{\frac{2}{x}dx} = x^2

We than use this and multiply both sides by x^2

which gives


x^2y'+2xy = 3

or

yx^2= 3x+C

divide both sides by x^2

y = \frac{3}{x}+\frac{C}{x^2}
 
Is this the general solution?
 
yes, it's the general solution.
 
Also can be solved as a non-homogeneous Euler equation.
 
boneill3 said:
which gives


x^2y'+2xy = 3

or

yx^2= 3x+C


I see you integrated on the right side wrt x to get 3x+C

but how did x^2y'+2xy become yx^2? did we integrate the LHS wrt x or y?
 
Given a function f(x,y), its total differential with respect to x is \frac{df}{dx} = \frac{\partial f}{\partial x}\frac{dx}{dx} + \frac{\partial f}{\partial y}\frac{dy}{dx}.
 
  • #10
beetle2 said:
I see you integrated on the right side wrt x to get 3x+C

but how did x^2y'+2xy become yx^2? did we integrate the LHS wrt x or y?
You have to treat both sides of the equation the same way. If you integrate the RHS wrt x, you have to integrate the LHS wrt x as well.
 
Back
Top