# linear DE - Where did I go wrong?

I'm trying to find the general solution for

$(x+2)y' = 3-\frac{2y}{x}$

This is what I've done so far:

$y'+\frac{2y}{x(x+2)}=\frac{3}{x+2}$

$(\frac{x}{x+2}y)'=\frac{3x}{(x+2)^2}$

$\frac{x}{x+2}y=3\int \frac{x}{(x+2)^2}dx$

$\frac{x}{x+2}y= 3\int \frac{1}{x+2}dx - 6\int\frac{1}{(x+2)^2}dx$

$\frac{x}{x+2}y= 3 ln|x+2| + \frac{6}{x+2}+c$

I tested this solution for when c=0, but it failed. Can anyone spot my mistake?

-
I believe mistake is that you did not find the integrating factor correctly. In your solution, I don't think your 2nd line is equivalent to the first one –  gt6989b Sep 19 '12 at 16:19
How did it fail? I see no mistake, and your answer agrees with Wolfram Alpha. [You remembered to divide out by $x/(x+2)$ from the LHS of the final line to check that $y$ is a solution right?] Also, your general solution needs to include $+D\,v(x)$, where $v$ is a solution to $(x+2)v'+2v/x=0$ (remember homogeneous and inhomogeneous parts!) and $D$ an arbitrary constant. –  anon Sep 19 '12 at 16:20
Okay I quadruple-checked my answer and it looks like it's correct. The textbook I'm working with had the answer in a crazy form, and I thought WolframAlpha had something different. Btw, I've no idea what you mean by (in)homogenous parts yet, I've just started working with D.E. :) I'll figure it out! –  Korgan Rivera Sep 19 '12 at 16:28
Looks fine. Did you finish solving for y? –  Mike Sep 19 '12 at 18:27