After working on an ODE I find I am needing to solve the integral
$$\int \frac{u}{b - au - u^2}\mathrm{d}u$$
Trig subs, banging heads against walls, and sobbing have not yielded a solution. Yet.
Could use a hand, thanks.
After working on an ODE I find I am needing to solve the integral
$$\int \frac{u}{b - au - u^2}\mathrm{d}u$$
Trig subs, banging heads against walls, and sobbing have not yielded a solution. Yet.
Could use a hand, thanks.
You can write $b-au-u^2=\frac{a^2+4b}{4}-(u+\frac a2)^2$
There are thus three cases to consider
A. $a^2+4b=0$
Then your integral is
$$\int\frac{\mathrm{d}u}{b-au-u^2}=-\int\frac{\mathrm{d}u}{(u+\frac a2)^2}=\frac{1}{u+\frac a2}+C$$
B. $a^2+4b>0$
The trinomial $b-au-u^2$ has two real roots $\alpha,\beta$
$$\alpha=\frac{-a+\sqrt{a^2+4b}}{2}$$ $$\beta=\frac{-a-\sqrt{a^2+4b}}{2}$$
Partial fraction decomposition yields
$$\frac{1}{b-au-u^2}=\frac{1}{\beta-\alpha}\frac{1}{u-\alpha}-\frac{1}{\beta-\alpha}\frac{1}{u-\beta}$$
Hence
$$\int\frac{\mathrm{d}u}{b-au-u^2}=\frac{1}{\beta-\alpha}\int \left(\frac{1}{u-\alpha}-\frac{1}{u-\beta}\right)\,\mathrm{d}u=\frac{1}{\beta-\alpha}\ln \left|\frac{u-\alpha}{u-\beta}\right|+C$$
C. $a^2+4b<0$
The trinomial $b-au-u^2$ has two complex roots. Let's apply the change of variable $u=\lambda t$ with $\lambda=\frac12\sqrt{|a^2+4b|}$:
$$\int\frac{\mathrm{d}u}{b-au-u^2}=\int\frac{\mathrm{d}u}{\frac{a^2+4b}{4}-(u+\frac a2)^2}=\int \frac{\lambda\,\mathrm{d}t}{-\lambda^2-(\lambda t+\frac a2)^2}\\=-\frac1\lambda\int \frac{\mathrm{d}t}{1+(t+\frac a{2\lambda})^2}=-\frac1\lambda\mathrm{Arctan}\left(t+\frac{a}{2\lambda}\right)+C\\=-\frac{2}{\sqrt{|a^2+4b|}}\mathrm{Arctan}\left(\frac{2u+a}{\sqrt{|a^2+4b|}}\right)+C$$
There is another solution in the case $a^2+4b>0$
Let's apply the change of variable $u=\lambda t$ with $\lambda=\frac12\sqrt{a^2+4b}$:
$$\int\frac{\mathrm{d}u}{b-au-u^2}=\int\frac{\mathrm{d}u}{\frac{a^2+4b}{4}-(u+\frac a2)^2}=\int \frac{\lambda\,\mathrm{d}t}{\lambda^2-(\lambda t+\frac a2)^2}\\=\frac1\lambda\int \frac{\mathrm{d}t}{1-(t+\frac a{2\lambda})^2}=\frac1\lambda\mathrm{Argth}\left(t+\frac{a}{2\lambda}\right)+C\\=\frac{2}{\sqrt{a^2+4b}}\mathrm{Argth}\left(\frac{2u+a}{\sqrt{a^2+4b}}\right)+C$$
It's valid if $\left|\frac{2u+a}{\sqrt{a^2+4b}}\right|<1$. Outside of this interval, the integral is instead
$$\frac{2}{\sqrt{a^2+4b}}\mathrm{Argcoth}\left(\frac{2u+a}{\sqrt{a^2+4b}}\right)+C$$
Notice that $\mathrm{Argth} x=\frac12\ln\frac{1+x}{1-x}$, defined for $|x|<1$ whereas $\mathrm{Argcoth} x=\frac12\ln\frac{x+1}{x-1}$, defined for $|x|>1$. Their derivative is the same, $\frac{1}{1-x^2}$.
Another approach is to use partial fraction
$$ \frac{u}{b-au-u^2} = \frac{A}{u-\alpha}+\frac{B}{u-\beta} $$
where $\alpha, \beta$ are the roots of $ b-au-u^2 $. You need to determine $A$ and $B$. The answer will have the form
$$ I = A\ln(u-\alpha)+B\ln(u-\beta)+C. $$
Note: Here are the roots
$$ \alpha = -\frac{a}{2}+\frac{\sqrt {{a}^{2}+4\,b}}{2},\quad \beta = -\frac{a}{2}-\frac{\sqrt {{a}^{2}+4\,b}}{2} $$