# Homework Help: Separation of variables to solve DE

1. Aug 2, 2010

### beetle2

1. The problem statement, all variables and given/known data

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

2. Relevant equations

separation of variables

3. 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: Aug 2, 2010
2. Aug 2, 2010

### Bohrok

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.

3. Aug 2, 2010

### Mindscrape

You also made an error when dividing by (2/x). Make sure that what you do to one term goes for all terms.

4. Aug 3, 2010

### boneill3

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}$

5. Aug 3, 2010

### beetle2

Is this the general solution?

6. Aug 3, 2010

yes, it's the general solution.

7. Aug 3, 2010

### gomunkul51

Also can be solved as a non-homogeneous Euler equation.

8. Aug 3, 2010

### beetle2

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?

9. Aug 3, 2010

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}.$$