Optimal. Leaf size=37 \[ \frac{2 \tan ^{-1}\left (\frac{\sqrt{1-a} \tan \left (\frac{x}{2}\right )}{\sqrt{a+1}}\right )}{\sqrt{1-a^2}} \]
[Out]
_______________________________________________________________________________________
Rubi [A] time = 0.0639, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25 \[ \frac{2 \tan ^{-1}\left (\frac{\sqrt{1-a} \tan \left (\frac{x}{2}\right )}{\sqrt{a+1}}\right )}{\sqrt{1-a^2}} \]
Antiderivative was successfully verified.
[In] Int[(1 + a*Cos[x])^(-1),x]
[Out]
_______________________________________________________________________________________
Rubi in Sympy [A] time = 2.36815, size = 34, normalized size = 0.92 \[ \frac{2 \operatorname{atan}{\left (\frac{\sqrt{- a + 1} \tan{\left (\frac{x}{2} \right )}}{\sqrt{a + 1}} \right )}}{\sqrt{- a + 1} \sqrt{a + 1}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] rubi_integrate(1/(1+a*cos(x)),x)
[Out]
_______________________________________________________________________________________
Mathematica [A] time = 0.0297242, size = 31, normalized size = 0.84 \[ \frac{2 \tanh ^{-1}\left (\frac{(a-1) \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-1}}\right )}{\sqrt{a^2-1}} \]
Antiderivative was successfully verified.
[In] Integrate[(1 + a*Cos[x])^(-1),x]
[Out]
_______________________________________________________________________________________
Maple [A] time = 0.02, size = 30, normalized size = 0.8 \[ 2\,{\frac{1}{\sqrt{ \left ( 1+a \right ) \left ( a-1 \right ) }}{\it Artanh} \left ({\frac{ \left ( a-1 \right ) \tan \left ( x/2 \right ) }{\sqrt{ \left ( 1+a \right ) \left ( a-1 \right ) }}} \right ) } \]
Verification of antiderivative is not currently implemented for this CAS.
[In] int(1/(1+a*cos(x)),x)
[Out]
_______________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(a*cos(x) + 1),x, algorithm="maxima")
[Out]
_______________________________________________________________________________________
Fricas [A] time = 0.227078, size = 1, normalized size = 0.03 \[ \left [\frac{\log \left (\frac{2 \,{\left (a^{3} +{\left (a^{2} - 1\right )} \cos \left (x\right ) - a\right )} \sin \left (x\right ) -{\left ({\left (a^{2} - 2\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - 2 \, a \cos \left (x\right ) + 1\right )} \sqrt{a^{2} - 1}}{a^{2} \cos \left (x\right )^{2} + 2 \, a \cos \left (x\right ) + 1}\right )}{2 \, \sqrt{a^{2} - 1}}, \frac{\arctan \left (\frac{\sqrt{-a^{2} + 1}{\left (a + \cos \left (x\right )\right )}}{{\left (a^{2} - 1\right )} \sin \left (x\right )}\right )}{\sqrt{-a^{2} + 1}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(a*cos(x) + 1),x, algorithm="fricas")
[Out]
_______________________________________________________________________________________
Sympy [A] time = 11.1774, size = 110, normalized size = 2.97 \[ \begin{cases} - \frac{1}{\tan{\left (\frac{x}{2} \right )}} & \text{for}\: a = -1 \\\tan{\left (\frac{x}{2} \right )} & \text{for}\: a = 1 \\- \frac{\log{\left (- \sqrt{\frac{a}{a - 1} + \frac{1}{a - 1}} + \tan{\left (\frac{x}{2} \right )} \right )}}{a \sqrt{\frac{a}{a - 1} + \frac{1}{a - 1}} - \sqrt{\frac{a}{a - 1} + \frac{1}{a - 1}}} + \frac{\log{\left (\sqrt{\frac{a}{a - 1} + \frac{1}{a - 1}} + \tan{\left (\frac{x}{2} \right )} \right )}}{a \sqrt{\frac{a}{a - 1} + \frac{1}{a - 1}} - \sqrt{\frac{a}{a - 1} + \frac{1}{a - 1}}} & \text{otherwise} \end{cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(1+a*cos(x)),x)
[Out]
_______________________________________________________________________________________
GIAC/XCAS [A] time = 0.215294, size = 72, normalized size = 1.95 \[ -\frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor{\rm sign}\left (2 \, a - 2\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, x\right ) - \tan \left (\frac{1}{2} \, x\right )}{\sqrt{-a^{2} + 1}}\right )\right )}}{\sqrt{-a^{2} + 1}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(a*cos(x) + 1),x, algorithm="giac")
[Out]