# 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
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 12, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9660314917564392, "perplexity_flag": "middle"}