# Solve differential equation

## Homework Statement

$\frac{dr}{dt}=r(u-r)$

## Homework Equations

i rewrote this as $\frac{dr}{dt}-ur=-r^2$

i think this is like bernoulli's equation

## The Attempt at a Solution

so i let $w=\frac{1}{r}$ so that $r=\frac{1}{w}$
this gives me

$\frac{dr}{dt}=-1w^{-2}\frac{dw}{dt}$

so now i have
$-w^{-2}\frac{dw}{dt}-uw^{-1}=-w^{-2}$

if i divide by $-w^{-2}$

then i get a linear differential equation

$\frac{dw}{dt}+uw=1$

the integrating factor is $e^{ut}$

so i get $w=\frac{1}{u}+w_0e^{-ut}$

from my definition of $w$ i have $w_0=\frac{1}{r_0}$ and $w=\frac{1}{r}$

so i get $r=\frac{ur_0}{r_0+ue^{-ut}}$

is this right?

## The Attempt at a Solution

lanedance
Homework Helper
check by differentiating and comparing to the original DE

note this equation is separable, so you could do it by direct integration

please explain how i would solve by separation.
thanks

lanedance
Homework Helper
$$\frac{dr}{dt}=r(u-r)$$

gives
$$\int \frac{dr}{r(u-r)}=\int dt$$

though even if you can solve the integral (partial fractions may be a good start) it may be difficult to get into an analytic function for r(t)

HallsofIvy
Homework Helper
$$\frac{dr}{dt}= r(u-r)$$
with u constant.

$$\frac{dr}{r(u-r)}= dt$$

Integrate the left side with respect to r and the right side with respect to t.

( I really hate it when lanedance gets in one or two minutes ahead of me but to have him first with exactly the same timestand- arrrgh!)

ok so i get
$\frac{ln(r)-ln(r-u)}{u}=t$

which i then manipulate (or try to at least ) to get:
$ln\frac{r}{r-u}=ut$

if this is correct then i think i can do:
$\frac{r}{r-u}=e^{ut}$

i know something is wrong cos i dont have $r_0$

im working through an example in jordan and smith (nonlinear ordinary differential equations)
so i know what the answer should be, im trying to get to it tho.
:(