# Homework Help: ODE with integrating factor

1. Sep 12, 2013

### iRaid

Problem:
$$xy'+2y=3x$$
Attempt:
Divide by x...
$$y'+\frac{2y}{x}=3$$
I think I find the integrating factor by doing:
$$e^{\int \frac{2}{x}dx}$$

Not sure if that's right but if it is then the solution to the integral is just 2x.

Any help is appreciated

2. Sep 12, 2013

### rock.freak667

You will need to add in the constant of integration to the right side before you do any simplification.

3. Sep 12, 2013

### HallsofIvy

Yes, the integrating factor is $e^{\int (2/x)dx}$ but then the integral is 2 ln(x) so the integrating factor is $e^{2ln(x)}= e^{ln(x^2)}= x^2$, not 2x.

Multiplying the equation by that gives $x^2y'+ 2xy= (x^2y)'= 3x^2$

Last edited by a moderator: Sep 12, 2013
4. Sep 13, 2013

### iRaid

Yeah I figured it out ends up:
$$x^{2}y'+2xy=3x^{2}$$
Take integral/derivative of integrating factor:
$$\int \frac{d}{dx} x^{2}y=\int 3x^{2}dx$$
Simplifies to:
$$x^{2}y=x^{3}+C \implies y=\frac{x^{3}+C}{x^{2}}$$
(can be simplified a little more too)

Thanks for the help.