<s>[INST] 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.
 [/INST] 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$. 
</s>