\(\int \frac {1}{a-b \cos ^3(x)} \, dx\) [20]

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

Optimal result

Integrand size = 11, antiderivative size = 288 \[ \int \frac {1}{a-b \cos ^3(x)} \, dx=\frac {2 \arctan \left (\frac {\sqrt {\sqrt [3]{a}+\sqrt [3]{b}} \tan \left (\frac {x}{2}\right )}{\sqrt {\sqrt [3]{a}-\sqrt [3]{b}}}\right )}{3 a^{2/3} \sqrt {\sqrt [3]{a}-\sqrt [3]{b}} \sqrt {\sqrt [3]{a}+\sqrt [3]{b}}}+\frac {2 \arctan \left (\frac {\sqrt {\sqrt [3]{a}-\sqrt [3]{-1} \sqrt [3]{b}} \tan \left (\frac {x}{2}\right )}{\sqrt {\sqrt [3]{a}+\sqrt [3]{-1} \sqrt [3]{b}}}\right )}{3 a^{2/3} \sqrt {\sqrt [3]{a}-\sqrt [3]{-1} \sqrt [3]{b}} \sqrt {\sqrt [3]{a}+\sqrt [3]{-1} \sqrt [3]{b}}}+\frac {2 \arctan \left (\frac {\sqrt {\sqrt [3]{a}+(-1)^{2/3} \sqrt [3]{b}} \tan \left (\frac {x}{2}\right )}{\sqrt {\sqrt [3]{a}-(-1)^{2/3} \sqrt [3]{b}}}\right )}{3 a^{2/3} \sqrt {\sqrt [3]{a}-(-1)^{2/3} \sqrt [3]{b}} \sqrt {\sqrt [3]{a}+(-1)^{2/3} \sqrt [3]{b}}} \] Output:

2/3*arctan((a^(1/3)+b^(1/3))^(1/2)*tan(1/2*x)/(a^(1/3)-b^(1/3))^(1/2))/a^( 
2/3)/(a^(1/3)-b^(1/3))^(1/2)/(a^(1/3)+b^(1/3))^(1/2)+2/3*arctan((a^(1/3)-( 
-1)^(1/3)*b^(1/3))^(1/2)*tan(1/2*x)/(a^(1/3)+(-1)^(1/3)*b^(1/3))^(1/2))/a^ 
(2/3)/(a^(1/3)-(-1)^(1/3)*b^(1/3))^(1/2)/(a^(1/3)+(-1)^(1/3)*b^(1/3))^(1/2 
)+2/3*arctan((a^(1/3)+(-1)^(2/3)*b^(1/3))^(1/2)*tan(1/2*x)/(a^(1/3)-(-1)^( 
2/3)*b^(1/3))^(1/2))/a^(2/3)/(a^(1/3)-(-1)^(2/3)*b^(1/3))^(1/2)/(a^(1/3)+( 
-1)^(2/3)*b^(1/3))^(1/2)
 

Mathematica [C] (verified)

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

Time = 5.07 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.33 \[ \int \frac {1}{a-b \cos ^3(x)} \, dx=-\frac {2}{3} \text {RootSum}\left [b+3 b \text {$\#$1}^2-8 a \text {$\#$1}^3+3 b \text {$\#$1}^4+b \text {$\#$1}^6\&,\frac {2 \arctan \left (\frac {\sin (x)}{\cos (x)-\text {$\#$1}}\right ) \text {$\#$1}-i \log \left (1-2 \cos (x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}}{b-4 a \text {$\#$1}+2 b \text {$\#$1}^2+b \text {$\#$1}^4}\&\right ] \] Input:

Integrate[(a - b*Cos[x]^3)^(-1),x]
 

Output:

(-2*RootSum[b + 3*b*#1^2 - 8*a*#1^3 + 3*b*#1^4 + b*#1^6 & , (2*ArcTan[Sin[ 
x]/(Cos[x] - #1)]*#1 - I*Log[1 - 2*Cos[x]*#1 + #1^2]*#1)/(b - 4*a*#1 + 2*b 
*#1^2 + b*#1^4) & ])/3
 

Rubi [A] (verified)

Time = 0.62 (sec) , antiderivative size = 288, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3042, 3692, 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 {1}{a-b \cos ^3(x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{a-b \sin \left (x+\frac {\pi }{2}\right )^3}dx\)

\(\Big \downarrow \) 3692

\(\displaystyle \int \left (\frac {1}{3 a^{2/3} \left (\sqrt [3]{a}-\sqrt [3]{b} \cos (x)\right )}+\frac {1}{3 a^{2/3} \left (\sqrt [3]{a}+\sqrt [3]{-1} \sqrt [3]{b} \cos (x)\right )}+\frac {1}{3 a^{2/3} \left (\sqrt [3]{a}-(-1)^{2/3} \sqrt [3]{b} \cos (x)\right )}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 \arctan \left (\frac {\sqrt {\sqrt [3]{a}+\sqrt [3]{b}} \tan \left (\frac {x}{2}\right )}{\sqrt {\sqrt [3]{a}-\sqrt [3]{b}}}\right )}{3 a^{2/3} \sqrt {\sqrt [3]{a}-\sqrt [3]{b}} \sqrt {\sqrt [3]{a}+\sqrt [3]{b}}}+\frac {2 \arctan \left (\frac {\sqrt {\sqrt [3]{a}-\sqrt [3]{-1} \sqrt [3]{b}} \tan \left (\frac {x}{2}\right )}{\sqrt {\sqrt [3]{a}+\sqrt [3]{-1} \sqrt [3]{b}}}\right )}{3 a^{2/3} \sqrt {\sqrt [3]{a}-\sqrt [3]{-1} \sqrt [3]{b}} \sqrt {\sqrt [3]{a}+\sqrt [3]{-1} \sqrt [3]{b}}}+\frac {2 \arctan \left (\frac {\sqrt {\sqrt [3]{a}+(-1)^{2/3} \sqrt [3]{b}} \tan \left (\frac {x}{2}\right )}{\sqrt {\sqrt [3]{a}-(-1)^{2/3} \sqrt [3]{b}}}\right )}{3 a^{2/3} \sqrt {\sqrt [3]{a}-(-1)^{2/3} \sqrt [3]{b}} \sqrt {\sqrt [3]{a}+(-1)^{2/3} \sqrt [3]{b}}}\)

Input:

Int[(a - b*Cos[x]^3)^(-1),x]
 

Output:

(2*ArcTan[(Sqrt[a^(1/3) + b^(1/3)]*Tan[x/2])/Sqrt[a^(1/3) - b^(1/3)]])/(3* 
a^(2/3)*Sqrt[a^(1/3) - b^(1/3)]*Sqrt[a^(1/3) + b^(1/3)]) + (2*ArcTan[(Sqrt 
[a^(1/3) - (-1)^(1/3)*b^(1/3)]*Tan[x/2])/Sqrt[a^(1/3) + (-1)^(1/3)*b^(1/3) 
]])/(3*a^(2/3)*Sqrt[a^(1/3) - (-1)^(1/3)*b^(1/3)]*Sqrt[a^(1/3) + (-1)^(1/3 
)*b^(1/3)]) + (2*ArcTan[(Sqrt[a^(1/3) + (-1)^(2/3)*b^(1/3)]*Tan[x/2])/Sqrt 
[a^(1/3) - (-1)^(2/3)*b^(1/3)]])/(3*a^(2/3)*Sqrt[a^(1/3) - (-1)^(2/3)*b^(1 
/3)]*Sqrt[a^(1/3) + (-1)^(2/3)*b^(1/3)])
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3692
Int[((a_) + (b_.)*((c_.)*sin[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> 
Int[ExpandTrig[(a + b*(c*sin[e + f*x])^n)^p, x], x] /; FreeQ[{a, b, c, e, f 
, n}, x] && (IGtQ[p, 0] || (EqQ[p, -1] && IntegerQ[n]))
 
Maple [C] (verified)

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

Time = 0.64 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.32

method result size
default \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\left (a +b \right ) \textit {\_Z}^{6}+\left (3 a -3 b \right ) \textit {\_Z}^{4}+\left (3 a +3 b \right ) \textit {\_Z}^{2}+a -b \right )}{\sum }\frac {\left (\textit {\_R}^{4}+2 \textit {\_R}^{2}+1\right ) \ln \left (\tan \left (\frac {x}{2}\right )-\textit {\_R} \right )}{\textit {\_R}^{5} a +\textit {\_R}^{5} b +2 \textit {\_R}^{3} a -2 \textit {\_R}^{3} b +\textit {\_R} a +\textit {\_R} b}\right )}{3}\) \(92\)
risch \(\munderset {\textit {\_R} =\operatorname {RootOf}\left (1+\left (729 a^{6}-729 a^{4} b^{2}\right ) \textit {\_Z}^{6}+243 a^{4} \textit {\_Z}^{4}+27 a^{2} \textit {\_Z}^{2}\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{i x}+\left (-\frac {486 i a^{6}}{b}+486 i b \,a^{4}\right ) \textit {\_R}^{5}+\left (\frac {81 a^{5}}{b}-81 a^{3} b \right ) \textit {\_R}^{4}+\left (-\frac {135 i a^{4}}{b}-27 i a^{2} b \right ) \textit {\_R}^{3}+\frac {27 a^{3} \textit {\_R}^{2}}{b}-\frac {9 i a^{2} \textit {\_R}}{b}+\frac {2 a}{b}\right )\) \(138\)

Input:

int(1/(a-b*cos(x)^3),x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 1.99 (sec) , antiderivative size = 18595, normalized size of antiderivative = 64.57 \[ \int \frac {1}{a-b \cos ^3(x)} \, dx=\text {Too large to display} \] Input:

integrate(1/(a-b*cos(x)^3),x, algorithm="fricas")
 

Output:

Too large to include
 

Sympy [F(-1)]

Timed out. \[ \int \frac {1}{a-b \cos ^3(x)} \, dx=\text {Timed out} \] Input:

integrate(1/(a-b*cos(x)**3),x)
 

Output:

Timed out
 

Maxima [F]

\[ \int \frac {1}{a-b \cos ^3(x)} \, dx=\int { -\frac {1}{b \cos \left (x\right )^{3} - a} \,d x } \] Input:

integrate(1/(a-b*cos(x)^3),x, algorithm="maxima")
 

Output:

-integrate(1/(b*cos(x)^3 - a), x)
 

Giac [F]

\[ \int \frac {1}{a-b \cos ^3(x)} \, dx=\int { -\frac {1}{b \cos \left (x\right )^{3} - a} \,d x } \] Input:

integrate(1/(a-b*cos(x)^3),x, algorithm="giac")
 

Output:

integrate(-1/(b*cos(x)^3 - a), x)
 

Mupad [B] (verification not implemented)

Time = 2.59 (sec) , antiderivative size = 571, normalized size of antiderivative = 1.98 \[ \int \frac {1}{a-b \cos ^3(x)} \, dx=\sum _{k=1}^6\ln \left (-\frac {24576\,b^3\,\left (a+b\right )\,\left (324\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^5+648\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^4\,b-81\,a^4\,\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )+324\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^3\,b^2-a^3\,b\,\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )\,108+72\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^3\,{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^2-27\,a^2\,b^2\,\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )+72\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^2\,b\,{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^2-18\,a^2\,{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^3-9\,a\,b\,{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^3+4\,\mathrm {tan}\left (\frac {x}{2}\right )\,a\,{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^4+\mathrm {tan}\left (\frac {x}{2}\right )\,b\,{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^4-{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^5\right )}{{\mathrm {root}\left (d^6+27\,a^2\,d^4+243\,a^4\,d^2+729\,a^4\,\left (a^2-b^2\right ),d,k\right )}^5}\right )\,\mathrm {root}\left (729\,a^4\,b^2\,d^6-729\,a^6\,d^6-243\,a^4\,d^4-27\,a^2\,d^2-1,d,k\right ) \] Input:

int(1/(a - b*cos(x)^3),x)
 

Output:

symsum(log(-(24576*b^3*(a + b)*(324*a^5*tan(x/2) - 81*a^4*root(d^6 + 27*a^ 
2*d^4 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k) - root(d^6 + 27*a^2*d^4 + 
 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^5 - 18*a^2*root(d^6 + 27*a^2*d^4 
 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^3 + 324*a^3*b^2*tan(x/2) + 72* 
a^3*tan(x/2)*root(d^6 + 27*a^2*d^4 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, 
 k)^2 - 27*a^2*b^2*root(d^6 + 27*a^2*d^4 + 243*a^4*d^2 + 729*a^4*(a^2 - b^ 
2), d, k) + 648*a^4*b*tan(x/2) + 4*a*tan(x/2)*root(d^6 + 27*a^2*d^4 + 243* 
a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^4 + b*tan(x/2)*root(d^6 + 27*a^2*d^4 
+ 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^4 - 9*a*b*root(d^6 + 27*a^2*d^4 
 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^3 - 108*b*a^3*root(d^6 + 27*a^ 
2*d^4 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k) + 72*a^2*b*tan(x/2)*root( 
d^6 + 27*a^2*d^4 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^2))/root(d^6 + 
 27*a^2*d^4 + 243*a^4*d^2 + 729*a^4*(a^2 - b^2), d, k)^5)*root(729*a^4*b^2 
*d^6 - 729*a^6*d^6 - 243*a^4*d^4 - 27*a^2*d^2 - 1, d, k), k, 1, 6)
 

Reduce [F]

\[ \int \frac {1}{a-b \cos ^3(x)} \, dx=-\left (\int \frac {1}{\cos \left (x \right )^{3} b -a}d x \right ) \] Input:

int(1/(a-b*cos(x)^3),x)
 

Output:

 - int(1/(cos(x)**3*b - a),x)