# Homework Help: First order ODE solution

1. Aug 19, 2010

### bobred

1. The problem statement, all variables and given/known data
Solve first order ODE

2. Relevant equations

$$\frac{dy}{dx}=x^2+1+\frac{2}{x}y$$
Rearranged
$$\frac{dy}{dx}-\frac{2}{x}y=x^2+1$$

3. The attempt at a solution
Integrating factor
$$p=\exp(-\int \frac{2}{x})=\exp(-2\ln x)=x^{-2}$$

Multiplying through by the integrating factor
$$\frac{d}{dy}(x^{-2}y)=x^{-2}$$

Integrating both sides
$$x^{-2}y=-x^{-1}+C$$

Dividing through by $$x^{-2}$$
$$y=Cx^2-x$$

The problem comes when I use say, Maple to check the answer, it gives

$$y=x^3+Cx^2-x$$

Any ideas? Thanks

2. Aug 19, 2010

### HallsofIvy

No, the right hand side of your original equation was $x^2+ 1$. Multiplying that by $x^{-2}$ gives $1+ x^{-2}$. You've dropped the "1".

3. Aug 19, 2010

Thanks