Optimal. Leaf size=96 \[ \frac {2 (3 A-80 B) \sin (x)}{105 a^4 (\cos (x)+1)}+\frac {(6 A-55 B) \sin (x)}{105 a^4 (\cos (x)+1)^2}+\frac {B \tanh ^{-1}(\sin (x))}{a^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a \cos (x)+a)^3}+\frac {(A-B) \sin (x)}{7 (a \cos (x)+a)^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 7, 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 {2 (3 A-80 B) \sin (x)}{105 a^4 (\cos (x)+1)}+\frac {(6 A-55 B) \sin (x)}{105 a^4 (\cos (x)+1)^2}+\frac {B \tanh ^{-1}(\sin (x))}{a^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a \cos (x)+a)^3}+\frac {(A-B) \sin (x)}{7 (a \cos (x)+a)^4} \]
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))^4} \, dx &=\int \frac {(B+A \cos (x)) \sec (x)}{(a+a \cos (x))^4} \, dx\\ &=\frac {(A-B) \sin (x)}{7 (a+a \cos (x))^4}+\frac {\int \frac {(7 a B+3 a (A-B) \cos (x)) \sec (x)}{(a+a \cos (x))^3} \, dx}{7 a^2}\\ &=\frac {(A-B) \sin (x)}{7 (a+a \cos (x))^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a+a \cos (x))^3}+\frac {\int \frac {\left (35 a^2 B+2 a^2 (3 A-10 B) \cos (x)\right ) \sec (x)}{(a+a \cos (x))^2} \, dx}{35 a^4}\\ &=\frac {(6 A-55 B) \sin (x)}{105 a^4 (1+\cos (x))^2}+\frac {(A-B) \sin (x)}{7 (a+a \cos (x))^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a+a \cos (x))^3}+\frac {\int \frac {\left (105 a^3 B+a^3 (6 A-55 B) \cos (x)\right ) \sec (x)}{a+a \cos (x)} \, dx}{105 a^6}\\ &=\frac {(6 A-55 B) \sin (x)}{105 a^4 (1+\cos (x))^2}+\frac {(A-B) \sin (x)}{7 (a+a \cos (x))^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a+a \cos (x))^3}+\frac {2 (3 A-80 B) \sin (x)}{105 \left (a^4+a^4 \cos (x)\right )}+\frac {\int 105 a^4 B \sec (x) \, dx}{105 a^8}\\ &=\frac {(6 A-55 B) \sin (x)}{105 a^4 (1+\cos (x))^2}+\frac {(A-B) \sin (x)}{7 (a+a \cos (x))^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a+a \cos (x))^3}+\frac {2 (3 A-80 B) \sin (x)}{105 \left (a^4+a^4 \cos (x)\right )}+\frac {B \int \sec (x) \, dx}{a^4}\\ &=\frac {B \tanh ^{-1}(\sin (x))}{a^4}+\frac {(6 A-55 B) \sin (x)}{105 a^4 (1+\cos (x))^2}+\frac {(A-B) \sin (x)}{7 (a+a \cos (x))^4}+\frac {(3 A-10 B) \sin (x)}{35 a (a+a \cos (x))^3}+\frac {2 (3 A-80 B) \sin (x)}{105 \left (a^4+a^4 \cos (x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.75, size = 104, normalized size = 1.08 \[ \frac {\sin (x) ((87 A-1480 B) \cos (x)+(24 A-535 B) \cos (2 x)+3 A \cos (3 x)+96 A-80 B \cos (3 x)-1055 B)-3360 B \cos ^8\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 )}{210 a^4 (\cos (x)+1)^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 158, normalized size = 1.65 \[ \frac {105 \, {\left (B \cos \relax (x)^{4} + 4 \, B \cos \relax (x)^{3} + 6 \, B \cos \relax (x)^{2} + 4 \, B \cos \relax (x) + B\right )} \log \left (\sin \relax (x) + 1\right ) - 105 \, {\left (B \cos \relax (x)^{4} + 4 \, B \cos \relax (x)^{3} + 6 \, B \cos \relax (x)^{2} + 4 \, B \cos \relax (x) + B\right )} \log \left (-\sin \relax (x) + 1\right ) + 2 \, {\left (2 \, {\left (3 \, A - 80 \, B\right )} \cos \relax (x)^{3} + {\left (24 \, A - 535 \, B\right )} \cos \relax (x)^{2} + {\left (39 \, A - 620 \, B\right )} \cos \relax (x) + 36 \, A - 260 \, B\right )} \sin \relax (x)}{210 \, {\left (a^{4} \cos \relax (x)^{4} + 4 \, a^{4} \cos \relax (x)^{3} + 6 \, a^{4} \cos \relax (x)^{2} + 4 \, a^{4} \cos \relax (x) + a^{4}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 126, normalized size = 1.31 \[ \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right )}{a^{4}} - \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right )}{a^{4}} + \frac {15 \, A a^{24} \tan \left (\frac {1}{2} \, x\right )^{7} - 15 \, B a^{24} \tan \left (\frac {1}{2} \, x\right )^{7} + 63 \, A a^{24} \tan \left (\frac {1}{2} \, x\right )^{5} - 105 \, B a^{24} \tan \left (\frac {1}{2} \, x\right )^{5} + 105 \, A a^{24} \tan \left (\frac {1}{2} \, x\right )^{3} - 385 \, B a^{24} \tan \left (\frac {1}{2} \, x\right )^{3} + 105 \, A a^{24} \tan \left (\frac {1}{2} \, x\right ) - 1575 \, B a^{24} \tan \left (\frac {1}{2} \, x\right )}{840 \, a^{28}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 119, normalized size = 1.24 \[ \frac {\left (\tan ^{7}\left (\frac {x}{2}\right )\right ) A}{56 a^{4}}-\frac {\left (\tan ^{7}\left (\frac {x}{2}\right )\right ) B}{56 a^{4}}+\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right ) A}{8 a^{4}}-\frac {11 \left (\tan ^{3}\left (\frac {x}{2}\right )\right ) B}{24 a^{4}}-\frac {B \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{a^{4}}+\frac {A \tan \left (\frac {x}{2}\right )}{8 a^{4}}-\frac {15 B \tan \left (\frac {x}{2}\right )}{8 a^{4}}+\frac {B \ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{a^{4}}+\frac {3 \left (\tan ^{5}\left (\frac {x}{2}\right )\right ) A}{40 a^{4}}-\frac {\left (\tan ^{5}\left (\frac {x}{2}\right )\right ) B}{8 a^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.77, size = 143, normalized size = 1.49 \[ -\frac {1}{168} \, B {\left (\frac {\frac {315 \, \sin \relax (x)}{\cos \relax (x) + 1} + \frac {77 \, \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} + \frac {21 \, \sin \relax (x)^{5}}{{\left (\cos \relax (x) + 1\right )}^{5}} + \frac {3 \, \sin \relax (x)^{7}}{{\left (\cos \relax (x) + 1\right )}^{7}}}{a^{4}} - \frac {168 \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right )}{a^{4}} + \frac {168 \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right )}{a^{4}}\right )} + \frac {A {\left (\frac {35 \, \sin \relax (x)}{\cos \relax (x) + 1} + \frac {35 \, \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} + \frac {21 \, \sin \relax (x)^{5}}{{\left (\cos \relax (x) + 1\right )}^{5}} + \frac {5 \, \sin \relax (x)^{7}}{{\left (\cos \relax (x) + 1\right )}^{7}}\right )}}{280 \, a^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.34, size = 140, normalized size = 1.46 \[ \mathrm {tan}\left (\frac {x}{2}\right )\,\left (\frac {A-B}{8\,a^4}-\frac {3\,B}{4\,a^4}+\frac {2\,A-4\,B}{8\,a^4}-\frac {2\,A+4\,B}{8\,a^4}\right )+{\mathrm {tan}\left (\frac {x}{2}\right )}^5\,\left (\frac {A-B}{40\,a^4}+\frac {2\,A-4\,B}{40\,a^4}\right )+{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,\left (\frac {A-B}{24\,a^4}-\frac {B}{4\,a^4}+\frac {2\,A-4\,B}{24\,a^4}\right )+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^7\,\left (A-B\right )}{56\,a^4}+\frac {2\,B\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a^4} \]
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 ^{4}{\relax (x )} + 4 \cos ^{3}{\relax (x )} + 6 \cos ^{2}{\relax (x )} + 4 \cos {\relax (x )} + 1}\, dx + \int \frac {B \sec {\relax (x )}}{\cos ^{4}{\relax (x )} + 4 \cos ^{3}{\relax (x )} + 6 \cos ^{2}{\relax (x )} + 4 \cos {\relax (x )} + 1}\, dx}{a^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________