Optimal. Leaf size=48 \[ \frac {(A-4 B) \sin (x)}{3 a^2 (\cos (x)+1)}+\frac {B \tanh ^{-1}(\sin (x))}{a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 5, 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-4 B) \sin (x)}{3 a^2 (\cos (x)+1)}+\frac {B \tanh ^{-1}(\sin (x))}{a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2} \]
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))^2} \, dx &=\int \frac {(B+A \cos (x)) \sec (x)}{(a+a \cos (x))^2} \, dx\\ &=\frac {(A-B) \sin (x)}{3 (a+a \cos (x))^2}+\frac {\int \frac {(3 a B+a (A-B) \cos (x)) \sec (x)}{a+a \cos (x)} \, dx}{3 a^2}\\ &=\frac {(A-4 B) \sin (x)}{3 a^2 (1+\cos (x))}+\frac {(A-B) \sin (x)}{3 (a+a \cos (x))^2}+\frac {\int 3 a^2 B \sec (x) \, dx}{3 a^4}\\ &=\frac {(A-4 B) \sin (x)}{3 a^2 (1+\cos (x))}+\frac {(A-B) \sin (x)}{3 (a+a \cos (x))^2}+\frac {B \int \sec (x) \, dx}{a^2}\\ &=\frac {B \tanh ^{-1}(\sin (x))}{a^2}+\frac {(A-4 B) \sin (x)}{3 a^2 (1+\cos (x))}+\frac {(A-B) \sin (x)}{3 (a+a \cos (x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.21, size = 76, normalized size = 1.58 \[ \frac {\sin (x) ((A-4 B) \cos (x)+2 A-5 B)-12 B \cos ^4\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 )}{3 a^2 (\cos (x)+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.74, size = 85, normalized size = 1.77 \[ \frac {3 \, {\left (B \cos \relax (x)^{2} + 2 \, B \cos \relax (x) + B\right )} \log \left (\sin \relax (x) + 1\right ) - 3 \, {\left (B \cos \relax (x)^{2} + 2 \, B \cos \relax (x) + B\right )} \log \left (-\sin \relax (x) + 1\right ) + 2 \, {\left ({\left (A - 4 \, B\right )} \cos \relax (x) + 2 \, A - 5 \, B\right )} \sin \relax (x)}{6 \, {\left (a^{2} \cos \relax (x)^{2} + 2 \, a^{2} \cos \relax (x) + a^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 77, normalized size = 1.60 \[ \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right )}{a^{2}} - \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right )}{a^{2}} + \frac {A a^{4} \tan \left (\frac {1}{2} \, x\right )^{3} - B a^{4} \tan \left (\frac {1}{2} \, x\right )^{3} + 3 \, A a^{4} \tan \left (\frac {1}{2} \, x\right ) - 9 \, B a^{4} \tan \left (\frac {1}{2} \, x\right )}{6 \, a^{6}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.09, size = 71, normalized size = 1.48 \[ \frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right ) A}{6 a^{2}}-\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right ) B}{6 a^{2}}+\frac {A \tan \left (\frac {x}{2}\right )}{2 a^{2}}-\frac {3 B \tan \left (\frac {x}{2}\right )}{2 a^{2}}-\frac {B \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{a^{2}}+\frac {B \ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.46, size = 93, normalized size = 1.94 \[ -\frac {1}{6} \, B {\left (\frac {\frac {9 \, \sin \relax (x)}{\cos \relax (x) + 1} + \frac {\sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}}}{a^{2}} - \frac {6 \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right )}{a^{2}} + \frac {6 \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right )}{a^{2}}\right )} + \frac {A {\left (\frac {3 \, \sin \relax (x)}{\cos \relax (x) + 1} + \frac {\sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}}\right )}}{6 \, a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.35, size = 50, normalized size = 1.04 \[ \mathrm {tan}\left (\frac {x}{2}\right )\,\left (\frac {A-B}{2\,a^2}-\frac {B}{a^2}\right )+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,\left (A-B\right )}{6\,a^2}+\frac {2\,B\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a^2} \]
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 ^{2}{\relax (x )} + 2 \cos {\relax (x )} + 1}\, dx + \int \frac {B \sec {\relax (x )}}{\cos ^{2}{\relax (x )} + 2 \cos {\relax (x )} + 1}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________