TITLE: Integration of rational function
QUESTION [1 upvotes]: Please help me in integrating the following:
$$\int \frac{r^2}{(r-n) (-ar^2 + r (1 - an) + n - an^2 - 2m)}dr$$ 
I have done it with the help of Mathematica, I just want to confirm that result. So how could I attempt it by hand? Any suggestions please.

REPLY [1 votes]: $$
-ar^2+r(1-an)+n-an^2-2m = -a\left[\left(r-\alpha\right)^2-\beta^2\right]
$$
where
$$
\alpha = -\frac{1}{2}\left(\frac{1}{a}-n\right)\\
\beta = \sqrt{\frac{1}{a}\left(n-an^2-2m\right)+\alpha^2}
$$
thus your integral is
$$
-\frac{1}{a}\int \frac{r^2}{(r-n)(r-\alpha-\beta)(r-\alpha+\beta)}dr
$$
then you can do as the previous poster stated using partial sums but it looks a bit easier for bookkeeping.
{"set_name": "stack_exchange", "score": 1, "question_id": 1114991}