Optimal. Leaf size=12 \[ a \log (\sin (x))-b \tanh ^{-1}(\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0074097, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {3475, 3770} \[ a \log (\sin (x))-b \tanh ^{-1}(\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3770
Rubi steps
\begin{align*} \int (a \cot (x)+b \csc (x)) \, dx &=a \int \cot (x) \, dx+b \int \csc (x) \, dx\\ &=-b \tanh ^{-1}(\cos (x))+a \log (\sin (x))\\ \end{align*}
Mathematica [B] time = 0.0085695, size = 25, normalized size = 2.08 \[ a \log (\sin (x))+b \log \left (\sin \left (\frac{x}{2}\right )\right )-b \log \left (\cos \left (\frac{x}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.003, size = 16, normalized size = 1.3 \begin{align*} a\ln \left ( \sin \left ( x \right ) \right ) -b\ln \left ( \cot \left ( x \right ) +\csc \left ( x \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.988407, size = 20, normalized size = 1.67 \begin{align*} -b \log \left (\cot \left (x\right ) + \csc \left (x\right )\right ) + a \log \left (\sin \left (x\right )\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.01705, size = 97, normalized size = 8.08 \begin{align*} \frac{1}{2} \,{\left (a - b\right )} \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) + \frac{1}{2} \,{\left (a + b\right )} \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.124325, size = 24, normalized size = 2. \begin{align*} a \log{\left (\sin{\left (x \right )} \right )} + b \left (\frac{\log{\left (\cos{\left (x \right )} - 1 \right )}}{2} - \frac{\log{\left (\cos{\left (x \right )} + 1 \right )}}{2}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14671, size = 28, normalized size = 2.33 \begin{align*} \frac{1}{2} \, a \log \left (-\cos \left (x\right )^{2} + 1\right ) + b \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]