# separable differential equation xy'+y=y^2 when y(1)=-1

• Mar 18th 2009, 03:32 AM
Craka
separable differential equation xy'+y=y^2 when y(1)=-1
The question is to find the solution for
$\displaystyle xy'+y=Y^2$ for when y(1)=-1

here is my working

$\displaystyle \begin{array}{l} xy' + y = y^2 \\ y(1) = - 1 \\ x\frac{{dy}}{{dx}} = y^2 - y \\ \int {\frac{{dy}}{{y^2 - y}} = \int {\frac{{dx}}{x}} } \\ \int {\frac{1}{{y^2 - y}}dy = \int {\frac{1}{x}dx} } \\ \end{array}$

then by partial fractions the left hand side is
$\displaystyle \begin{array}{l} LHS = \int {\frac{1}{{y^2 - y}}dy} \\ \frac{1}{{y^2 - y}} = \frac{A}{y} + \frac{B}{{(y - 1)}} \\ 1 = (A + B)y - A \\ A = - 1 \\ A + B = 0 \\ B = 1 \\ \int {\frac{1}{{y^2 - y}}dy} = \int {\frac{{ - 1}}{y}dy + \int {\frac{1}{{y - 1}}dy} } \\ = - \ln y + \ln |y - 1| \\ \end{array}$

and right hand side is
$\displaystyle \begin{array}{l} RHS = \int {\frac{1}{x}dx} \\ = \ln x + c \\ \end{array}$

so
$\displaystyle - \ln y + \ln |y - 1| = \ln x + c$

raising by power of e

$\displaystyle \begin{array}{l} - y + y - 1 = x + e^c \\ - 1 = x + e^c \\ \end{array}$

But this does not appear to me to be right, as the y term has fallen off all together, and I don't have the answer for this problem to check, plus am confused where the y(1)=-1 comes in.
• Mar 18th 2009, 04:12 AM
mr fantastic
Quote:

Originally Posted by Craka
The question is to find the solution for
$\displaystyle xy'+y=Y^2$ for when y(1)=-1

here is my working

$\displaystyle \begin{array}{l} xy' + y = y^2 \\ y(1) = - 1 \\ x\frac{{dy}}{{dx}} = y^2 - y \\ \int {\frac{{dy}}{{y^2 - y}} = \int {\frac{{dx}}{x}} } \\ \int {\frac{1}{{y^2 - y}}dy = \int {\frac{1}{x}dx} } \\ \end{array}$

then by partial fractions the left hand side is
$\displaystyle \begin{array}{l} LHS = \int {\frac{1}{{y^2 - y}}dy} \\ \frac{1}{{y^2 - y}} = \frac{A}{y} + \frac{B}{{(y - 1)}} \\ 1 = (A + B)y - A \\ A = - 1 \\ A + B = 0 \\ B = 1 \\ \int {\frac{1}{{y^2 - y}}dy} = \int {\frac{{ - 1}}{y}dy + \int {\frac{1}{{y - 1}}dy} } \\ = - \ln y + \ln |y - 1| \\ \end{array}$

and right hand side is
$\displaystyle \begin{array}{l} RHS = \int {\frac{1}{x}dx} \\ = \ln x + c \\ \end{array}$

so
$\displaystyle - \ln y + \ln |y - 1| = \ln x + c$

raising by power of e

Mr F says: Below is where your error lies (assuming previous working is correct - I have not checked thoroughly).

$\displaystyle \begin{array}{l} - y + y - 1 = x + e^c \\ - 1 = x + e^c \\ \end{array}$

But this does not appear to me to be right, as the y term has fallen off all together, and I don't have the answer for this problem to check, plus am confused where the y(1)=-1 comes in.

$\displaystyle - \ln |y| + \ln |y - 1| = \ln |x| + c$

$\displaystyle \Rightarrow \ln \left| \frac{y - 1}{y} \right| = \ln |x| + c$

Exponentiate both sides to base e:

$\displaystyle \frac{y - 1}{y} = x e^c = Ax$.

Now your job is to make y the subject.
• Mar 18th 2009, 04:23 AM
Craka
Doh, thanks. Why can I never remember my log rules!!!
• Mar 18th 2009, 07:49 AM
mpl06c
an easier way would to use Bernoulli differentiation
• Mar 18th 2009, 09:39 AM
Jester
Even easier is to notice that

$\displaystyle xy' + y = y^2$ becomes $\displaystyle \frac{d}{dx} xy = y^2$ so $\displaystyle \frac{d (xy)}{(xy)^2} = \frac{dx}{x^2}$ so $\displaystyle \frac{1}{xy} = \frac{1}{x} + c$
• Mar 18th 2009, 06:04 PM
mpl06c
idont think that is correct??
• Mar 18th 2009, 06:34 PM
mr fantastic
Quote:

Originally Posted by mpl06c
idont think that is correct??

1. You should quote the post you're referring to so that what you say can be understood.

2. If you're going to say something like this, you should back it up with a reason.

3. All forms of the solution given in this thread are correct, as can be easily confirmed by substitution into the given DE.