Integrand size = 37, antiderivative size = 97 \[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=\text {arctanh}(x)+\frac {1}{6} \left (3 i-\sqrt {3}\right ) \text {arctanh}\left (\frac {1-i \sqrt {3}+2 x}{\sqrt {2 \left (1-i \sqrt {3}\right )}}\right )-\frac {1}{6} \left (3 i+\sqrt {3}\right ) \text {arctanh}\left (\frac {1+i \sqrt {3}+2 x}{\sqrt {2 \left (1+i \sqrt {3}\right )}}\right ) \] Output:
arctanh(x)+1/6*(3*I-3^(1/2))*arctanh((1-I*3^(1/2)+2*x)/(2-2*I*3^(1/2))^(1/ 2))-1/6*(3*I+3^(1/2))*arctanh((1+I*3^(1/2)+2*x)/(2+2*I*3^(1/2))^(1/2))
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.03 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.76 \[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=-\frac {1}{2} \log (1-x)+\frac {1}{2} \log (1+x)+\text {RootSum}\left [1-2 \text {$\#$1}+2 \text {$\#$1}^2+2 \text {$\#$1}^3+\text {$\#$1}^4\&,\frac {\log (x-\text {$\#$1}) \text {$\#$1}}{-1+2 \text {$\#$1}+3 \text {$\#$1}^2+2 \text {$\#$1}^3}\&\right ] \] Input:
Integrate[(1 + x^2)^2/((1 - x^2)*(1 - 2*x + 2*x^2 + 2*x^3 + x^4)),x]
Output:
-1/2*Log[1 - x] + Log[1 + x]/2 + RootSum[1 - 2*#1 + 2*#1^2 + 2*#1^3 + #1^4 & , (Log[x - #1]*#1)/(-1 + 2*#1 + 3*#1^2 + 2*#1^3) & ]
Time = 0.90 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.04, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.054, Rules used = {7276, 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+1\right )^2}{\left (1-x^2\right ) \left (x^4+2 x^3+2 x^2-2 x+1\right )} \, dx\) |
\(\Big \downarrow \) 7276 |
\(\displaystyle \int \left (\frac {1}{1-x^2}+\frac {2 x}{x^4+2 x^3+2 x^2-2 x+1}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {1}{6} \left (3-i \sqrt {3}\right ) \arctan \left (\frac {2 i x-\sqrt {3}+i}{\sqrt {2 \left (1+i \sqrt {3}\right )}}\right )+\frac {1}{6} \left (3+i \sqrt {3}\right ) \arctan \left (\frac {2 i x+\sqrt {3}+i}{\sqrt {2 \left (1-i \sqrt {3}\right )}}\right )+\text {arctanh}(x)\) |
Input:
Int[(1 + x^2)^2/((1 - x^2)*(1 - 2*x + 2*x^2 + 2*x^3 + x^4)),x]
Output:
-1/6*((3 - I*Sqrt[3])*ArcTan[(I - Sqrt[3] + (2*I)*x)/Sqrt[2*(1 + I*Sqrt[3] )]]) + ((3 + I*Sqrt[3])*ArcTan[(I + Sqrt[3] + (2*I)*x)/Sqrt[2*(1 - I*Sqrt[ 3])]])/6 + ArcTanh[x]
Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionE xpand[u/(a + b*x^n), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ [n, 0]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.20 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.53
method | result | size |
risch | \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (9 \textit {\_Z}^{4}+3 \textit {\_Z}^{2}+1\right )}{\sum }\textit {\_R} \ln \left (3 \textit {\_R}^{3}+3 \textit {\_R}^{2}-\textit {\_R} +x +1\right )\right )}{2}+\frac {\ln \left (x +1\right )}{2}-\frac {\ln \left (x -1\right )}{2}\) | \(51\) |
default | \(-\frac {\ln \left (x -1\right )}{2}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}+2 \textit {\_Z}^{3}+2 \textit {\_Z}^{2}-2 \textit {\_Z} +1\right )}{\sum }\frac {\textit {\_R} \ln \left (x -\textit {\_R} \right )}{2 \textit {\_R}^{3}+3 \textit {\_R}^{2}+2 \textit {\_R} -1}\right )+\frac {\ln \left (x +1\right )}{2}\) | \(61\) |
Input:
int((x^2+1)^2/(-x^2+1)/(x^4+2*x^3+2*x^2-2*x+1),x,method=_RETURNVERBOSE)
Output:
1/2*sum(_R*ln(3*_R^3+3*_R^2-_R+x+1),_R=RootOf(9*_Z^4+3*_Z^2+1))+1/2*ln(x+1 )-1/2*ln(x-1)
Time = 0.13 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.78 \[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=-\frac {1}{12} \, \sqrt {3} \log \left (x^{2} + \sqrt {3} {\left (x + 1\right )} + x + 2\right ) + \frac {1}{12} \, \sqrt {3} \log \left (x^{2} - \sqrt {3} {\left (x + 1\right )} + x + 2\right ) + \frac {1}{2} \, \arctan \left (\sqrt {3} x + x - 1\right ) - \frac {1}{2} \, \arctan \left (\sqrt {3} x - x + 1\right ) + \frac {1}{2} \, \log \left (x + 1\right ) - \frac {1}{2} \, \log \left (x - 1\right ) \] Input:
integrate((x^2+1)^2/(-x^2+1)/(x^4+2*x^3+2*x^2-2*x+1),x, algorithm="fricas" )
Output:
-1/12*sqrt(3)*log(x^2 + sqrt(3)*(x + 1) + x + 2) + 1/12*sqrt(3)*log(x^2 - sqrt(3)*(x + 1) + x + 2) + 1/2*arctan(sqrt(3)*x + x - 1) - 1/2*arctan(sqrt (3)*x - x + 1) + 1/2*log(x + 1) - 1/2*log(x - 1)
Time = 0.18 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.00 \[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=- \frac {\log {\left (x - 1 \right )}}{2} + \frac {\log {\left (x + 1 \right )}}{2} + \frac {\sqrt {3} \log {\left (x^{2} + x \left (1 - \sqrt {3}\right ) - \sqrt {3} + 2 \right )}}{12} - \frac {\sqrt {3} \log {\left (x^{2} + x \left (1 + \sqrt {3}\right ) + \sqrt {3} + 2 \right )}}{12} + \frac {\operatorname {atan}{\left (\frac {2 x}{-1 + \sqrt {3}} - 1 \right )}}{2} - \frac {\operatorname {atan}{\left (\frac {2 x}{1 + \sqrt {3}} + 1 \right )}}{2} \] Input:
integrate((x**2+1)**2/(-x**2+1)/(x**4+2*x**3+2*x**2-2*x+1),x)
Output:
-log(x - 1)/2 + log(x + 1)/2 + sqrt(3)*log(x**2 + x*(1 - sqrt(3)) - sqrt(3 ) + 2)/12 - sqrt(3)*log(x**2 + x*(1 + sqrt(3)) + sqrt(3) + 2)/12 + atan(2* x/(-1 + sqrt(3)) - 1)/2 - atan(2*x/(1 + sqrt(3)) + 1)/2
\[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=\int { -\frac {{\left (x^{2} + 1\right )}^{2}}{{\left (x^{4} + 2 \, x^{3} + 2 \, x^{2} - 2 \, x + 1\right )} {\left (x^{2} - 1\right )}} \,d x } \] Input:
integrate((x^2+1)^2/(-x^2+1)/(x^4+2*x^3+2*x^2-2*x+1),x, algorithm="maxima" )
Output:
2*integrate(x/(x^4 + 2*x^3 + 2*x^2 - 2*x + 1), x) + 1/2*log(x + 1) - 1/2*l og(x - 1)
Time = 0.13 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.84 \[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=-\frac {1}{4} \, \pi - \frac {1}{12} \, \sqrt {3} \log \left ({\left (x + \sqrt {3} + 1\right )}^{2} + x^{2}\right ) + \frac {1}{12} \, \sqrt {3} \log \left ({\left (x - \sqrt {3} + 1\right )}^{2} + x^{2}\right ) - \frac {1}{2} \, \arctan \left (-x {\left (\sqrt {3} + 1\right )} + 1\right ) - \frac {1}{2} \, \arctan \left (x {\left (\sqrt {3} - 1\right )} + 1\right ) + \frac {1}{2} \, \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{2} \, \log \left ({\left | x - 1 \right |}\right ) \] Input:
integrate((x^2+1)^2/(-x^2+1)/(x^4+2*x^3+2*x^2-2*x+1),x, algorithm="giac")
Output:
-1/4*pi - 1/12*sqrt(3)*log((x + sqrt(3) + 1)^2 + x^2) + 1/12*sqrt(3)*log(( x - sqrt(3) + 1)^2 + x^2) - 1/2*arctan(-x*(sqrt(3) + 1) + 1) - 1/2*arctan( x*(sqrt(3) - 1) + 1) + 1/2*log(abs(x + 1)) - 1/2*log(abs(x - 1))
Time = 23.48 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.76 \[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=\mathrm {atanh}\left (x\right )-\mathrm {atan}\left (\frac {8960\,x}{3\,\left (3072\,x-\frac {256}{3}-\frac {\sqrt {3}\,x\,5120{}\mathrm {i}}{3}+\sqrt {3}\,1280{}\mathrm {i}\right )}-\frac {6656}{3\,\left (3072\,x-\frac {256}{3}-\frac {\sqrt {3}\,x\,5120{}\mathrm {i}}{3}+\sqrt {3}\,1280{}\mathrm {i}\right )}+\frac {\sqrt {3}\,x\,1792{}\mathrm {i}}{3072\,x-\frac {256}{3}-\frac {\sqrt {3}\,x\,5120{}\mathrm {i}}{3}+\sqrt {3}\,1280{}\mathrm {i}}\right )\,\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6}\right )-\mathrm {atan}\left (-\frac {8960\,x}{3\,\left (3072\,x-\frac {256}{3}+\frac {\sqrt {3}\,x\,5120{}\mathrm {i}}{3}-\sqrt {3}\,1280{}\mathrm {i}\right )}+\frac {6656}{3\,\left (3072\,x-\frac {256}{3}+\frac {\sqrt {3}\,x\,5120{}\mathrm {i}}{3}-\sqrt {3}\,1280{}\mathrm {i}\right )}+\frac {\sqrt {3}\,x\,1792{}\mathrm {i}}{3072\,x-\frac {256}{3}+\frac {\sqrt {3}\,x\,5120{}\mathrm {i}}{3}-\sqrt {3}\,1280{}\mathrm {i}}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6}\right ) \] Input:
int(-(x^2 + 1)^2/((x^2 - 1)*(2*x^2 - 2*x + 2*x^3 + x^4 + 1)),x)
Output:
atanh(x) - atan((8960*x)/(3*(3072*x - (3^(1/2)*x*5120i)/3 + 3^(1/2)*1280i - 256/3)) - 6656/(3*(3072*x - (3^(1/2)*x*5120i)/3 + 3^(1/2)*1280i - 256/3) ) + (3^(1/2)*x*1792i)/(3072*x - (3^(1/2)*x*5120i)/3 + 3^(1/2)*1280i - 256/ 3))*((3^(1/2)*1i)/6 - 1/2) - atan(6656/(3*(3072*x + (3^(1/2)*x*5120i)/3 - 3^(1/2)*1280i - 256/3)) - (8960*x)/(3*(3072*x + (3^(1/2)*x*5120i)/3 - 3^(1 /2)*1280i - 256/3)) + (3^(1/2)*x*1792i)/(3072*x + (3^(1/2)*x*5120i)/3 - 3^ (1/2)*1280i - 256/3))*((3^(1/2)*1i)/6 + 1/2)
\[ \int \frac {\left (1+x^2\right )^2}{\left (1-x^2\right ) \left (1-2 x+2 x^2+2 x^3+x^4\right )} \, dx=2 \left (\int \frac {x^{2}}{x^{6}+2 x^{5}+x^{4}-4 x^{3}-x^{2}+2 x -1}d x \right )-8 \left (\int \frac {x}{x^{6}+2 x^{5}+x^{4}-4 x^{3}-x^{2}+2 x -1}d x \right )+2 \left (\int \frac {1}{x^{6}+2 x^{5}+x^{4}-4 x^{3}-x^{2}+2 x -1}d x \right )-\frac {\mathrm {log}\left (x^{4}+2 x^{3}+2 x^{2}-2 x +1\right )}{2}+2 \,\mathrm {log}\left (x +1\right ) \] Input:
int((x^2+1)^2/(-x^2+1)/(x^4+2*x^3+2*x^2-2*x+1),x)
Output:
(4*int(x**2/(x**6 + 2*x**5 + x**4 - 4*x**3 - x**2 + 2*x - 1),x) - 16*int(x /(x**6 + 2*x**5 + x**4 - 4*x**3 - x**2 + 2*x - 1),x) + 4*int(1/(x**6 + 2*x **5 + x**4 - 4*x**3 - x**2 + 2*x - 1),x) - log(x**4 + 2*x**3 + 2*x**2 - 2* x + 1) + 4*log(x + 1))/2