Integrand size = 33, antiderivative size = 79 \[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\frac {\sqrt {4-5 x^2+x^4}}{x}-4 \text {arctanh}\left (\frac {-2+x+x^2}{\sqrt {4-5 x^2+x^4}}\right )+2 \sqrt {3} \text {arctanh}\left (\frac {\sqrt {4-5 x^2+x^4}}{\sqrt {3} \left (-2+x+x^2\right )}\right ) \] Output:
(x^4-5*x^2+4)^(1/2)/x-4*arctanh((x^2+x-2)/(x^4-5*x^2+4)^(1/2))+2*3^(1/2)*a rctanh(1/3*(x^4-5*x^2+4)^(1/2)*3^(1/2)/(x^2+x-2))
Time = 0.56 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.00 \[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\frac {\sqrt {4-5 x^2+x^4}}{x}-4 \text {arctanh}\left (\frac {-2+x+x^2}{\sqrt {4-5 x^2+x^4}}\right )+2 \sqrt {3} \text {arctanh}\left (\frac {\sqrt {4-5 x^2+x^4}}{\sqrt {3} \left (-2+x+x^2\right )}\right ) \] Input:
Integrate[((2 + x^2)*Sqrt[4 - 5*x^2 + x^4])/(x^2*(-2 + 2*x + x^2)),x]
Output:
Sqrt[4 - 5*x^2 + x^4]/x - 4*ArcTanh[(-2 + x + x^2)/Sqrt[4 - 5*x^2 + x^4]] + 2*Sqrt[3]*ArcTanh[Sqrt[4 - 5*x^2 + x^4]/(Sqrt[3]*(-2 + x + x^2))]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 2.16 (sec) , antiderivative size = 808, normalized size of antiderivative = 10.23, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.061, Rules used = {7279, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\left (x^2+2\right ) \sqrt {x^4-5 x^2+4}}{x^2 \left (x^2+2 x-2\right )} \, dx\) |
\(\Big \downarrow \) 7279 |
\(\displaystyle \int \left (\frac {\sqrt {x^4-5 x^2+4} (x+4)}{x^2+2 x-2}-\frac {\sqrt {x^4-5 x^2+4}}{x}-\frac {\sqrt {x^4-5 x^2+4}}{x^2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \text {arctanh}\left (\frac {8-5 x^2}{4 \sqrt {x^4-5 x^2+4}}\right )+\frac {1}{8} \left (9+\sqrt {3}\right ) \text {arctanh}\left (\frac {5-2 x^2}{2 \sqrt {x^4-5 x^2+4}}\right )+\frac {1}{8} \left (9-\sqrt {3}\right ) \text {arctanh}\left (\frac {5-2 x^2}{2 \sqrt {x^4-5 x^2+4}}\right )-\frac {5}{4} \text {arctanh}\left (\frac {5-2 x^2}{2 \sqrt {x^4-5 x^2+4}}\right )+\frac {1}{2} \sqrt {3} \text {arctanh}\left (\frac {2 \left (6-5 \sqrt {3}\right )-\left (3-4 \sqrt {3}\right ) x^2}{2 \sqrt {6 \left (2-\sqrt {3}\right )} \sqrt {x^4-5 x^2+4}}\right )-\frac {1}{2} \sqrt {3} \text {arctanh}\left (\frac {2 \left (6+5 \sqrt {3}\right )-\left (3+4 \sqrt {3}\right ) x^2}{2 \sqrt {6 \left (2+\sqrt {3}\right )} \sqrt {x^4-5 x^2+4}}\right )-\frac {\sqrt {\frac {1}{3} \left (45+26 \sqrt {3}\right )} \sqrt {4-x^2} \sqrt {-\left (\left (3-2 \sqrt {3}\right ) x^2\right )-2 \sqrt {3}+3} \operatorname {EllipticF}\left (\arccos \left (\frac {x}{2}\right ),\frac {4}{3}\right )}{\sqrt {x^4-5 x^2+4}}-\frac {\left (2-\sqrt {3}\right ) \sqrt {\left (3-2 \sqrt {3}\right ) x^2-4 \left (3-2 \sqrt {3}\right )} \sqrt {-\left (\left (3+2 \sqrt {3}\right ) x^2\right )+2 \sqrt {3}+3} \operatorname {EllipticF}\left (\arcsin (x),\frac {1}{4}\right )}{2 \sqrt {x^4-5 x^2+4}}-\frac {\sqrt {2} \left (x^2+2\right ) \sqrt {\frac {x^4-5 x^2+4}{\left (x^2+2\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {x}{\sqrt {2}}\right ),\frac {9}{8}\right )}{\sqrt {x^4-5 x^2+4}}+\frac {\left (x^2+2\right ) \sqrt {\frac {x^4-5 x^2+4}{\left (x^2+2\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {x}{\sqrt {2}}\right ),\frac {9}{8}\right )}{2 \sqrt {2} \sqrt {x^4-5 x^2+4}}-\frac {3 \sqrt {1-x^2} \sqrt {4-x^2} \operatorname {EllipticPi}\left (\frac {1}{2} \left (2-\sqrt {3}\right ),\arcsin (x),\frac {1}{4}\right )}{2 \sqrt {x^4-5 x^2+4}}-\frac {\sqrt {3} \sqrt {\left (3-2 \sqrt {3}\right ) x^2-4 \left (3-2 \sqrt {3}\right )} \sqrt {-\left (\left (3+2 \sqrt {3}\right ) x^2\right )+2 \sqrt {3}+3} \operatorname {EllipticPi}\left (\frac {1}{2} \left (2+\sqrt {3}\right ),\arcsin (x),\frac {1}{4}\right )}{2 \sqrt {x^4-5 x^2+4}}+\frac {\sqrt {x^4-5 x^2+4}}{x}+\frac {1}{4} \left (1+\sqrt {3}\right ) \sqrt {x^4-5 x^2+4}+\frac {1}{4} \left (1-\sqrt {3}\right ) \sqrt {x^4-5 x^2+4}-\frac {1}{2} \sqrt {x^4-5 x^2+4}\) |
Input:
Int[((2 + x^2)*Sqrt[4 - 5*x^2 + x^4])/(x^2*(-2 + 2*x + x^2)),x]
Output:
-1/2*Sqrt[4 - 5*x^2 + x^4] + ((1 - Sqrt[3])*Sqrt[4 - 5*x^2 + x^4])/4 + ((1 + Sqrt[3])*Sqrt[4 - 5*x^2 + x^4])/4 + Sqrt[4 - 5*x^2 + x^4]/x + ArcTanh[( 8 - 5*x^2)/(4*Sqrt[4 - 5*x^2 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rt[3]) + (3 - 2*Sqrt[3])*x^2]*Sqrt[3 + 2*Sqrt[3] - (3 + 2*Sqrt[3])*x ^2]*EllipticPi[(2 + Sqrt[3])/2, ArcSin[x], 1/4])/(2*Sqrt[4 - 5*x^2 + x^4])
Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[ {v = RationalFunctionExpand[u/(a + b*x^n + c*x^(2*n)), x]}, Int[v, x] /; Su mQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]
Time = 1.46 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.91
method | result | size |
risch | \(\frac {\sqrt {x^{4}-5 x^{2}+4}}{x}-2 \ln \left (\frac {x^{2}+\sqrt {x^{4}-5 x^{2}+4}-2}{x}\right )+\sqrt {3}\, \operatorname {arctanh}\left (\frac {\left (2 x^{2}+x -4\right ) \sqrt {3}}{3 \sqrt {x^{4}-5 x^{2}+4}}\right )\) | \(72\) |
default | \(\frac {\sqrt {3}\, \operatorname {arctanh}\left (\frac {\left (2 x^{2}+x -4\right ) \sqrt {3}}{3 \sqrt {x^{4}-5 x^{2}+4}}\right ) x -2 \ln \left (\frac {x^{2}+\sqrt {x^{4}-5 x^{2}+4}-2}{x}\right ) x +\sqrt {x^{4}-5 x^{2}+4}}{x}\) | \(74\) |
pseudoelliptic | \(\frac {\sqrt {3}\, \operatorname {arctanh}\left (\frac {\left (2 x^{2}+x -4\right ) \sqrt {3}}{3 \sqrt {x^{4}-5 x^{2}+4}}\right ) x -2 \ln \left (\frac {x^{2}+\sqrt {x^{4}-5 x^{2}+4}-2}{x}\right ) x +\sqrt {x^{4}-5 x^{2}+4}}{x}\) | \(74\) |
trager | \(\frac {\sqrt {x^{4}-5 x^{2}+4}}{x}+2 \ln \left (-\frac {-x^{2}+\sqrt {x^{4}-5 x^{2}+4}+2}{x}\right )-\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) \ln \left (\frac {2 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{2}+\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x -4 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right )-3 \sqrt {x^{4}-5 x^{2}+4}}{x^{2}+2 x -2}\right )\) | \(107\) |
elliptic | \(-\ln \left (-\frac {5}{2}+x^{2}+\sqrt {x^{4}-5 x^{2}+4}\right )+\frac {\left (9+5 \sqrt {3}\right ) \sqrt {3}\, \operatorname {arctanh}\left (\frac {24+12 \sqrt {3}+\left (3+4 \sqrt {3}\right ) \left (x^{2}-4-2 \sqrt {3}\right )}{2 \left (3+\sqrt {3}\right ) \sqrt {\left (x^{2}-4-2 \sqrt {3}\right )^{2}+\left (3+4 \sqrt {3}\right ) \left (x^{2}-4-2 \sqrt {3}\right )+12+6 \sqrt {3}}}\right )}{2 \left (2+\sqrt {3}\right ) \left (3+\sqrt {3}\right )}-\frac {\operatorname {arctanh}\left (\frac {-5 x^{2}+8}{4 \sqrt {x^{4}-5 x^{2}+4}}\right )}{\left (2+\sqrt {3}\right ) \left (\sqrt {3}-2\right )}-\frac {\left (-9+5 \sqrt {3}\right ) \sqrt {3}\, \operatorname {arctanh}\left (\frac {24-12 \sqrt {3}+\left (3-4 \sqrt {3}\right ) \left (x^{2}-4+2 \sqrt {3}\right )}{2 \left (3-\sqrt {3}\right ) \sqrt {\left (x^{2}-4+2 \sqrt {3}\right )^{2}+\left (3-4 \sqrt {3}\right ) \left (x^{2}-4+2 \sqrt {3}\right )+12-6 \sqrt {3}}}\right )}{2 \left (\sqrt {3}-2\right ) \left (3-\sqrt {3}\right )}+\frac {\left (\frac {\sqrt {x^{4}-5 x^{2}+4}\, \sqrt {2}}{x}-\sqrt {6}\, \operatorname {arctanh}\left (\frac {\sqrt {6}\, \sqrt {x^{4}-5 x^{2}+4}\, \sqrt {2}}{6 x}\right )\right ) \sqrt {2}}{2}\) | \(318\) |
Input:
int((x^2+2)*(x^4-5*x^2+4)^(1/2)/x^2/(x^2+2*x-2),x,method=_RETURNVERBOSE)
Output:
(x^4-5*x^2+4)^(1/2)/x-2*ln((x^2+(x^4-5*x^2+4)^(1/2)-2)/x)+3^(1/2)*arctanh( 1/3*(2*x^2+x-4)*3^(1/2)/(x^4-5*x^2+4)^(1/2))
Time = 0.19 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.46 \[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\frac {\sqrt {3} x \log \left (-\frac {7 \, x^{4} + 4 \, x^{3} + 2 \, \sqrt {3} \sqrt {x^{4} - 5 \, x^{2} + 4} {\left (2 \, x^{2} + x - 4\right )} - 30 \, x^{2} - 8 \, x + 28}{x^{4} + 4 \, x^{3} - 8 \, x + 4}\right ) + 4 \, x \log \left (\frac {x^{2} - \sqrt {x^{4} - 5 \, x^{2} + 4} - 2}{x}\right ) + 2 \, \sqrt {x^{4} - 5 \, x^{2} + 4}}{2 \, x} \] Input:
integrate((x^2+2)*(x^4-5*x^2+4)^(1/2)/x^2/(x^2+2*x-2),x, algorithm="fricas ")
Output:
1/2*(sqrt(3)*x*log(-(7*x^4 + 4*x^3 + 2*sqrt(3)*sqrt(x^4 - 5*x^2 + 4)*(2*x^ 2 + x - 4) - 30*x^2 - 8*x + 28)/(x^4 + 4*x^3 - 8*x + 4)) + 4*x*log((x^2 - sqrt(x^4 - 5*x^2 + 4) - 2)/x) + 2*sqrt(x^4 - 5*x^2 + 4))/x
\[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\int \frac {\sqrt {\left (x - 2\right ) \left (x - 1\right ) \left (x + 1\right ) \left (x + 2\right )} \left (x^{2} + 2\right )}{x^{2} \left (x^{2} + 2 x - 2\right )}\, dx \] Input:
integrate((x**2+2)*(x**4-5*x**2+4)**(1/2)/x**2/(x**2+2*x-2),x)
Output:
Integral(sqrt((x - 2)*(x - 1)*(x + 1)*(x + 2))*(x**2 + 2)/(x**2*(x**2 + 2* x - 2)), x)
\[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\int { \frac {\sqrt {x^{4} - 5 \, x^{2} + 4} {\left (x^{2} + 2\right )}}{{\left (x^{2} + 2 \, x - 2\right )} x^{2}} \,d x } \] Input:
integrate((x^2+2)*(x^4-5*x^2+4)^(1/2)/x^2/(x^2+2*x-2),x, algorithm="maxima ")
Output:
integrate(sqrt(x^4 - 5*x^2 + 4)*(x^2 + 2)/((x^2 + 2*x - 2)*x^2), x)
\[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\int { \frac {\sqrt {x^{4} - 5 \, x^{2} + 4} {\left (x^{2} + 2\right )}}{{\left (x^{2} + 2 \, x - 2\right )} x^{2}} \,d x } \] Input:
integrate((x^2+2)*(x^4-5*x^2+4)^(1/2)/x^2/(x^2+2*x-2),x, algorithm="giac")
Output:
integrate(sqrt(x^4 - 5*x^2 + 4)*(x^2 + 2)/((x^2 + 2*x - 2)*x^2), x)
Timed out. \[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\int \frac {\left (x^2+2\right )\,\sqrt {x^4-5\,x^2+4}}{x^2\,\left (x^2+2\,x-2\right )} \,d x \] Input:
int(((x^2 + 2)*(x^4 - 5*x^2 + 4)^(1/2))/(x^2*(2*x + x^2 - 2)),x)
Output:
int(((x^2 + 2)*(x^4 - 5*x^2 + 4)^(1/2))/(x^2*(2*x + x^2 - 2)), x)
\[ \int \frac {\left (2+x^2\right ) \sqrt {4-5 x^2+x^4}}{x^2 \left (-2+2 x+x^2\right )} \, dx=\frac {2 \sqrt {x^{4}-5 x^{2}+4}\, x +9 \sqrt {x^{4}-5 x^{2}+4}+72 \left (\int \frac {\sqrt {x^{4}-5 x^{2}+4}}{x^{7}+2 x^{6}-7 x^{5}-10 x^{4}+14 x^{3}+8 x^{2}-8 x}d x \right ) x -18 \left (\int \frac {\sqrt {x^{4}-5 x^{2}+4}}{x^{6}+2 x^{5}-7 x^{4}-10 x^{3}+14 x^{2}+8 x -8}d x \right ) x -4 \left (\int \frac {\sqrt {x^{4}-5 x^{2}+4}\, x^{5}}{x^{6}+2 x^{5}-7 x^{4}-10 x^{3}+14 x^{2}+8 x -8}d x \right ) x -8 \left (\int \frac {\sqrt {x^{4}-5 x^{2}+4}\, x^{4}}{x^{6}+2 x^{5}-7 x^{4}-10 x^{3}+14 x^{2}+8 x -8}d x \right ) x +11 \left (\int \frac {\sqrt {x^{4}-5 x^{2}+4}\, x^{2}}{x^{6}+2 x^{5}-7 x^{4}-10 x^{3}+14 x^{2}+8 x -8}d x \right ) x -20 \left (\int \frac {\sqrt {x^{4}-5 x^{2}+4}\, x}{x^{6}+2 x^{5}-7 x^{4}-10 x^{3}+14 x^{2}+8 x -8}d x \right ) x}{9 x} \] Input:
int((x^2+2)*(x^4-5*x^2+4)^(1/2)/x^2/(x^2+2*x-2),x)
Output:
(2*sqrt(x**4 - 5*x**2 + 4)*x + 9*sqrt(x**4 - 5*x**2 + 4) + 72*int(sqrt(x** 4 - 5*x**2 + 4)/(x**7 + 2*x**6 - 7*x**5 - 10*x**4 + 14*x**3 + 8*x**2 - 8*x ),x)*x - 18*int(sqrt(x**4 - 5*x**2 + 4)/(x**6 + 2*x**5 - 7*x**4 - 10*x**3 + 14*x**2 + 8*x - 8),x)*x - 4*int((sqrt(x**4 - 5*x**2 + 4)*x**5)/(x**6 + 2 *x**5 - 7*x**4 - 10*x**3 + 14*x**2 + 8*x - 8),x)*x - 8*int((sqrt(x**4 - 5* x**2 + 4)*x**4)/(x**6 + 2*x**5 - 7*x**4 - 10*x**3 + 14*x**2 + 8*x - 8),x)* x + 11*int((sqrt(x**4 - 5*x**2 + 4)*x**2)/(x**6 + 2*x**5 - 7*x**4 - 10*x** 3 + 14*x**2 + 8*x - 8),x)*x - 20*int((sqrt(x**4 - 5*x**2 + 4)*x)/(x**6 + 2 *x**5 - 7*x**4 - 10*x**3 + 14*x**2 + 8*x - 8),x)*x)/(9*x)