Optimal. Leaf size=40 \[ \frac{2 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}} \]
[Out]
_______________________________________________________________________________________
Rubi [A] time = 0.0705924, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.375 \[ \frac{2 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}} \]
Antiderivative was successfully verified.
[In] Int[(a + b*Sin[x])^(-1),x]
[Out]
_______________________________________________________________________________________
Rubi in Sympy [A] time = 3.27996, size = 31, normalized size = 0.78 \[ \frac{2 \operatorname{atan}{\left (\frac{a \tan{\left (\frac{x}{2} \right )} + b}{\sqrt{a^{2} - b^{2}}} \right )}}{\sqrt{a^{2} - b^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] rubi_integrate(1/(a+b*sin(x)),x)
[Out]
_______________________________________________________________________________________
Mathematica [A] time = 0.0465735, size = 40, normalized size = 1. \[ \frac{2 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}} \]
Antiderivative was successfully verified.
[In] Integrate[(a + b*Sin[x])^(-1),x]
[Out]
_______________________________________________________________________________________
Maple [A] time = 0.014, size = 39, normalized size = 1. \[ 2\,{\frac{1}{\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( x/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) } \]
Verification of antiderivative is not currently implemented for this CAS.
[In] int(1/(a+b*sin(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/(b*sin(x) + a),x, algorithm="maxima")
[Out]
_______________________________________________________________________________________
Fricas [A] time = 0.234622, size = 1, normalized size = 0.02 \[ \left [\frac{\log \left (-\frac{2 \,{\left (a^{3} - a b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + 2 \,{\left (a^{2} b - b^{3}\right )} \cos \left (x\right ) -{\left ({\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}\right )} \sqrt{-a^{2} + b^{2}}}{b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right )}{2 \, \sqrt{-a^{2} + b^{2}}}, -\frac{\arctan \left (-\frac{a \sin \left (x\right ) + b}{\sqrt{a^{2} - b^{2}} \cos \left (x\right )}\right )}{\sqrt{a^{2} - b^{2}}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(b*sin(x) + a),x, algorithm="fricas")
[Out]
_______________________________________________________________________________________
Sympy [A] time = 27.0663, size = 114, normalized size = 2.85 \[ \begin{cases} \tilde{\infty } \log{\left (\tan{\left (\frac{x}{2} \right )} \right )} & \text{for}\: a = 0 \wedge b = 0 \\\frac{2}{b \tan{\left (\frac{x}{2} \right )} - b} & \text{for}\: a = - b \\- \frac{2}{b \tan{\left (\frac{x}{2} \right )} + b} & \text{for}\: a = b \\\frac{\log{\left (\tan{\left (\frac{x}{2} \right )} \right )}}{b} & \text{for}\: a = 0 \\- \frac{\sqrt{- a^{2} + b^{2}} \log{\left (\tan{\left (\frac{x}{2} \right )} + \frac{b}{a} - \frac{\sqrt{- a^{2} + b^{2}}}{a} \right )}}{a^{2} - b^{2}} + \frac{\sqrt{- a^{2} + b^{2}} \log{\left (\tan{\left (\frac{x}{2} \right )} + \frac{b}{a} + \frac{\sqrt{- a^{2} + b^{2}}}{a} \right )}}{a^{2} - b^{2}} & \text{otherwise} \end{cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(a+b*sin(x)),x)
[Out]
_______________________________________________________________________________________
GIAC/XCAS [A] time = 0.201879, size = 65, normalized size = 1.62 \[ \frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor{\rm sign}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, x\right ) + b}{\sqrt{a^{2} - b^{2}}}\right )\right )}}{\sqrt{a^{2} - b^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(1/(b*sin(x) + a),x, algorithm="giac")
[Out]