Optimal. Leaf size=192 \[ -\frac {3 b^2 \left (4 a^2+b^2\right ) \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{7/2}}+\frac {5 a b \sec (c+d x)}{2 d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))}+\frac {b \sec (c+d x)}{2 d \left (a^2-b^2\right ) (a+b \sin (c+d x))^2}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 d \left (a^2-b^2\right )^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.39, antiderivative size = 192, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2694, 2864, 2866, 12, 2660, 618, 204} \[ -\frac {3 b^2 \left (4 a^2+b^2\right ) \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{7/2}}+\frac {5 a b \sec (c+d x)}{2 d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))}+\frac {b \sec (c+d x)}{2 d \left (a^2-b^2\right ) (a+b \sin (c+d x))^2}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 d \left (a^2-b^2\right )^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 204
Rule 618
Rule 2660
Rule 2694
Rule 2864
Rule 2866
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x)}{(a+b \sin (c+d x))^3} \, dx &=\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}-\frac {\int \frac {\sec ^2(c+d x) (-2 a+3 b \sin (c+d x))}{(a+b \sin (c+d x))^2} \, dx}{2 \left (a^2-b^2\right )}\\ &=\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {5 a b \sec (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}+\frac {\int \frac {\sec ^2(c+d x) \left (2 a^2+3 b^2-10 a b \sin (c+d x)\right )}{a+b \sin (c+d x)} \, dx}{2 \left (a^2-b^2\right )^2}\\ &=\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {5 a b \sec (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 \left (a^2-b^2\right )^3 d}-\frac {\int \frac {3 b^2 \left (4 a^2+b^2\right )}{a+b \sin (c+d x)} \, dx}{2 \left (a^2-b^2\right )^3}\\ &=\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {5 a b \sec (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 \left (a^2-b^2\right )^3 d}-\frac {\left (3 b^2 \left (4 a^2+b^2\right )\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{2 \left (a^2-b^2\right )^3}\\ &=\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {5 a b \sec (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 \left (a^2-b^2\right )^3 d}-\frac {\left (3 b^2 \left (4 a^2+b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d}\\ &=\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {5 a b \sec (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 \left (a^2-b^2\right )^3 d}+\frac {\left (6 b^2 \left (4 a^2+b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d}\\ &=-\frac {3 b^2 \left (4 a^2+b^2\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2} d}+\frac {b \sec (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {5 a b \sec (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac {\sec (c+d x) \left (3 b \left (4 a^2+b^2\right )-a \left (2 a^2+13 b^2\right ) \sin (c+d x)\right )}{2 \left (a^2-b^2\right )^3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.06, size = 193, normalized size = 1.01 \[ \frac {-\frac {6 b^2 \left (4 a^2+b^2\right ) \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2}}+\frac {b^3 \cos (c+d x) \left (-8 a^2-7 a b \sin (c+d x)+b^2\right )}{(a-b)^3 (a+b)^3 (a+b \sin (c+d x))^2}+\sin \left (\frac {1}{2} (c+d x)\right ) \left (\frac {2}{(a-b)^3 \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {2}{(a+b)^3 \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.74, size = 894, normalized size = 4.66 \[ \left [\frac {4 \, a^{6} b - 12 \, a^{4} b^{3} + 12 \, a^{2} b^{5} - 4 \, b^{7} + 2 \, {\left (4 \, a^{6} b + 10 \, a^{4} b^{3} - 17 \, a^{2} b^{5} + 3 \, b^{7}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left ({\left (4 \, a^{2} b^{4} + b^{6}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (4 \, a^{3} b^{3} + a b^{5}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (4 \, a^{4} b^{2} + 5 \, a^{2} b^{4} + b^{6}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) - 2 \, {\left (2 \, a^{7} - 6 \, a^{5} b^{2} + 6 \, a^{3} b^{4} - 2 \, a b^{6} - {\left (2 \, a^{5} b^{2} + 11 \, a^{3} b^{4} - 13 \, a b^{6}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{8} b^{2} - 4 \, a^{6} b^{4} + 6 \, a^{4} b^{6} - 4 \, a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right )^{3} - 2 \, {\left (a^{9} b - 4 \, a^{7} b^{3} + 6 \, a^{5} b^{5} - 4 \, a^{3} b^{7} + a b^{9}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (a^{10} - 3 \, a^{8} b^{2} + 2 \, a^{6} b^{4} + 2 \, a^{4} b^{6} - 3 \, a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right )\right )}}, \frac {2 \, a^{6} b - 6 \, a^{4} b^{3} + 6 \, a^{2} b^{5} - 2 \, b^{7} + {\left (4 \, a^{6} b + 10 \, a^{4} b^{3} - 17 \, a^{2} b^{5} + 3 \, b^{7}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left ({\left (4 \, a^{2} b^{4} + b^{6}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (4 \, a^{3} b^{3} + a b^{5}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (4 \, a^{4} b^{2} + 5 \, a^{2} b^{4} + b^{6}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) - {\left (2 \, a^{7} - 6 \, a^{5} b^{2} + 6 \, a^{3} b^{4} - 2 \, a b^{6} - {\left (2 \, a^{5} b^{2} + 11 \, a^{3} b^{4} - 13 \, a b^{6}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{8} b^{2} - 4 \, a^{6} b^{4} + 6 \, a^{4} b^{6} - 4 \, a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right )^{3} - 2 \, {\left (a^{9} b - 4 \, a^{7} b^{3} + 6 \, a^{5} b^{5} - 4 \, a^{3} b^{7} + a b^{9}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (a^{10} - 3 \, a^{8} b^{2} + 2 \, a^{6} b^{4} + 2 \, a^{4} b^{6} - 3 \, a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right )\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 4.78, size = 385, normalized size = 2.01 \[ -\frac {\frac {3 \, {\left (4 \, a^{2} b^{2} + b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \sqrt {a^{2} - b^{2}}} + \frac {2 \, {\left (a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} b - b^{3}\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}} + \frac {9 \, a^{3} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 8 \, a^{4} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, a^{2} b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b^{7} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 23 \, a^{3} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 \, a^{4} b^{3} - a^{2} b^{5}}{{\left (a^{8} - 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} - a^{2} b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}^{2}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.28, size = 705, normalized size = 3.67 \[ -\frac {1}{d \left (a +b \right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {9 b^{4} a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2}}+\frac {2 b^{6} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2} a}-\frac {8 b^{3} a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2}}-\frac {15 b^{5} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2}}+\frac {2 b^{7} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2} a^{2}}-\frac {23 b^{4} a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2}}+\frac {2 b^{6} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2} a}-\frac {8 b^{3} a^{2}}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2}}+\frac {b^{5}}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b +a \right )^{2}}-\frac {12 b^{2} \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right ) a^{2}}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \sqrt {a^{2}-b^{2}}}-\frac {3 b^{4} \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{d \left (a -b \right )^{3} \left (a +b \right )^{3} \sqrt {a^{2}-b^{2}}}-\frac {1}{d \left (a -b \right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.82, size = 650, normalized size = 3.39 \[ -\frac {\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^5-2\,a^3\,b^2+15\,a\,b^4\right )}{a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6}-\frac {6\,a^4\,b+10\,a^2\,b^3-b^5}{a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^6+6\,a^4\,b^2+9\,a^2\,b^4-2\,b^6\right )}{a\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^6\,b+2\,a^4\,b^3+12\,a^2\,b^5-b^7\right )}{a^2\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (2\,a^6\,b+30\,a^4\,b^3+15\,a^2\,b^5-2\,b^7\right )}{a^2\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^6-18\,a^4\,b^2-31\,a^2\,b^4+2\,b^6\right )}{a\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-a^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^2+4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^2+4\,b^2\right )+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}-\frac {3\,b^2\,\mathrm {atan}\left (\frac {\frac {3\,b^2\,\left (4\,a^2+b^2\right )\,\left (2\,a^6\,b-6\,a^4\,b^3+6\,a^2\,b^5-2\,b^7\right )}{2\,{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{7/2}}+\frac {3\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2+b^2\right )\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}{{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{7/2}}}{12\,a^2\,b^2+3\,b^4}\right )\,\left (4\,a^2+b^2\right )}{d\,{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{7/2}} \]
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 {\sec ^{2}{\left (c + d x \right )}}{\left (a + b \sin {\left (c + d x \right )}\right )^{3}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________