Optimal. Leaf size=120 \[ \frac {(3 A-43 B) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a \cos (x)+a}}\right )}{16 \sqrt {2} a^{5/2}}+\frac {2 B \tanh ^{-1}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {a \cos (x)+a}}\right )}{a^{5/2}}+\frac {(3 A-11 B) \sin (x)}{16 a (a \cos (x)+a)^{3/2}}+\frac {(A-B) \sin (x)}{4 (a \cos (x)+a)^{5/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.48, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {2828, 2978, 2985, 2649, 206, 2773} \[ \frac {(3 A-43 B) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a \cos (x)+a}}\right )}{16 \sqrt {2} a^{5/2}}+\frac {2 B \tanh ^{-1}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {a \cos (x)+a}}\right )}{a^{5/2}}+\frac {(3 A-11 B) \sin (x)}{16 a (a \cos (x)+a)^{3/2}}+\frac {(A-B) \sin (x)}{4 (a \cos (x)+a)^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 2649
Rule 2773
Rule 2828
Rule 2978
Rule 2985
Rubi steps
\begin {align*} \int \frac {A+B \sec (x)}{(a+a \cos (x))^{5/2}} \, dx &=\int \frac {(B+A \cos (x)) \sec (x)}{(a+a \cos (x))^{5/2}} \, dx\\ &=\frac {(A-B) \sin (x)}{4 (a+a \cos (x))^{5/2}}+\frac {\int \frac {\left (4 a B+\frac {3}{2} a (A-B) \cos (x)\right ) \sec (x)}{(a+a \cos (x))^{3/2}} \, dx}{4 a^2}\\ &=\frac {(A-B) \sin (x)}{4 (a+a \cos (x))^{5/2}}+\frac {(3 A-11 B) \sin (x)}{16 a (a+a \cos (x))^{3/2}}+\frac {\int \frac {\left (8 a^2 B+\frac {1}{4} a^2 (3 A-11 B) \cos (x)\right ) \sec (x)}{\sqrt {a+a \cos (x)}} \, dx}{8 a^4}\\ &=\frac {(A-B) \sin (x)}{4 (a+a \cos (x))^{5/2}}+\frac {(3 A-11 B) \sin (x)}{16 a (a+a \cos (x))^{3/2}}+\frac {(3 A-43 B) \int \frac {1}{\sqrt {a+a \cos (x)}} \, dx}{32 a^2}+\frac {B \int \sqrt {a+a \cos (x)} \sec (x) \, dx}{a^3}\\ &=\frac {(A-B) \sin (x)}{4 (a+a \cos (x))^{5/2}}+\frac {(3 A-11 B) \sin (x)}{16 a (a+a \cos (x))^{3/2}}-\frac {(3 A-43 B) \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,-\frac {a \sin (x)}{\sqrt {a+a \cos (x)}}\right )}{16 a^2}-\frac {(2 B) \operatorname {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,-\frac {a \sin (x)}{\sqrt {a+a \cos (x)}}\right )}{a^2}\\ &=\frac {2 B \tanh ^{-1}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {a+a \cos (x)}}\right )}{a^{5/2}}+\frac {(3 A-43 B) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a+a \cos (x)}}\right )}{16 \sqrt {2} a^{5/2}}+\frac {(A-B) \sin (x)}{4 (a+a \cos (x))^{5/2}}+\frac {(3 A-11 B) \sin (x)}{16 a (a+a \cos (x))^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.50, size = 95, normalized size = 0.79 \[ \frac {\tan \left (\frac {x}{2}\right ) (3 A \cos (x)+7 A-11 B \cos (x)-15 B)+2 (3 A-43 B) \cos ^3\left (\frac {x}{2}\right ) \tanh ^{-1}\left (\sin \left (\frac {x}{2}\right )\right )+64 \sqrt {2} B \cos ^3\left (\frac {x}{2}\right ) \tanh ^{-1}\left (\sqrt {2} \sin \left (\frac {x}{2}\right )\right )}{16 a (a (\cos (x)+1))^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.73, size = 234, normalized size = 1.95 \[ -\frac {\sqrt {2} {\left ({\left (3 \, A - 43 \, B\right )} \cos \relax (x)^{3} + 3 \, {\left (3 \, A - 43 \, B\right )} \cos \relax (x)^{2} + 3 \, {\left (3 \, A - 43 \, B\right )} \cos \relax (x) + 3 \, A - 43 \, B\right )} \sqrt {a} \log \left (-\frac {a \cos \relax (x)^{2} + 2 \, \sqrt {2} \sqrt {a \cos \relax (x) + a} \sqrt {a} \sin \relax (x) - 2 \, a \cos \relax (x) - 3 \, a}{\cos \relax (x)^{2} + 2 \, \cos \relax (x) + 1}\right ) - 32 \, {\left (B \cos \relax (x)^{3} + 3 \, B \cos \relax (x)^{2} + 3 \, B \cos \relax (x) + B\right )} \sqrt {a} \log \left (\frac {a \cos \relax (x)^{3} - 7 \, a \cos \relax (x)^{2} - 4 \, \sqrt {a \cos \relax (x) + a} \sqrt {a} {\left (\cos \relax (x) - 2\right )} \sin \relax (x) + 8 \, a}{\cos \relax (x)^{3} + \cos \relax (x)^{2}}\right ) - 4 \, {\left ({\left (3 \, A - 11 \, B\right )} \cos \relax (x) + 7 \, A - 15 \, B\right )} \sqrt {a \cos \relax (x) + a} \sin \relax (x)}{64 \, {\left (a^{3} \cos \relax (x)^{3} + 3 \, a^{3} \cos \relax (x)^{2} + 3 \, a^{3} \cos \relax (x) + a^{3}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.95, size = 199, normalized size = 1.66 \[ \frac {1}{32} \, \sqrt {a \tan \left (\frac {1}{2} \, x\right )^{2} + a} {\left (\frac {2 \, \sqrt {2} {\left (A a^{5} - B a^{5}\right )} \tan \left (\frac {1}{2} \, x\right )^{2}}{a^{8}} + \frac {\sqrt {2} {\left (5 \, A a^{5} - 13 \, B a^{5}\right )}}{a^{8}}\right )} \tan \left (\frac {1}{2} \, x\right ) - \frac {\sqrt {2} {\left (3 \, A \sqrt {a} - 43 \, B \sqrt {a}\right )} \log \left ({\left (\sqrt {a} \tan \left (\frac {1}{2} \, x\right ) - \sqrt {a \tan \left (\frac {1}{2} \, x\right )^{2} + a}\right )}^{2}\right )}{64 \, a^{3}} + \frac {B \log \left ({\left | {\left (\sqrt {a} \tan \left (\frac {1}{2} \, x\right ) - \sqrt {a \tan \left (\frac {1}{2} \, x\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right )}{a^{\frac {5}{2}}} - \frac {B \log \left ({\left | {\left (\sqrt {a} \tan \left (\frac {1}{2} \, x\right ) - \sqrt {a \tan \left (\frac {1}{2} \, x\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right )}{a^{\frac {5}{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.36, size = 322, normalized size = 2.68 \[ \frac {\sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}\, \left (3 A \sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}+4 a}{\cos \left (\frac {x}{2}\right )}\right ) \left (\cos ^{4}\left (\frac {x}{2}\right )\right ) a -43 B \sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}+4 a}{\cos \left (\frac {x}{2}\right )}\right ) a \left (\cos ^{4}\left (\frac {x}{2}\right )\right )+32 B \ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {x}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}+8 a}{2 \cos \left (\frac {x}{2}\right )+\sqrt {2}}\right ) a \left (\cos ^{4}\left (\frac {x}{2}\right )\right )+32 B \ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {x}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}-2 a \right )}{2 \cos \left (\frac {x}{2}\right )-\sqrt {2}}\right ) a \left (\cos ^{4}\left (\frac {x}{2}\right )\right )+3 A \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}\, \left (\cos ^{2}\left (\frac {x}{2}\right )\right )-11 B \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}\, \left (\cos ^{2}\left (\frac {x}{2}\right )\right )+2 A \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}\, \sqrt {a}-2 B \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {x}{2}\right )\right )}\, \sqrt {a}\right )}{32 a^{\frac {7}{2}} \cos \left (\frac {x}{2}\right )^{3} \sin \left (\frac {x}{2}\right ) \sqrt {\left (\cos ^{2}\left (\frac {x}{2}\right )\right ) a}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {A+\frac {B}{\cos \relax (x)}}{{\left (a+a\,\cos \relax (x)\right )}^{5/2}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {A + B \sec {\relax (x )}}{\left (a \left (\cos {\relax (x )} + 1\right )\right )^{\frac {5}{2}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________