# The best way of integrating irrational functions

Ok, so, here is the example integral: $$I=\int\frac{x-2-\sqrt{-x^2-4x+4}}{x^2-\sqrt{-x^2-4x+4}}dx$$ I always solve these types of integrals using Euler's substitutions, but, recently, I came across some more difficult integrals like the one above which, after using Euler's substitution, become the integral of a rational function which is too complex to calculate, or at least to me.

So, what I did with the integral above is use second Euler's substitution: $$\sqrt{ax^2+bx+c}=x\cdot t \pm \sqrt{c}$$ which gives: $$\sqrt{-x^2-4x+4}=x\cdot t-2$$ Then, we have: $$x=\frac{4-2t}{1-t^2},\ \ \ dx=\frac{2(t^2-1)+2t(4-2t)}{(1-t^2)^2}dt$$ After the substitution, the integral becomes: $$I=\int \frac{\frac{4-2t}{1-t^2}-2-\frac{4-2t}{1-t^2}\cdot t+2}{\frac{(4-2t)^2}{(1-t^2)^2}-\frac{4-2t}{1-t^2}\cdot t+2}\cdot \frac{2(t^2-1)+2t(4-2t)}{(1-t^2)^2}dt$$ Which, after some calculation is: $$I=\int\frac{8-40t+24t^3-8t^4}{2t^3-6t^2+14t-14}dt$$ Then, I can divide them and get two integrals, one from the table and the other one of a rational function with numerator's degree lower than denominator's. Then, I should integrate that remaining rational function, but I'm not sure how, since I can't factor the polynomial in denominator.

My question is, is there a simpler way to calculate integrals like this one and if there isn't, what do I do with the remaining integral of rational function? What if I get a polynomial of degree $5$, $6$, $7$ etc. in denominator? Thank you for your time.

• As much as I like this integral to have a simple closed form, do you think that this integral has a simple closed form in the first place? Commented Mar 16, 2016 at 21:55
• Yeah, I have a solution, but no idea how to get to it.
– A6SE
Commented Mar 28, 2016 at 21:32
• $x=(4-2t)/(1-t^2)$ should be wrong. Commented Mar 29, 2016 at 6:26
• What is the answer that you have? Commented Apr 2, 2016 at 23:59
• As I wrote I used the answer field because it was impossible to write my text as a comment. When I used the add comment field I reached the maximum number of characters. What I did is just point out a computational mistake and reduce the degree of the numerator of the rational function to be integrated. Note that it is possible to find the roots of the denominator by using the Cardano formula. It is quite long but you can find one negative real root and two complex conjugate one.
– Upax
Commented Apr 3, 2016 at 7:23

There is a mistake in your computation. I added my comments here since there is a limited number of characters I can put into the comment window. $$x=\frac{4-2t}{1-t^2},\ \ \ dx=\frac{-2(t^2-4 t+1)}{(1-t^2)^2}dt$$ Then after the substitution, the integral becomes: $$I=\int \frac{\frac{4-2t}{1-t^2}-2-\frac{4-2t}{1-t^2}\cdot t+2}{\frac{(4-2t)^2}{(1-t^2)^2}-\frac{4-2t}{1-t^2}\cdot t+2}\cdot \frac{-2(t^2-4 t+1)}{(1-t^2)^2}dt$$ Which, after some calculation is: $$I=\int \frac{2 (t-2) ((t-4) t+1)}{(t+1) (t (t-2) (2 t+5)+9)} dt$$ Then, I can divide them and get two integrals: $$I=\int \frac{-2}{(t+1)} dt + \int \frac{6 t^2-16 t+14}{2 t^3+t^2-10 t+9} dt =-2 \log (t+1) +\int \frac{6 t^2+2 t -10}{2 t^3+t^2-10 t+9}+\int \frac{24- 18 t}{2 t^3+t^2-10 t+9}=-2 \log (t+1)+\log (2 t^3+t^2-10 t+9)+2 \int \frac{12- 9 t}{2 t^3+t^2-10 t+9}$$