Optimal. Leaf size=25 \[ \frac {(A-B) \sin (x)}{a \cos (x)+a}+\frac {B \tanh ^{-1}(\sin (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {2828, 2978, 12, 3770} \[ \frac {(A-B) \sin (x)}{a \cos (x)+a}+\frac {B \tanh ^{-1}(\sin (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2828
Rule 2978
Rule 3770
Rubi steps
\begin {align*} \int \frac {A+B \sec (x)}{a+a \cos (x)} \, dx &=\int \frac {(B+A \cos (x)) \sec (x)}{a+a \cos (x)} \, dx\\ &=\frac {(A-B) \sin (x)}{a+a \cos (x)}+\frac {\int a B \sec (x) \, dx}{a^2}\\ &=\frac {(A-B) \sin (x)}{a+a \cos (x)}+\frac {B \int \sec (x) \, dx}{a}\\ &=\frac {B \tanh ^{-1}(\sin (x))}{a}+\frac {(A-B) \sin (x)}{a+a \cos (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.08, size = 71, normalized size = 2.84 \[ -\frac {2 \cos \left (\frac {x}{2}\right ) \left ((B-A) \sin \left (\frac {x}{2}\right )+B \cos \left (\frac {x}{2}\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )\right )\right )}{a (\cos (x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.14, size = 47, normalized size = 1.88 \[ \frac {{\left (B \cos \relax (x) + B\right )} \log \left (\sin \relax (x) + 1\right ) - {\left (B \cos \relax (x) + B\right )} \log \left (-\sin \relax (x) + 1\right ) + 2 \, {\left (A - B\right )} \sin \relax (x)}{2 \, {\left (a \cos \relax (x) + a\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 46, normalized size = 1.84 \[ \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right )}{a} - \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right )}{a} + \frac {A \tan \left (\frac {1}{2} \, x\right ) - B \tan \left (\frac {1}{2} \, x\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.09, size = 46, normalized size = 1.84 \[ \frac {A \tan \left (\frac {x}{2}\right )}{a}-\frac {B \tan \left (\frac {x}{2}\right )}{a}-\frac {B \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{a}+\frac {B \ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.42, size = 63, normalized size = 2.52 \[ B {\left (\frac {\log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right )}{a} - \frac {\sin \relax (x)}{a {\left (\cos \relax (x) + 1\right )}}\right )} + \frac {A \sin \relax (x)}{a {\left (\cos \relax (x) + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.36, size = 25, normalized size = 1.00 \[ \frac {2\,B\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a}+\frac {\mathrm {tan}\left (\frac {x}{2}\right )\,\left (A-B\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {A}{\cos {\relax (x )} + 1}\, dx + \int \frac {B \sec {\relax (x )}}{\cos {\relax (x )} + 1}\, dx}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________