\(\int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+(c f^2-b f g+a g^2) x^4} \, dx\) [335]

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

Optimal result

Integrand size = 64, antiderivative size = 270 \[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=-\frac {\sqrt {2 c f-\left (b-\sqrt {b^2-4 a c}\right ) g} \text {arctanh}\left (\frac {\sqrt {2 c f-\left (b-\sqrt {b^2-4 a c}\right ) g} x}{\sqrt {2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}}\right )}{\sqrt {b^2-4 a c} \sqrt {2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e} (e f-d g)}+\frac {\sqrt {2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g} \text {arctanh}\left (\frac {\sqrt {2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g} x}{\sqrt {2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}}\right )}{\sqrt {b^2-4 a c} \sqrt {2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e} (e f-d g)} \] Output:

-(2*c*f-(b-(-4*a*c+b^2)^(1/2))*g)^(1/2)*arctanh((2*c*f-(b-(-4*a*c+b^2)^(1/ 
2))*g)^(1/2)*x/(2*c*d-(b-(-4*a*c+b^2)^(1/2))*e)^(1/2))/(-4*a*c+b^2)^(1/2)/ 
(2*c*d-(b-(-4*a*c+b^2)^(1/2))*e)^(1/2)/(-d*g+e*f)+(2*c*f-(b+(-4*a*c+b^2)^( 
1/2))*g)^(1/2)*arctanh((2*c*f-(b+(-4*a*c+b^2)^(1/2))*g)^(1/2)*x/(2*c*d-(b+ 
(-4*a*c+b^2)^(1/2))*e)^(1/2))/(-4*a*c+b^2)^(1/2)/(2*c*d-(b+(-4*a*c+b^2)^(1 
/2))*e)^(1/2)/(-d*g+e*f)
 

Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 324, normalized size of antiderivative = 1.20 \[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\frac {\sqrt {2} \sqrt {c f^2+g (-b f+a g)} \left (\frac {\arctan \left (\frac {\sqrt {2} \sqrt {c f^2-b f g+a g^2} x}{\sqrt {-2 c d f+b e f+\sqrt {b^2-4 a c} e f+b d g-\sqrt {b^2-4 a c} d g-2 a e g}}\right )}{\sqrt {-2 c d f+b e f+\sqrt {b^2-4 a c} e f+b d g-\sqrt {b^2-4 a c} d g-2 a e g}}-\frac {\arctan \left (\frac {\sqrt {2} \sqrt {c f^2-b f g+a g^2} x}{\sqrt {-2 c d f+b e f-\sqrt {b^2-4 a c} e f+b d g+\sqrt {b^2-4 a c} d g-2 a e g}}\right )}{\sqrt {-2 c d f+b e f-\sqrt {b^2-4 a c} e f+b d g+\sqrt {b^2-4 a c} d g-2 a e g}}\right )}{\sqrt {b^2-4 a c} (-e f+d g)} \] Input:

Integrate[(c*d^2 - b*d*e + a*e^2 - (2*c*d*f - b*e*f - b*d*g + 2*a*e*g)*x^2 
 + (c*f^2 - b*f*g + a*g^2)*x^4)^(-1),x]
 

Output:

(Sqrt[2]*Sqrt[c*f^2 + g*(-(b*f) + a*g)]*(ArcTan[(Sqrt[2]*Sqrt[c*f^2 - b*f* 
g + a*g^2]*x)/Sqrt[-2*c*d*f + b*e*f + Sqrt[b^2 - 4*a*c]*e*f + b*d*g - Sqrt 
[b^2 - 4*a*c]*d*g - 2*a*e*g]]/Sqrt[-2*c*d*f + b*e*f + Sqrt[b^2 - 4*a*c]*e* 
f + b*d*g - Sqrt[b^2 - 4*a*c]*d*g - 2*a*e*g] - ArcTan[(Sqrt[2]*Sqrt[c*f^2 
- b*f*g + a*g^2]*x)/Sqrt[-2*c*d*f + b*e*f - Sqrt[b^2 - 4*a*c]*e*f + b*d*g 
+ Sqrt[b^2 - 4*a*c]*d*g - 2*a*e*g]]/Sqrt[-2*c*d*f + b*e*f - Sqrt[b^2 - 4*a 
*c]*e*f + b*d*g + Sqrt[b^2 - 4*a*c]*d*g - 2*a*e*g]))/(Sqrt[b^2 - 4*a*c]*(- 
(e*f) + d*g))
 

Rubi [A] (verified)

Time = 1.55 (sec) , antiderivative size = 359, normalized size of antiderivative = 1.33, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.031, Rules used = {1406, 221}

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 {1}{-x^2 (2 a e g-b d g-b e f+2 c d f)+x^4 \left (a g^2-b f g+c f^2\right )+a e^2-b d e+c d^2} \, dx\)

\(\Big \downarrow \) 1406

\(\displaystyle \frac {\left (a g^2-b f g+c f^2\right ) \int \frac {1}{\left (c f^2-b g f+a g^2\right ) x^2+\frac {1}{2} \left (-2 c d f+b e f+b d g-2 a e g-\sqrt {b^2-4 a c} (e f-d g)\right )}dx}{\sqrt {b^2-4 a c} (e f-d g)}-\frac {\left (a g^2-b f g+c f^2\right ) \int \frac {1}{\left (c f^2-b g f+a g^2\right ) x^2+\frac {1}{2} \left (-2 c d f+b e f+b d g-2 a e g+\sqrt {b^2-4 a c} (e f-d g)\right )}dx}{\sqrt {b^2-4 a c} (e f-d g)}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {\sqrt {2} \sqrt {a g^2-b f g+c f^2} \text {arctanh}\left (\frac {\sqrt {2} x \sqrt {a g^2-b f g+c f^2}}{\sqrt {-\sqrt {b^2-4 a c} (e f-d g)+2 a e g-b d g-b e f+2 c d f}}\right )}{\sqrt {b^2-4 a c} (e f-d g) \sqrt {d g \sqrt {b^2-4 a c}-e f \sqrt {b^2-4 a c}+2 a e g-b (d g+e f)+2 c d f}}-\frac {\sqrt {2} \sqrt {a g^2-b f g+c f^2} \text {arctanh}\left (\frac {\sqrt {2} x \sqrt {a g^2-b f g+c f^2}}{\sqrt {\sqrt {b^2-4 a c} (e f-d g)+2 a e g-b d g-b e f+2 c d f}}\right )}{\sqrt {b^2-4 a c} (e f-d g) \sqrt {-d g \sqrt {b^2-4 a c}+e f \sqrt {b^2-4 a c}+2 a e g-b (d g+e f)+2 c d f}}\)

Input:

Int[(c*d^2 - b*d*e + a*e^2 - (2*c*d*f - b*e*f - b*d*g + 2*a*e*g)*x^2 + (c* 
f^2 - b*f*g + a*g^2)*x^4)^(-1),x]
 

Output:

(Sqrt[2]*Sqrt[c*f^2 - b*f*g + a*g^2]*ArcTanh[(Sqrt[2]*Sqrt[c*f^2 - b*f*g + 
 a*g^2]*x)/Sqrt[2*c*d*f - b*e*f - b*d*g + 2*a*e*g - Sqrt[b^2 - 4*a*c]*(e*f 
 - d*g)]])/(Sqrt[b^2 - 4*a*c]*(e*f - d*g)*Sqrt[2*c*d*f - Sqrt[b^2 - 4*a*c] 
*e*f + Sqrt[b^2 - 4*a*c]*d*g + 2*a*e*g - b*(e*f + d*g)]) - (Sqrt[2]*Sqrt[c 
*f^2 - b*f*g + a*g^2]*ArcTanh[(Sqrt[2]*Sqrt[c*f^2 - b*f*g + a*g^2]*x)/Sqrt 
[2*c*d*f - b*e*f - b*d*g + 2*a*e*g + Sqrt[b^2 - 4*a*c]*(e*f - d*g)]])/(Sqr 
t[b^2 - 4*a*c]*(e*f - d*g)*Sqrt[2*c*d*f + Sqrt[b^2 - 4*a*c]*e*f - Sqrt[b^2 
 - 4*a*c]*d*g + 2*a*e*g - b*(e*f + d*g)])
 

Defintions of rubi rules used

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

rule 1406
Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[b^ 
2 - 4*a*c, 2]}, Simp[c/q   Int[1/(b/2 - q/2 + c*x^2), x], x] - Simp[c/q   I 
nt[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]
 
Maple [C] (verified)

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

Time = 0.27 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.46

method result size
risch \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\left (a \,g^{2}-b f g +c \,f^{2}\right ) \textit {\_Z}^{4}+\left (-2 a e g +b d g +b e f -2 c d f \right ) \textit {\_Z}^{2}+a \,e^{2}-b d e +c \,d^{2}\right )}{\sum }\frac {\ln \left (x -\textit {\_R} \right )}{2 \textit {\_R}^{3} a \,g^{2}-2 \textit {\_R}^{3} b f g +2 \textit {\_R}^{3} c \,f^{2}-2 \textit {\_R} a e g +\textit {\_R} b d g +\textit {\_R} b e f -2 \textit {\_R} c d f}\right )}{2}\) \(124\)
default \(\left (4 a \,g^{2}-4 b f g +4 c \,f^{2}\right ) \left (-\frac {\sqrt {2}\, \arctan \left (\frac {\left (2 a \,g^{2}-2 b f g +2 c \,f^{2}\right ) x \sqrt {2}}{2 \sqrt {\left (a \,g^{2}-b f g +c \,f^{2}\right ) \left (-2 a e g +b d g +b e f -2 c d f +\sqrt {-\left (d g -e f \right )^{2} \left (4 a c -b^{2}\right )}\right )}}\right )}{4 \sqrt {-\left (d g -e f \right )^{2} \left (4 a c -b^{2}\right )}\, \sqrt {\left (a \,g^{2}-b f g +c \,f^{2}\right ) \left (-2 a e g +b d g +b e f -2 c d f +\sqrt {-\left (d g -e f \right )^{2} \left (4 a c -b^{2}\right )}\right )}}+\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (-2 a \,g^{2}+2 b f g -2 c \,f^{2}\right ) x \sqrt {2}}{2 \sqrt {\left (2 a e g -b d g -b e f +2 c d f +\sqrt {-\left (d g -e f \right )^{2} \left (4 a c -b^{2}\right )}\right ) \left (a \,g^{2}-b f g +c \,f^{2}\right )}}\right )}{4 \sqrt {-\left (d g -e f \right )^{2} \left (4 a c -b^{2}\right )}\, \sqrt {\left (2 a e g -b d g -b e f +2 c d f +\sqrt {-\left (d g -e f \right )^{2} \left (4 a c -b^{2}\right )}\right ) \left (a \,g^{2}-b f g +c \,f^{2}\right )}}\right )\) \(381\)

Input:

int(1/(c*d^2-b*d*e+a*e^2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x^2+(a*g^2-b*f*g+c* 
f^2)*x^4),x,method=_RETURNVERBOSE)
 

Output:

1/2*sum(1/(2*_R^3*a*g^2-2*_R^3*b*f*g+2*_R^3*c*f^2-2*_R*a*e*g+_R*b*d*g+_R*b 
*e*f-2*_R*c*d*f)*ln(x-_R),_R=RootOf((a*g^2-b*f*g+c*f^2)*_Z^4+(-2*a*e*g+b*d 
*g+b*e*f-2*c*d*f)*_Z^2+a*e^2-b*d*e+c*d^2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 8845 vs. \(2 (234) = 468\).

Time = 0.35 (sec) , antiderivative size = 8845, normalized size of antiderivative = 32.76 \[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\text {Too large to display} \] Input:

integrate(1/(c*d^2-b*d*e+a*e^2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x^2+(a*g^2-b* 
f*g+c*f^2)*x^4),x, algorithm="fricas")
 

Output:

Too large to include
 

Sympy [F(-1)]

Timed out. \[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\text {Timed out} \] Input:

integrate(1/(c*d**2-b*d*e+a*e**2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x**2+(a*g** 
2-b*f*g+c*f**2)*x**4),x)
                                                                                    
                                                                                    
 

Output:

Timed out
 

Maxima [F]

\[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\int { \frac {1}{{\left (c f^{2} - b f g + a g^{2}\right )} x^{4} + c d^{2} - b d e + a e^{2} - {\left (2 \, c d f - b e f - b d g + 2 \, a e g\right )} x^{2}} \,d x } \] Input:

integrate(1/(c*d^2-b*d*e+a*e^2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x^2+(a*g^2-b* 
f*g+c*f^2)*x^4),x, algorithm="maxima")
 

Output:

integrate(1/((c*f^2 - b*f*g + a*g^2)*x^4 + c*d^2 - b*d*e + a*e^2 - (2*c*d* 
f - b*e*f - b*d*g + 2*a*e*g)*x^2), x)
 

Giac [F(-2)]

Exception generated. \[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\text {Exception raised: TypeError} \] Input:

integrate(1/(c*d^2-b*d*e+a*e^2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x^2+(a*g^2-b* 
f*g+c*f^2)*x^4),x, algorithm="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Unable to divide, perhaps due to ro 
unding error%%%{%%%{-4,[0,0,2]%%%},[1,0,3,0]%%%}+%%%{%%{poly1[%%%{2,[0,0,1 
]%%%},%%%
 

Mupad [B] (verification not implemented)

Time = 23.57 (sec) , antiderivative size = 25137, normalized size of antiderivative = 93.10 \[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\text {Too large to display} \] Input:

int(1/(x^4*(a*g^2 + c*f^2 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*(-(4*a*c - b^2)^3)^(1/2) - e*f*(-(4*a*c - b^2)^3)^(1/ 
2) + 8*a*c^2*d*f - 2*a*b^2*e*g - 2*b^2*c*d*f + 8*a^2*c*e*g - 4*a*b*c*d*g - 
 4*a*b*c*e*f)/(8*(a*b^4*e^4*f^2 + b^4*c*d^4*g^2 - b^5*d*e^3*f^2 - b^5*d^3* 
e*g^2 + 16*a^2*c^3*d^4*g^2 + 16*a^3*c^2*e^4*f^2 + 16*a^2*c^3*d^2*e^2*f^2 + 
 16*a^3*c^2*d^2*e^2*g^2 + 2*b^5*d^2*e^2*f*g - 8*a*b^2*c^2*d^4*g^2 - 8*a^2* 
b^2*c*e^4*f^2 + a*b^4*d^2*e^2*g^2 + b^4*c*d^2*e^2*f^2 - 16*a^2*b*c^2*d*e^3 
*f^2 - 16*a^2*b*c^2*d^3*e*g^2 - 2*a*b^4*d*e^3*f*g - 2*b^4*c*d^3*e*f*g -...
 

Reduce [F]

\[ \int \frac {1}{c d^2-b d e+a e^2-(2 c d f-b e f-b d g+2 a e g) x^2+\left (c f^2-b f g+a g^2\right ) x^4} \, dx=\int \frac {1}{c \,d^{2}-b d e +a \,e^{2}-\left (2 a e g -b d g -b e f +2 c d f \right ) x^{2}+\left (a \,g^{2}-b f g +c \,f^{2}\right ) x^{4}}d x \] Input:

int(1/(c*d^2-b*d*e+a*e^2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x^2+(a*g^2-b*f*g+c* 
f^2)*x^4),x)
 

Output:

int(1/(c*d^2-b*d*e+a*e^2-(2*a*e*g-b*d*g-b*e*f+2*c*d*f)*x^2+(a*g^2-b*f*g+c* 
f^2)*x^4),x)