# Solving a bernoulli diff eqn

Solve $y'+y=xy^3$

So I divided by $y^3$ on both sides getting $\frac{\text{dy}}{\text {dx}y^{3}}+y^{-2}=x$

Substituted $u=y^{-2}$, $\frac{\text{du}}{\text{dx}}=-2y^{-3}\frac{\text{dy}}{\text{dx}}$

Got the linear equation $\frac{\text{du}}{\text{dx}}-2u=-2x$

Found the integrating factor of $e^{-2x}$

Multiplied both sides by the integrating factor to get $e^{-2x}\frac{\text{du}}{\text{dx}}-2e^{-2x}u=-2xe^{-2x}$

Integrated both sides to get $ue^{-2x}=\int-2xe^{-2x}dx$ The right hand side I got from basically the product rule. The left hand side tured out to be $4xe^{-2x}+8e^{-2x}+C$ from tabular method of integration

So we have $ue^{-2x}=4xe^{-2x}+8e^{-2x}+C$

After simplification (I cancelled out the $e^{-2x}$, don't know if that's allowed):

I got the solution of $1=4xy^2+8y^2+C$, however the correct answer is $\frac{1}{y^2}=Ce^{2x}+x+\frac{1}{2}$

Where did I go wrong?

• First, your integration is a bit off. Second, the canceling out of $e^{-2x}$ is multiplication by $e^{2x}$. – Lev Borisov Mar 24 '16 at 21:10
• Yeah I think I used the tabular method incorrectly – shoestringfries Mar 24 '16 at 21:11

\begin{align}\frac{d(e^{-2x} u)}{dx} = -2xe^{-2x} &\implies e^{-2x} u = \color{red}{\frac{1}{2} e^{-2x}(2x + 1)} + C \\ &\implies u = \frac{1}{2} (2x+ 1) + Ce^{2x} \end{align}
where on the second implication you multiply both sides by $e^{2x}$.
• So the constant has to indicate you multiplied by $e^{2x}$ because there is a variable $x$ included, right? – shoestringfries Mar 24 '16 at 21:19
• I'm not sure what you mean by "indicate", but, yes, there is a variable $x$ and the family of solutions is given by $$\frac{1}{y^2} = Ce^{2x} + x + \frac{1}{2}$$ and the integration in red is by parts. – Aaron Maroja Mar 24 '16 at 21:22