# ODE with integrating factor

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

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

HallsofIvy
Homework Helper
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
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:
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.