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

Optimal. Leaf size=89 \[ -\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}}} \]

[Out]

-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]
time = 0.06, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {1120, 1107, 210} \begin {gather*} \frac {\text {ArcTan}\left (\frac {x-1}{\sqrt {\sqrt {a+4}+1}}\right )}{2 \sqrt {a+4} \sqrt {\sqrt {a+4}+1}}-\frac {\text {ArcTan}\left (\frac {x-1}{\sqrt {1-\sqrt {a+4}}}\right )}{2 \sqrt {a+4} \sqrt {1-\sqrt {a+4}}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + 8*x - 8*x^2 + 4*x^3 - x^4)^(-1),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]])

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 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 1120

Int[(P4_)^(p_), x_Symbol] :> With[{a = Coeff[P4, x, 0], b = Coeff[P4, x, 1], c = Coeff[P4, x, 2], d = Coeff[P4
, x, 3], e = Coeff[P4, x, 4]}, Subst[Int[SimplifyIntegrand[(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[P4, x, 4] && NeQ[p, 2] && NeQ[p, 3]

Rubi steps

\begin {align*} \int \frac {1}{a+8 x-8 x^2+4 x^3-x^4} \, dx &=\text {Subst}\left (\int \frac {1}{3+a-2 x^2-x^4} \, dx,x,-1+x\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}}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 0.01, size = 57, normalized size = 0.64 \begin {gather*} -\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})}{-2+4 \text {$\#$1}-3 \text {$\#$1}^2+\text {$\#$1}^3}\&\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.03, size = 51, normalized size = 0.57

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 457 vs. \(2 (65) = 130\).
time = 0.41, size = 457, normalized size = 5.13 \begin {gather*} \frac {1}{4} \, \sqrt {\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 1}{a^{2} + 7 \, a + 12}} \log \left ({\left (a - \frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 4\right )} \sqrt {\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 1}{a^{2} + 7 \, a + 12}} + x - 1\right ) - \frac {1}{4} \, \sqrt {\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 1}{a^{2} + 7 \, a + 12}} \log \left (-{\left (a - \frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 4\right )} \sqrt {\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 1}{a^{2} + 7 \, a + 12}} + x - 1\right ) + \frac {1}{4} \, \sqrt {-\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} - 1}{a^{2} + 7 \, a + 12}} \log \left ({\left (a + \frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 4\right )} \sqrt {-\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} - 1}{a^{2} + 7 \, a + 12}} + x - 1\right ) - \frac {1}{4} \, \sqrt {-\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} - 1}{a^{2} + 7 \, a + 12}} \log \left (-{\left (a + \frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} + 4\right )} \sqrt {-\frac {\frac {a^{2} + 7 \, a + 12}{\sqrt {a^{3} + 10 \, a^{2} + 33 \, a + 36}} - 1}{a^{2} + 7 \, a + 12}} + x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*sqrt(((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 1)/(a^2 + 7*a + 12))*log((a - (a^2 + 7*a + 12)/sqr
t(a^3 + 10*a^2 + 33*a + 36) + 4)*sqrt(((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 1)/(a^2 + 7*a + 12))
+ x - 1) - 1/4*sqrt(((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 1)/(a^2 + 7*a + 12))*log(-(a - (a^2 + 7
*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 4)*sqrt(((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 1)/(a^2 +
 7*a + 12)) + x - 1) + 1/4*sqrt(-((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) - 1)/(a^2 + 7*a + 12))*log((
a + (a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 4)*sqrt(-((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36
) - 1)/(a^2 + 7*a + 12)) + x - 1) - 1/4*sqrt(-((a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) - 1)/(a^2 + 7*a
 + 12))*log(-(a + (a^2 + 7*a + 12)/sqrt(a^3 + 10*a^2 + 33*a + 36) + 4)*sqrt(-((a^2 + 7*a + 12)/sqrt(a^3 + 10*a
^2 + 33*a + 36) - 1)/(a^2 + 7*a + 12)) + x - 1)

________________________________________________________________________________________

Sympy [A]
time = 0.61, size = 66, normalized size = 0.74 \begin {gather*} - \operatorname {RootSum} {\left (t^{4} \cdot \left (256 a^{3} + 2816 a^{2} + 10240 a + 12288\right ) + t^{2} \left (- 32 a - 128\right ) - 1, \left ( t \mapsto t \log {\left (64 t^{3} a^{2} + 448 t^{3} a + 768 t^{3} - 4 t a - 20 t + x - 1 \right )} \right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-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 - 128) - 1, Lambda(_t, _t*log(64*_t**3*
a**2 + 448*_t**3*a + 768*_t**3 - 4*_t*a - 20*_t + x - 1)))

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Warning, need to choose a branch for the
 root of a polynomial with parameters. This might be wrong.The choice was done assuming [sageVARa]=[86]Warning
, need to choose a br

________________________________________________________________________________________

Mupad [B]
time = 2.58, size = 571, normalized size = 6.42 \begin {gather*} -\mathrm {atan}\left (-\frac {a\,8{}\mathrm {i}-x\,16{}\mathrm {i}+x\,\sqrt {a^3+12\,a^2+48\,a+64}\,1{}\mathrm {i}-a\,x\,8{}\mathrm {i}-\sqrt {a^3+12\,a^2+48\,a+64}\,1{}\mathrm {i}-a^2\,x\,1{}\mathrm {i}+a^2\,1{}\mathrm {i}+16{}\mathrm {i}}{44\,a^2\,\sqrt {\frac {a-\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}+4\,a^3\,\sqrt {\frac {a-\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}+160\,a\,\sqrt {\frac {a-\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}+192\,\sqrt {\frac {a-\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}}\right )\,\sqrt {\frac {a-\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}\,2{}\mathrm {i}-\mathrm {atan}\left (-\frac {a\,8{}\mathrm {i}-x\,16{}\mathrm {i}-x\,\sqrt {a^3+12\,a^2+48\,a+64}\,1{}\mathrm {i}-a\,x\,8{}\mathrm {i}+\sqrt {a^3+12\,a^2+48\,a+64}\,1{}\mathrm {i}-a^2\,x\,1{}\mathrm {i}+a^2\,1{}\mathrm {i}+16{}\mathrm {i}}{160\,a\,\sqrt {\frac {a+\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}+192\,\sqrt {\frac {a+\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}+44\,a^2\,\sqrt {\frac {a+\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}+4\,a^3\,\sqrt {\frac {a+\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}}\right )\,\sqrt {\frac {a+\sqrt {a^3+12\,a^2+48\,a+64}+4}{16\,a^3+176\,a^2+640\,a+768}}\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

- atan(-(a*8i - x*16i + x*(48*a + 12*a^2 + a^3 + 64)^(1/2)*1i - a*x*8i - (48*a + 12*a^2 + a^3 + 64)^(1/2)*1i -
 a^2*x*1i + a^2*1i + 16i)/(44*a^2*((a - (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768)
)^(1/2) + 4*a^3*((a - (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768))^(1/2) + 160*a*((
a - (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768))^(1/2) + 192*((a - (48*a + 12*a^2 +
 a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768))^(1/2)))*((a - (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(6
40*a + 176*a^2 + 16*a^3 + 768))^(1/2)*2i - atan(-(a*8i - x*16i - x*(48*a + 12*a^2 + a^3 + 64)^(1/2)*1i - a*x*8
i + (48*a + 12*a^2 + a^3 + 64)^(1/2)*1i - a^2*x*1i + a^2*1i + 16i)/(160*a*((a + (48*a + 12*a^2 + a^3 + 64)^(1/
2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768))^(1/2) + 192*((a + (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176
*a^2 + 16*a^3 + 768))^(1/2) + 44*a^2*((a + (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 7
68))^(1/2) + 4*a^3*((a + (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768))^(1/2)))*((a +
 (48*a + 12*a^2 + a^3 + 64)^(1/2) + 4)/(640*a + 176*a^2 + 16*a^3 + 768))^(1/2)*2i

________________________________________________________________________________________