# Solving differential equation(separable)

1. Feb 20, 2014

### aerograce

Let y be a solution of the di®erential equation,
$\frac{dy}{dx}$=$\frac{y-1}{x+1}$

such that

y(0)=0;

Then y(1) is:

My attempt:

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

ln|y-1|= ln |x+1| +C

Problems start to occur from here:

My method:

When x=0, y=0. Hence ln0=ln0+C C=0;
When x=1, ln|y-1|= ln2 + 0;
Hence |y-1| = 2
y=3 or y=-1.

My teacher's method
$\frac{1}{y-1}$dy=$\frac{1}{x+1}$dx

ln|y-1|= ln |x+1| +C

(y-1)=A(x+1)

Because y(0)=0 Hence A=-1

And when x=1, y-1=-2 y=-1

I am quite confused. My method seems to be legit also, but why I got different answer.

2. Feb 20, 2014

### pasmith

You of course mean $\ln 1 = \ln 1 + C$ so that $0 = 0 + C$.

If you look at the ODE you'll see that if $y < 1$ then $dy/dx < 0$ and if $y > 1$ then $dy/dx > 0$ (in both cases this assumes $x \geq 0$). Thus if $y(0) < 1$ then $y(x) < 1$ for all $x \geq 0$, so you must take $|y - 1| = 1 - y$.