# Thread: Solve in two different ways

1. ## Solve in two different ways

Solve in two different ways $\displaystyle \frac{dy}{dx}=xy^3-xy$.

-------------------------------------------------------------------------

Separable:

$\displaystyle \frac{dy}{dx}=x(y^3-y)$

$\displaystyle \frac{dy}{y^3-y}=xdx$

$\displaystyle \frac{dy}{y(y+1)(y-1)}=xdx$

Let $\displaystyle \frac{1}{y(y+1)(y-1)}=\frac{A}{y}+\frac{B}{y+1}+\frac{C}{y-1}$

$\displaystyle 1=A(0+1)(0-1)$

$\displaystyle A=-1$

$\displaystyle 1=B(-1)(-1-1)$

$\displaystyle B=\frac{1}{2}$

$\displaystyle 1=C(1+1)$

$\displaystyle C=\frac{1}{2}$

$\displaystyle \int \left[\frac{-1}{y}+\frac{1}{2(y+1)}+\frac{1}{2(y-1)}\right]dy=\int xdx$

$\displaystyle -\ln y+\frac{1}{2}\ln (y+1)+\frac{1}{2}\ln (y-1)=\frac{x^2}{2}+C'$

$\displaystyle -2\ln y+\ln (y+1)+\ln (y-1)=x^2+C$, where $\displaystyle C=2C'$.

$\displaystyle \ln \frac{(y+1)(y-1)}{y^2}=x^2+C$

Bernoulli:

$\displaystyle \frac{dy}{dx}+xy=xy^3$

Let $\displaystyle v=y^{-2}$.

$\displaystyle y=v^{-1/2}$

$\displaystyle \frac{dy}{dx}=-\frac{1}{2}v^{-3/2}\frac{dv}{dx}$

$\displaystyle -\frac{1}{2}v^{-3/2}\frac{dv}{dx}+xv^{-1/2}=xv^{-3/2}$

Multiplying throughout by $\displaystyle -2v^{3/2}$,

$\displaystyle \frac{dv}{dx}-2xv=-2x$

The integrating factor is $\displaystyle e^{\int -2xdx}=e^{-x^2}$.

$\displaystyle e^{-x^2}\frac{dv}{dx}-2xe^{-x^2}v=-2xe^{-x^2}$

$\displaystyle \frac{d}{dx}(ve^{-x^2})=-2xe^{-x^2}$

$\displaystyle ve^{-x^2}=e^{-x^2}+C$

$\displaystyle y^{-2}e^{-x^2}=e^{-x^2}+C$

$\displaystyle y^{-2}=Ce^{x^2}+1$

$\displaystyle y=(Ce^{x^2}+1)^{-1/2}$

-------------------------------------------------------------------------

Where have I gone wrong?

2. ## Re: Solve in two different ways

Originally Posted by alexmahone
Solve in two different ways $\displaystyle \frac{dy}{dx}=xy^3-xy$.

-------------------------------------------------------------------------

Separable:

$\displaystyle \frac{dy}{dx}=x(y^3-y)$

$\displaystyle \frac{dy}{y^3-y}=xdx$

$\displaystyle \frac{dy}{y(y+1)(y-1)}=xdx$

Let $\displaystyle \frac{1}{y(y+1)(y-1)}=\frac{A}{y}+\frac{B}{y+1}+\frac{C}{y-1}$

$\displaystyle 1=A(0+1)(0-1)$

$\displaystyle A=-1$

$\displaystyle 1=B(-1)(-1-1)$

$\displaystyle B=\frac{1}{2}$

$\displaystyle 1=C(1+1)$

$\displaystyle C=\frac{1}{2}$

$\displaystyle \int \left[\frac{-1}{y}+\frac{1}{2(y+1)}+\frac{1}{2(y-1)}\right]dy=\int xdx$

$\displaystyle -\ln y+\frac{1}{2}\ln (y+1)+\frac{1}{2}\ln (y-1)=\frac{x^2}{2}+C'$

$\displaystyle -2\ln y+\ln (y+1)+\ln (y-1)=x^2+C$, where $\displaystyle C=2C'$.

$\displaystyle \ln \frac{(y+1)(y-1)}{y^2}=x^2+C$

Bernoulli:

$\displaystyle \frac{dy}{dx}+xy=xy^3$

Let $\displaystyle v=y^{-2}$.

$\displaystyle y=v^{-1/2}$

$\displaystyle \frac{dy}{dx}=-\frac{1}{2}v^{-3/2}\frac{dv}{dx}$

$\displaystyle -\frac{1}{2}v^{-3/2}\frac{dv}{dx}+xv^{-1/2}=xv^{-3/2}$

Multiplying throughout by $\displaystyle -2v^{3/2}$,

$\displaystyle \frac{dv}{dx}-2xv=-2x$

The integrating factor is $\displaystyle e^{\int -2xdx}=e^{-x^2}$.

$\displaystyle e^{-x^2}\frac{dv}{dx}-2xe^{-x^2}v=-2xe^{-x^2}$

$\displaystyle \frac{d}{dx}(ve^{-x^2})=-2xe^{-x^2}$

$\displaystyle ve^{-x^2}=e^{-x^2}+C$

$\displaystyle y^{-2}e^{-x^2}=e^{-x^2}+C$

$\displaystyle y^{-2}=Ce^{x^2}+1$

$\displaystyle y=(Ce^{x^2}+1)^{-1/2}$

-------------------------------------------------------------------------

Where have I gone wrong?
What makes you think there's something wrong with either of them (except for leaving off the modulus signs in your logarithms)? If you try to write your separable equation as y in terms of x, you should get something that is correct up to an integration constant.

3. ## Re: Solve in two different ways

Originally Posted by Prove It
What makes you think there's something wrong with either of them (except for leaving off the modulus signs in your logarithms)? If you try to write your separable equation as y in terms of x, you should get something that is correct up to an integration constant.
$\displaystyle \ln \left|\frac{(y+1)(y-1)}{y^2}\right|=x^2+C$

$\displaystyle \frac{(y+1)(y-1)}{y^2}=\pm e^{(x^2+C)}=\pm e^Ce^{x^2}$

$\displaystyle \frac{(y+1)(y-1)}{y^2}=C'e^{x^2}$, where $\displaystyle C'=\pm e^C$

$\displaystyle y^2-1=C'e^{x^2}y^2$

$\displaystyle y^2(1-C'e^{x^2})=1$

$\displaystyle y^2=(1-C'e^{x^2})^{-1}$

$\displaystyle y=(1-C'e^{x^2})^{-1/2}$, where $\displaystyle C'$ is the negative of the constant in the Bernoulli method.