# Solving a differential Eq. by separation of variables

1. Feb 5, 2013

### Duderonimous

1. The problem statement, all variables and given/known data
Find all solutions. Solve explicitly for y.

y$^{'}$=y$^{2}$-y

2. Relevant equations

3. The attempt at a solution
Case where y'=0

0=y(y-1) y=0,1 when y(t)=0

Case where y'$\neq$0

y'=y$^{2}$-y

$\frac{1}{y^{2}-y}$y'=1

$\int\frac{1}{y^{2}-y}$y'dt=∫1dt

$\int\frac{1}{y^{2}-y}$dy=t+c

Cant figure our where to go from here.

Last edited: Feb 5, 2013
2. Feb 5, 2013

### Karnage1993

$\displaystyle\frac{1}{y^2 - y} = \frac{1}{y(y-1)}$

Use partial fraction decomposition to split the above into the form $\displaystyle\frac{A}{y} + \frac{B}{y - 1}$. Then, integrating will be a breeze.

3. Feb 5, 2013

### Duderonimous

\displaystyle\frac{A}{y} + \frac{B}{y - 1}

1=A(y-1)+By
1=Ay-A+By
A=-1
B=1

$\int\frac{1}{y(y-1)}$=$\int\frac{-1}{y}+\frac{1}{y-1}$

$\int\frac{-1}{y}+\frac{1}{y-1}$=t+c

-ln|y|+ln|y-1|=t+c

ln($\frac{y-1}{y}$)=t+c

ln(1-$\frac{1}{y}$)=t+c

1-$\frac{1}{y}$=e$^{t+c}$

y=$\frac{1}{1-e^{t+c}}$

I dont think this is right, wolfram alpha says it is y=$\frac{1}{1+e^{t+c}}$

How does the plus sign pop up into the denominator?

4. Feb 5, 2013

### VantagePoint72

You've assumed |y-1| = y-1. Is this consistent with the range of y you get when you push on to the solution? The absolute value matters, you can't just drop it and move on.

5. Feb 5, 2013

### Karnage1993

I believe it's due to the fact that the $|y - 1|$ can also be written as $|1 - y|$, perhaps that is what Wolfram used. In any case, note that $e^{t+c} = e^ce^t = ce^t$ because $e^c$ is still a constant. So $\displaystyle y = \frac{1}{1 - ce^t}$ would be the best way to write the answer, since if $c$ is indeed negative, it would look like what Wolfram has.

6. Feb 5, 2013

### SammyS

Staff Emeritus
If 0 < y < 1 , then $\displaystyle 1-\frac{1}{y}<0\,,\$ so that $\displaystyle \left|1-\frac{1}{y}\right|=-\left(1-\frac{1}{y}\right)\ .$

That will give $\displaystyle 1-\frac{1}{y}=-e^{t+C}\ .$

...

7. Feb 6, 2013

### HallsofIvy

Staff Emeritus
You were asked to find all solutions. Your formula, once you have solved for y, will give all except one solution. What is the solution you are missing?

8. Feb 6, 2013

### Duderonimous

It wont give the y solution where y(t)=0 so all solutions for y are

y=$\frac{1}{1 - ce^t}$,0

where c is any real number

Right?

9. Feb 6, 2013

### HallsofIvy

Staff Emeritus
Yes, that is correct.