\(\int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx\) [127]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 116 \[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=-\frac {\arctan \left (\frac {-1+x}{\sqrt {1-\sqrt {4+a}}}\right )}{2 \sqrt {4+a} \sqrt {1-\sqrt {4+a}}}+\frac {\arctan \left (\frac {-1+x}{\sqrt {1+\sqrt {4+a}}}\right )}{2 \sqrt {4+a} \sqrt {1+\sqrt {4+a}}}+\frac {\text {arctanh}\left (\frac {1+(-1+x)^2}{\sqrt {4+a}}\right )}{2 \sqrt {4+a}} \]

[Out]

1/2*arctanh((1+(-1+x)^2)/(4+a)^(1/2))/(4+a)^(1/2)-1/2*arctan((-1+x)/(1-(4+a)^(1/2))^(1/2))/(4+a)^(1/2)/(1-(4+a
)^(1/2))^(1/2)+1/2*arctan((-1+x)/(1+(4+a)^(1/2))^(1/2))/(4+a)^(1/2)/(1+(4+a)^(1/2))^(1/2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.292, Rules used = {1694, 1687, 1107, 210, 1121, 632, 212} \[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=-\frac {\arctan \left (\frac {x-1}{\sqrt {1-\sqrt {a+4}}}\right )}{2 \sqrt {a+4} \sqrt {1-\sqrt {a+4}}}+\frac {\arctan \left (\frac {x-1}{\sqrt {\sqrt {a+4}+1}}\right )}{2 \sqrt {a+4} \sqrt {\sqrt {a+4}+1}}+\frac {\text {arctanh}\left (\frac {(x-1)^2+1}{\sqrt {a+4}}\right )}{2 \sqrt {a+4}} \]

[In]

Int[x/(a + 8*x - 8*x^2 + 4*x^3 - x^4),x]

[Out]

-1/2*ArcTan[(-1 + x)/Sqrt[1 - Sqrt[4 + a]]]/(Sqrt[4 + a]*Sqrt[1 - Sqrt[4 + a]]) + ArcTan[(-1 + x)/Sqrt[1 + Sqr
t[4 + a]]]/(2*Sqrt[4 + a]*Sqrt[1 + Sqrt[4 + a]]) + ArcTanh[(1 + (-1 + x)^2)/Sqrt[4 + a]]/(2*Sqrt[4 + a])

Rule 210

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])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1107

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/(b/
2 - q/2 + c*x^2), x], x] - Dist[c/q, Int[1/(b/2 + q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*
a*c, 0] && PosQ[b^2 - 4*a*c]

Rule 1121

Int[(x_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[(a + b*x + c*x^2)^p, x],
 x, x^2], x] /; FreeQ[{a, b, c, p}, x]

Rule 1687

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{q = Expon[Pq, x], k}, Int[Sum[Coeff[
Pq, x, 2*k]*x^(2*k), {k, 0, q/2}]*(a + b*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pq, x, 2*k + 1]*x^(2*k), {k, 0,
(q - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] &&  !PolyQ[Pq, x^2]

Rule 1694

Int[(Pq_)*(Q4_)^(p_), x_Symbol] :> With[{a = Coeff[Q4, x, 0], b = Coeff[Q4, x, 1], c = Coeff[Q4, x, 2], d = Co
eff[Q4, x, 3], e = Coeff[Q4, x, 4]}, Subst[Int[SimplifyIntegrand[(Pq /. x -> -d/(4*e) + x)*(a + d^4/(256*e^3)
- b*(d/(8*e)) + (c - 3*(d^2/(8*e)))*x^2 + e*x^4)^p, x], x], x, d/(4*e) + x] /; EqQ[d^3 - 4*c*d*e + 8*b*e^2, 0]
 && NeQ[d, 0]] /; FreeQ[p, x] && PolyQ[Pq, x] && PolyQ[Q4, x, 4] &&  !IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1+x}{3+a-2 x^2-x^4} \, dx,x,-1+x\right ) \\ & = \text {Subst}\left (\int \frac {1}{3+a-2 x^2-x^4} \, dx,x,-1+x\right )+\text {Subst}\left (\int \frac {x}{3+a-2 x^2-x^4} \, dx,x,-1+x\right ) \\ & = \frac {1}{2} \text {Subst}\left (\int \frac {1}{3+a-2 x-x^2} \, dx,x,(-1+x)^2\right )-\frac {\text {Subst}\left (\int \frac {1}{-1-\sqrt {4+a}-x^2} \, dx,x,-1+x\right )}{2 \sqrt {4+a}}+\frac {\text {Subst}\left (\int \frac {1}{-1+\sqrt {4+a}-x^2} \, dx,x,-1+x\right )}{2 \sqrt {4+a}} \\ & = \frac {\tan ^{-1}\left (\frac {1-x}{\sqrt {1-\sqrt {4+a}}}\right )}{2 \sqrt {4+a} \sqrt {1-\sqrt {4+a}}}-\frac {\tan ^{-1}\left (\frac {1-x}{\sqrt {1+\sqrt {4+a}}}\right )}{2 \sqrt {4+a} \sqrt {1+\sqrt {4+a}}}-\text {Subst}\left (\int \frac {1}{4 (4+a)-x^2} \, dx,x,-2 \left (1+(-1+x)^2\right )\right ) \\ & = \frac {\tan ^{-1}\left (\frac {1-x}{\sqrt {1-\sqrt {4+a}}}\right )}{2 \sqrt {4+a} \sqrt {1-\sqrt {4+a}}}-\frac {\tan ^{-1}\left (\frac {1-x}{\sqrt {1+\sqrt {4+a}}}\right )}{2 \sqrt {4+a} \sqrt {1+\sqrt {4+a}}}+\frac {\tanh ^{-1}\left (\frac {1+(-1+x)^2}{\sqrt {4+a}}\right )}{2 \sqrt {4+a}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 0.02 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.51 \[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=-\frac {1}{4} \text {RootSum}\left [a+8 \text {$\#$1}-8 \text {$\#$1}^2+4 \text {$\#$1}^3-\text {$\#$1}^4\&,\frac {\log (x-\text {$\#$1}) \text {$\#$1}}{-2+4 \text {$\#$1}-3 \text {$\#$1}^2+\text {$\#$1}^3}\&\right ] \]

[In]

Integrate[x/(a + 8*x - 8*x^2 + 4*x^3 - x^4),x]

[Out]

-1/4*RootSum[a + 8*#1 - 8*#1^2 + 4*#1^3 - #1^4 & , (Log[x - #1]*#1)/(-2 + 4*#1 - 3*#1^2 + #1^3) & ]

Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.04 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.45

method result size
default \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}-4 \textit {\_Z}^{3}+8 \textit {\_Z}^{2}-8 \textit {\_Z} -a \right )}{\sum }\frac {\textit {\_R} \ln \left (x -\textit {\_R} \right )}{-\textit {\_R}^{3}+3 \textit {\_R}^{2}-4 \textit {\_R} +2}\right )}{4}\) \(52\)
risch \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}-4 \textit {\_Z}^{3}+8 \textit {\_Z}^{2}-8 \textit {\_Z} -a \right )}{\sum }\frac {\textit {\_R} \ln \left (x -\textit {\_R} \right )}{-\textit {\_R}^{3}+3 \textit {\_R}^{2}-4 \textit {\_R} +2}\right )}{4}\) \(52\)

[In]

int(x/(-x^4+4*x^3-8*x^2+a+8*x),x,method=_RETURNVERBOSE)

[Out]

1/4*sum(_R/(-_R^3+3*_R^2-4*_R+2)*ln(x-_R),_R=RootOf(_Z^4-4*_Z^3+8*_Z^2-8*_Z-a))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 1.45 (sec) , antiderivative size = 140500, normalized size of antiderivative = 1211.21 \[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=\text {Too large to display} \]

[In]

integrate(x/(-x^4+4*x^3-8*x^2+a+8*x),x, algorithm="fricas")

[Out]

Too large to include

Sympy [A] (verification not implemented)

Time = 2.48 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.34 \[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=- \operatorname {RootSum} {\left (t^{4} \cdot \left (256 a^{3} + 2816 a^{2} + 10240 a + 12288\right ) + t^{2} \left (- 32 a^{2} - 256 a - 512\right ) + t \left (- 16 a - 64\right ) + a, \left ( t \mapsto t \log {\left (x + \frac {- 128 t^{3} a^{4} - 1728 t^{3} a^{3} - 8640 t^{3} a^{2} - 18944 t^{3} a - 15360 t^{3} + 48 t^{2} a^{3} + 464 t^{2} a^{2} + 1472 t^{2} a + 1536 t^{2} + 8 t a^{3} + 88 t a^{2} + 312 t a + 352 t - a^{2} - 2 a}{4 a^{2} + 21 a + 28} \right )} \right )\right )} \]

[In]

integrate(x/(-x**4+4*x**3-8*x**2+a+8*x),x)

[Out]

-RootSum(_t**4*(256*a**3 + 2816*a**2 + 10240*a + 12288) + _t**2*(-32*a**2 - 256*a - 512) + _t*(-16*a - 64) + a
, Lambda(_t, _t*log(x + (-128*_t**3*a**4 - 1728*_t**3*a**3 - 8640*_t**3*a**2 - 18944*_t**3*a - 15360*_t**3 + 4
8*_t**2*a**3 + 464*_t**2*a**2 + 1472*_t**2*a + 1536*_t**2 + 8*_t*a**3 + 88*_t*a**2 + 312*_t*a + 352*_t - a**2
- 2*a)/(4*a**2 + 21*a + 28))))

Maxima [F]

\[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=\int { -\frac {x}{x^{4} - 4 \, x^{3} + 8 \, x^{2} - a - 8 \, x} \,d x } \]

[In]

integrate(x/(-x^4+4*x^3-8*x^2+a+8*x),x, algorithm="maxima")

[Out]

-integrate(x/(x^4 - 4*x^3 + 8*x^2 - a - 8*x), x)

Giac [F]

\[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=\int { -\frac {x}{x^{4} - 4 \, x^{3} + 8 \, x^{2} - a - 8 \, x} \,d x } \]

[In]

integrate(x/(-x^4+4*x^3-8*x^2+a+8*x),x, algorithm="giac")

[Out]

integrate(-x/(x^4 - 4*x^3 + 8*x^2 - a - 8*x), x)

Mupad [B] (verification not implemented)

Time = 9.58 (sec) , antiderivative size = 275, normalized size of antiderivative = 2.37 \[ \int \frac {x}{a+8 x-8 x^2+4 x^3-x^4} \, dx=\sum _{k=1}^4\ln \left (-x-\mathrm {root}\left (2816\,a^2\,z^4+256\,a^3\,z^4+10240\,a\,z^4+12288\,z^4-32\,a^2\,z^2-256\,a\,z^2-512\,z^2+16\,a\,z+64\,z+a,z,k\right )\,\left (\mathrm {root}\left (2816\,a^2\,z^4+256\,a^3\,z^4+10240\,a\,z^4+12288\,z^4-32\,a^2\,z^2-256\,a\,z^2-512\,z^2+16\,a\,z+64\,z+a,z,k\right )\,\left (32\,a-\mathrm {root}\left (2816\,a^2\,z^4+256\,a^3\,z^4+10240\,a\,z^4+12288\,z^4-32\,a^2\,z^2-256\,a\,z^2-512\,z^2+16\,a\,z+64\,z+a,z,k\right )\,\left (64\,a-x\,\left (64\,a+256\right )+256\right )-x\,\left (16\,a+64\right )+128\right )-8\right )\right )\,\mathrm {root}\left (2816\,a^2\,z^4+256\,a^3\,z^4+10240\,a\,z^4+12288\,z^4-32\,a^2\,z^2-256\,a\,z^2-512\,z^2+16\,a\,z+64\,z+a,z,k\right ) \]

[In]

int(x/(a + 8*x - 8*x^2 + 4*x^3 - x^4),x)

[Out]

symsum(log(- x - root(2816*a^2*z^4 + 256*a^3*z^4 + 10240*a*z^4 + 12288*z^4 - 32*a^2*z^2 - 256*a*z^2 - 512*z^2
+ 16*a*z + 64*z + a, z, k)*(root(2816*a^2*z^4 + 256*a^3*z^4 + 10240*a*z^4 + 12288*z^4 - 32*a^2*z^2 - 256*a*z^2
 - 512*z^2 + 16*a*z + 64*z + a, z, k)*(32*a - root(2816*a^2*z^4 + 256*a^3*z^4 + 10240*a*z^4 + 12288*z^4 - 32*a
^2*z^2 - 256*a*z^2 - 512*z^2 + 16*a*z + 64*z + a, z, k)*(64*a - x*(64*a + 256) + 256) - x*(16*a + 64) + 128) -
 8))*root(2816*a^2*z^4 + 256*a^3*z^4 + 10240*a*z^4 + 12288*z^4 - 32*a^2*z^2 - 256*a*z^2 - 512*z^2 + 16*a*z + 6
4*z + a, z, k), k, 1, 4)