Solve differential equation $\frac{dx}{dt}=a-b x-cx(1-x)=cx^2-x(b+c)+a$ I want to solve the following first- order nonlinear ordinary differential equation:
$\frac{dx}{dt}=a-b x-cx(1-x)=cx^2-x(b+c)+a$
where a,b and c are constants. I rewrote the equation:
$\leftrightarrow 1=\frac{1}{cx^2-x(b+c)+a}\frac{dx}{dt}\\
\leftrightarrow \int 1dt=\int \frac{1}{cx^2-x(b+c)+a} dx\\
\leftrightarrow t+k= \int \frac{1}{cx^2-x(b+c)+a} dx\\
\leftrightarrow t+k= \int \frac{1}{c(x-\frac{b+c}{2c})^2+a-\frac{(b+c)^2}{4c}} dx
$
for some arbitrary number k. How do I solve the last integral? Wolfram-Alpha tells me that it is
$\frac{2tan^{-1}(\frac{-c-b+2cx}{\sqrt{-c^2-b^2-2cb+4ca}})}{\sqrt{-c^2-b^2-2cb+4ca}}$
But I don't know how to calculate that on my own.
 A: The right side has two roots $r_1, r_2$. These roots are then also constant solutions of the ODE.  With these solutions the expression
$$
u=\frac{x-r_1}{x-r_2}
$$
has the derivative
$$
u'=-\frac{(r_2-r_1)}{(x-r_2)^2}\,x'=-c(r_2-r_1)u.
$$
This ODE for $u$ can now be easily solved. After that, back-substitution gives
$$
x=\frac{r_2u-r_1}{u-1}
$$
A: After completing the square the integral has the form:
$\int \frac{1}{c(x-\frac{b+c}{2c})^2+a-\frac{(b+c)^2}{4c}} dx=\frac{1}{c}\int \frac{1}{(x-\frac{b+c}{2c})^2+\frac{a}{c}-\frac{(b+c)^2}{4}} $
By defining $y:=x-\frac{b+c}{2c}$ and $p^2:=\frac{a}{c}-\frac{(b+c)^2}{4}$ we get:
$\frac{1}{c}\int \frac{1}{(x-\frac{b+c}{2c})^2+\frac{a}{c}-\frac{(b+c)^2}{4}}=\frac{1}{c}\int\frac{1}{y^2+p^2}=\frac{1}{c}\frac{arctan(\frac{y}{p})}{p}+k_1=\frac{1}{c}\frac{arctan(\frac{x-\frac{b+c}{2c}}{\sqrt{\frac{a}{c}-\frac{(b+c)^2}{4}}})}{\sqrt{\frac{a}{c}-\frac{(b+c)^2}{4}}}+k_1$ 
for some arbitrary number $k_1$. 
A: The main step is converting the fraction
$$\frac{1}{cx^2+x(b+c)+a}$$
into the form, expected from the integral tables:
$$\int\frac{1}{t^2+q^2}dt=\frac{1}{q}\arctan \frac{t}{q}$$
You take out the extra $c$, complete the square and change variables:
$$\frac{1}{c}\frac{1}{\color{red}{(x+\frac{b+c}{2c})}^2-(\frac{b+c}{2c})^2+\frac{a}{c}}$$
Now you have $t=x+\frac{b+c}{2c}$ and $q^2=\frac{a}{c}+(\frac{b+c}{2c})^2$.
