# Differential equation with variable initial condition

Initially we solve the first order differential equation

$$\frac{dv}{dt}=-a(v^2+\frac{b}{a})$$

where $$a$$, $$b$$ are constants. I derive the following with separation of variables

$$\sqrt{\frac{a}{b}}\arctan\left(v\sqrt{\frac{a}{b}}\right)=-ta+D$$

To find $$D$$ the initial condition is at $$t=0$$, $$v=p$$. How do I find $$D$$?

• Plug in $t=0$ and $v=p$, it seems to give you $D$ directly in this case (no algebra required). Of course $D$ will depend on $p$ but that's OK. – Ian Nov 8 '18 at 16:10

$$\sqrt{\frac{a}{b}}\arctan(v\sqrt{\frac{a}{b}})=-at+D$$
Plug in $$v=p$$ and $$t=0$$ gives:
$$D = \sqrt{\frac{a}{b}}\arctan(p\sqrt{\frac{a}{b}})$$
Since $$a,b,p$$ are all constants $$D$$ is also a constant and you are done. The hardest part of course here was the solution itself.