Integrand size = 34, antiderivative size = 108 \[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=-\frac {1}{4} \arctan \left (2-\sqrt {3}+2 x^2\right )-\frac {1}{4} \arctan \left (2+\sqrt {3}+2 x^2\right )+\frac {1}{8} \sqrt {3} \log \left (2-\sqrt {3}+2 x^2-\sqrt {3} x^2+x^4\right )-\frac {1}{8} \sqrt {3} \log \left (2+\sqrt {3}+2 x^2+\sqrt {3} x^2+x^4\right ) \] Output:
-1/4*arctan(2-3^(1/2)+2*x^2)-1/4*arctan(2+3^(1/2)+2*x^2)+1/8*3^(1/2)*ln(2- 3^(1/2)+2*x^2-3^(1/2)*x^2+x^4)-1/8*3^(1/2)*ln(2+3^(1/2)+2*x^2+3^(1/2)*x^2+ x^4)
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.02 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.82 \[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=\frac {1}{4} \text {RootSum}\left [1+2 \text {$\#$1}^2+5 \text {$\#$1}^4+4 \text {$\#$1}^6+\text {$\#$1}^8\&,\frac {-\log (x-\text {$\#$1})+2 \log (x-\text {$\#$1}) \text {$\#$1}^2+\log (x-\text {$\#$1}) \text {$\#$1}^4}{1+5 \text {$\#$1}^2+6 \text {$\#$1}^4+2 \text {$\#$1}^6}\&\right ] \] Input:
Integrate[(x*(-1 + 2*x^2 + x^4))/(1 + 2*x^2 + 5*x^4 + 4*x^6 + x^8),x]
Output:
RootSum[1 + 2*#1^2 + 5*#1^4 + 4*#1^6 + #1^8 & , (-Log[x - #1] + 2*Log[x - #1]*#1^2 + Log[x - #1]*#1^4)/(1 + 5*#1^2 + 6*#1^4 + 2*#1^6) & ]/4
Time = 0.78 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.97, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {7266, 25, 2459, 1483, 27, 1142, 25, 1083, 217, 1103}
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 {x \left (x^4+2 x^2-1\right )}{x^8+4 x^6+5 x^4+2 x^2+1} \, dx\) |
\(\Big \downarrow \) 7266 |
\(\displaystyle \frac {1}{2} \int -\frac {-x^4-2 x^2+1}{x^8+4 x^6+5 x^4+2 x^2+1}dx^2\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {1}{2} \int \frac {-x^4-2 x^2+1}{x^8+4 x^6+5 x^4+2 x^2+1}dx^2\) |
\(\Big \downarrow \) 2459 |
\(\displaystyle -\frac {1}{2} \int \frac {2-x^4}{x^8-x^4+1}d\left (x^2+1\right )\) |
\(\Big \downarrow \) 1483 |
\(\displaystyle \frac {1}{2} \left (-\frac {\int \frac {2 \sqrt {3}-3 \left (x^2+1\right )}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )}{2 \sqrt {3}}-\frac {\int \frac {\sqrt {3} \left (\sqrt {3} \left (x^2+1\right )+2\right )}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )}{2 \sqrt {3}}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{2} \left (-\frac {\int \frac {2 \sqrt {3}-3 \left (x^2+1\right )}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )}{2 \sqrt {3}}-\frac {1}{2} \int \frac {\sqrt {3} \left (x^2+1\right )+2}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )\right )\) |
\(\Big \downarrow \) 1142 |
\(\displaystyle \frac {1}{2} \left (\frac {1}{2} \left (-\frac {1}{2} \int \frac {1}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )-\frac {1}{2} \sqrt {3} \int \frac {2 \left (x^2+1\right )+\sqrt {3}}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )\right )-\frac {\frac {1}{2} \sqrt {3} \int \frac {1}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )-\frac {3}{2} \int -\frac {\sqrt {3}-2 \left (x^2+1\right )}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )}{2 \sqrt {3}}\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{2} \left (\frac {1}{2} \left (-\frac {1}{2} \int \frac {1}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )-\frac {1}{2} \sqrt {3} \int \frac {2 \left (x^2+1\right )+\sqrt {3}}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )\right )-\frac {\frac {1}{2} \sqrt {3} \int \frac {1}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )+\frac {3}{2} \int \frac {\sqrt {3}-2 \left (x^2+1\right )}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )}{2 \sqrt {3}}\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {1}{2} \left (\frac {1}{2} \left (\int \frac {1}{-x^4-1}d\left (2 \left (x^2+1\right )+\sqrt {3}\right )-\frac {1}{2} \sqrt {3} \int \frac {2 \left (x^2+1\right )+\sqrt {3}}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )\right )-\frac {\frac {3}{2} \int \frac {\sqrt {3}-2 \left (x^2+1\right )}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )-\sqrt {3} \int \frac {1}{-x^4-1}d\left (2 \left (x^2+1\right )-\sqrt {3}\right )}{2 \sqrt {3}}\right )\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {1}{2} \left (\frac {1}{2} \left (-\frac {1}{2} \sqrt {3} \int \frac {2 \left (x^2+1\right )+\sqrt {3}}{x^4+\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )-\arctan \left (2 \left (x^2+1\right )+\sqrt {3}\right )\right )-\frac {\frac {3}{2} \int \frac {\sqrt {3}-2 \left (x^2+1\right )}{x^4-\sqrt {3} \left (x^2+1\right )+1}d\left (x^2+1\right )-\sqrt {3} \arctan \left (\sqrt {3}-2 \left (x^2+1\right )\right )}{2 \sqrt {3}}\right )\) |
\(\Big \downarrow \) 1103 |
\(\displaystyle \frac {1}{2} \left (\frac {1}{2} \left (-\arctan \left (2 \left (x^2+1\right )+\sqrt {3}\right )-\frac {1}{2} \sqrt {3} \log \left (x^4+\sqrt {3} \left (x^2+1\right )+1\right )\right )-\frac {-\sqrt {3} \arctan \left (\sqrt {3}-2 \left (x^2+1\right )\right )-\frac {3}{2} \log \left (x^4-\sqrt {3} \left (x^2+1\right )+1\right )}{2 \sqrt {3}}\right )\) |
Input:
Int[(x*(-1 + 2*x^2 + x^4))/(1 + 2*x^2 + 5*x^4 + 4*x^6 + x^8),x]
Output:
(-1/2*(-(Sqrt[3]*ArcTan[Sqrt[3] - 2*(1 + x^2)]) - (3*Log[1 + x^4 - Sqrt[3] *(1 + x^2)])/2)/Sqrt[3] + (-ArcTan[Sqrt[3] + 2*(1 + x^2)] - (Sqrt[3]*Log[1 + x^4 + Sqrt[3]*(1 + x^2)])/2)/2)/2
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[(2*c*d - b*e)/(2*c) Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] : > With[{q = Rt[a/c, 2]}, With[{r = Rt[2*q - b/c, 2]}, Simp[1/(2*c*q*r) In t[(d*r - (d - e*q)*x)/(q - r*x + x^2), x], x] + Simp[1/(2*c*q*r) Int[(d*r + (d - e*q)*x)/(q + r*x + x^2), x], x]]] /; FreeQ[{a, b, c, d, e}, x] && N eQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NegQ[b^2 - 4*a*c]
Int[(Pn_)^(p_.)*(Qx_), x_Symbol] :> With[{S = Coeff[Pn, x, Expon[Pn, x] - 1 ]/(Expon[Pn, x]*Coeff[Pn, x, Expon[Pn, x]])}, Subst[Int[ExpandToSum[Pn /. x -> x - S, x]^p*ExpandToSum[Qx /. x -> x - S, x], x], x, x + S] /; Binomial Q[Pn /. x -> x - S, x] || (IntegerQ[Expon[Pn, x]/2] && TrinomialQ[Pn /. x - > x - S, x])] /; FreeQ[p, x] && PolyQ[Pn, x] && GtQ[Expon[Pn, x], 2] && NeQ [Coeff[Pn, x, Expon[Pn, x] - 1], 0] && PolyQ[Qx, x] && !(MonomialQ[Qx, x] && IGtQ[p, 0])
Int[(u_)*(x_)^(m_.), x_Symbol] :> Simp[1/(m + 1) Subst[Int[SubstFor[x^(m + 1), u, x], x], x, x^(m + 1)], x] /; FreeQ[m, x] && NeQ[m, -1] && Function OfQ[x^(m + 1), u, x]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.07 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.26
method | result | size |
risch | \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}-\textit {\_Z}^{2}+1\right )}{\sum }\textit {\_R} \ln \left (x^{2}-\textit {\_R} +1\right )\right )}{4}\) | \(28\) |
default | \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}+4 \textit {\_Z}^{3}+5 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )}{\sum }\frac {\left (\textit {\_R}^{2}+2 \textit {\_R} -1\right ) \ln \left (x^{2}-\textit {\_R} \right )}{2 \textit {\_R}^{3}+6 \textit {\_R}^{2}+5 \textit {\_R} +1}\right )}{4}\) | \(59\) |
Input:
int(x*(x^4+2*x^2-1)/(x^8+4*x^6+5*x^4+2*x^2+1),x,method=_RETURNVERBOSE)
Output:
1/4*sum(_R*ln(x^2-_R+1),_R=RootOf(_Z^4-_Z^2+1))
Time = 0.06 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.72 \[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=-\frac {1}{8} \, \sqrt {3} \log \left (x^{4} + 2 \, x^{2} + \sqrt {3} {\left (x^{2} + 1\right )} + 2\right ) + \frac {1}{8} \, \sqrt {3} \log \left (x^{4} + 2 \, x^{2} - \sqrt {3} {\left (x^{2} + 1\right )} + 2\right ) - \frac {1}{4} \, \arctan \left (2 \, x^{2} + \sqrt {3} + 2\right ) + \frac {1}{4} \, \arctan \left (-2 \, x^{2} + \sqrt {3} - 2\right ) \] Input:
integrate(x*(x^4+2*x^2-1)/(x^8+4*x^6+5*x^4+2*x^2+1),x, algorithm="fricas")
Output:
-1/8*sqrt(3)*log(x^4 + 2*x^2 + sqrt(3)*(x^2 + 1) + 2) + 1/8*sqrt(3)*log(x^ 4 + 2*x^2 - sqrt(3)*(x^2 + 1) + 2) - 1/4*arctan(2*x^2 + sqrt(3) + 2) + 1/4 *arctan(-2*x^2 + sqrt(3) - 2)
Time = 0.12 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.81 \[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=\frac {\sqrt {3} \log {\left (x^{4} + x^{2} \cdot \left (2 - \sqrt {3}\right ) - \sqrt {3} + 2 \right )}}{8} - \frac {\sqrt {3} \log {\left (x^{4} + x^{2} \left (\sqrt {3} + 2\right ) + \sqrt {3} + 2 \right )}}{8} - \frac {\operatorname {atan}{\left (2 x^{2} - \sqrt {3} + 2 \right )}}{4} - \frac {\operatorname {atan}{\left (2 x^{2} + \sqrt {3} + 2 \right )}}{4} \] Input:
integrate(x*(x**4+2*x**2-1)/(x**8+4*x**6+5*x**4+2*x**2+1),x)
Output:
sqrt(3)*log(x**4 + x**2*(2 - sqrt(3)) - sqrt(3) + 2)/8 - sqrt(3)*log(x**4 + x**2*(sqrt(3) + 2) + sqrt(3) + 2)/8 - atan(2*x**2 - sqrt(3) + 2)/4 - ata n(2*x**2 + sqrt(3) + 2)/4
\[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=\int { \frac {{\left (x^{4} + 2 \, x^{2} - 1\right )} x}{x^{8} + 4 \, x^{6} + 5 \, x^{4} + 2 \, x^{2} + 1} \,d x } \] Input:
integrate(x*(x^4+2*x^2-1)/(x^8+4*x^6+5*x^4+2*x^2+1),x, algorithm="maxima")
Output:
integrate((x^4 + 2*x^2 - 1)*x/(x^8 + 4*x^6 + 5*x^4 + 2*x^2 + 1), x)
Exception generated. \[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=\text {Exception raised: TypeError} \] Input:
integrate(x*(x^4+2*x^2-1)/(x^8+4*x^6+5*x^4+2*x^2+1),x, algorithm="giac")
Output:
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Francis algorithm failure for[-1.0, infinity,infinity,infinity,infinity]proot error [1.0,infinity,infinity,inf inity,inf
Time = 11.07 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.86 \[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=-\frac {\mathrm {atan}\left (\frac {27\,x^2}{54\,x^2-\sqrt {3}\,27{}\mathrm {i}+27}-\frac {\sqrt {3}\,x^2\,27{}\mathrm {i}}{54\,x^2-\sqrt {3}\,27{}\mathrm {i}+27}\right )}{4}-\frac {\mathrm {atan}\left (\frac {27\,x^2}{54\,x^2+\sqrt {3}\,27{}\mathrm {i}+27}+\frac {\sqrt {3}\,x^2\,27{}\mathrm {i}}{54\,x^2+\sqrt {3}\,27{}\mathrm {i}+27}\right )}{4}+\frac {\sqrt {3}\,\mathrm {atan}\left (\frac {27\,x^2}{54\,x^2-\sqrt {3}\,27{}\mathrm {i}+27}-\frac {\sqrt {3}\,x^2\,27{}\mathrm {i}}{54\,x^2-\sqrt {3}\,27{}\mathrm {i}+27}\right )\,1{}\mathrm {i}}{4}-\frac {\sqrt {3}\,\mathrm {atan}\left (\frac {27\,x^2}{54\,x^2+\sqrt {3}\,27{}\mathrm {i}+27}+\frac {\sqrt {3}\,x^2\,27{}\mathrm {i}}{54\,x^2+\sqrt {3}\,27{}\mathrm {i}+27}\right )\,1{}\mathrm {i}}{4} \] Input:
int((x*(2*x^2 + x^4 - 1))/(2*x^2 + 5*x^4 + 4*x^6 + x^8 + 1),x)
Output:
(3^(1/2)*atan((27*x^2)/(54*x^2 - 3^(1/2)*27i + 27) - (3^(1/2)*x^2*27i)/(54 *x^2 - 3^(1/2)*27i + 27))*1i)/4 - atan((27*x^2)/(3^(1/2)*27i + 54*x^2 + 27 ) + (3^(1/2)*x^2*27i)/(3^(1/2)*27i + 54*x^2 + 27))/4 - atan((27*x^2)/(54*x ^2 - 3^(1/2)*27i + 27) - (3^(1/2)*x^2*27i)/(54*x^2 - 3^(1/2)*27i + 27))/4 - (3^(1/2)*atan((27*x^2)/(3^(1/2)*27i + 54*x^2 + 27) + (3^(1/2)*x^2*27i)/( 3^(1/2)*27i + 54*x^2 + 27))*1i)/4
\[ \int \frac {x \left (-1+2 x^2+x^4\right )}{1+2 x^2+5 x^4+4 x^6+x^8} \, dx=\frac {\sqrt {3}\, \mathrm {log}\left (-\sqrt {3}\, x^{2}-\sqrt {3}+x^{4}+2 x^{2}+2\right )}{12}-\frac {\sqrt {3}\, \mathrm {log}\left (-\sqrt {\sqrt {6}-\sqrt {3}+\sqrt {2}-2}\, x +\frac {\sqrt {6}}{2}+\frac {\sqrt {2}}{2}+x^{2}\right )}{12}-\frac {\sqrt {3}\, \mathrm {log}\left (\sqrt {\sqrt {6}-\sqrt {3}+\sqrt {2}-2}\, x +\frac {\sqrt {6}}{2}+\frac {\sqrt {2}}{2}+x^{2}\right )}{12}-\left (\int \frac {x}{x^{8}+4 x^{6}+5 x^{4}+2 x^{2}+1}d x \right ) \] Input:
int(x*(x^4+2*x^2-1)/(x^8+4*x^6+5*x^4+2*x^2+1),x)
Output:
(sqrt(3)*log( - sqrt(3)*x**2 - sqrt(3) + x**4 + 2*x**2 + 2) - sqrt(3)*log( ( - 2*sqrt(sqrt(6) - sqrt(3) + sqrt(2) - 2)*x + sqrt(6) + sqrt(2) + 2*x**2 )/2) - sqrt(3)*log((2*sqrt(sqrt(6) - sqrt(3) + sqrt(2) - 2)*x + sqrt(6) + sqrt(2) + 2*x**2)/2) - 12*int(x/(x**8 + 4*x**6 + 5*x**4 + 2*x**2 + 1),x))/ 12