Optimal. Leaf size=18 \[ a x (A+B)+a A \sin (x)+a B \tanh ^{-1}(\sin (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0983354, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {2828, 2968, 3023, 2735, 3770} \[ a x (A+B)+a A \sin (x)+a B \tanh ^{-1}(\sin (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2828
Rule 2968
Rule 3023
Rule 2735
Rule 3770
Rubi steps
\begin{align*} \int (a+a \cos (x)) (A+B \sec (x)) \, dx &=\int (a+a \cos (x)) (B+A \cos (x)) \sec (x) \, dx\\ &=\int \left (a B+(a A+a B) \cos (x)+a A \cos ^2(x)\right ) \sec (x) \, dx\\ &=a A \sin (x)+\int (a B+a (A+B) \cos (x)) \sec (x) \, dx\\ &=a (A+B) x+a A \sin (x)+(a B) \int \sec (x) \, dx\\ &=a (A+B) x+a B \tanh ^{-1}(\sin (x))+a A \sin (x)\\ \end{align*}
Mathematica [B] time = 0.0152075, size = 51, normalized size = 2.83 \[ a A x+a A \sin (x)+a B x-a B \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )+a B \log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 24, normalized size = 1.3 \begin{align*} aA\sin \left ( x \right ) +Bax+aAx+Ba\ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.97508, size = 31, normalized size = 1.72 \begin{align*} A a x + B a x + B a \log \left (\sec \left (x\right ) + \tan \left (x\right )\right ) + A a \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.53537, size = 107, normalized size = 5.94 \begin{align*}{\left (A + B\right )} a x + \frac{1}{2} \, B a \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, B a \log \left (-\sin \left (x\right ) + 1\right ) + A a \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.57851, size = 27, normalized size = 1.5 \begin{align*} A a x + A a \sin{\left (x \right )} + B a x + B a \log{\left (\tan{\left (x \right )} + \sec{\left (x \right )} \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.17056, size = 69, normalized size = 3.83 \begin{align*} B a \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right ) - B a \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) +{\left (A a + B a\right )} x + \frac{2 \, A a \tan \left (\frac{1}{2} \, x\right )}{\tan \left (\frac{1}{2} \, x\right )^{2} + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]