Optimal. Leaf size=160 \[ \frac {\left (a^2 (3-n)-b^2 (n+1)\right ) \sin ^{n+1}(c+d x) \, _2F_1\left (2,\frac {n+1}{2};\frac {n+3}{2};\sin ^2(c+d x)\right )}{4 d (n+1)}+\frac {\sec ^4(c+d x) \sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 d}+\frac {a b (2-n) \sin ^{n+2}(c+d x) \, _2F_1\left (2,\frac {n+2}{2};\frac {n+4}{2};\sin ^2(c+d x)\right )}{2 d (n+2)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.26, antiderivative size = 160, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2837, 1806, 808, 364} \[ \frac {\left (a^2 (3-n)-b^2 (n+1)\right ) \sin ^{n+1}(c+d x) \, _2F_1\left (2,\frac {n+1}{2};\frac {n+3}{2};\sin ^2(c+d x)\right )}{4 d (n+1)}+\frac {\sec ^4(c+d x) \sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 d}+\frac {a b (2-n) \sin ^{n+2}(c+d x) \, _2F_1\left (2,\frac {n+2}{2};\frac {n+4}{2};\sin ^2(c+d x)\right )}{2 d (n+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 364
Rule 808
Rule 1806
Rule 2837
Rubi steps
\begin {align*} \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {b^5 \operatorname {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^n (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d}-\frac {b^3 \operatorname {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^n \left (-a^2 (3-n)+b^2 (1+n)-2 a (2-n) x\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d}+\frac {\left (a b^4 (2-n)\right ) \operatorname {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^{1+n}}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{2 d}+\frac {\left (b^3 \left (a^2 (3-n)-b^2 (1+n)\right )\right ) \operatorname {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^n}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=\frac {\left (a^2 (3-n)-b^2 (1+n)\right ) \, _2F_1\left (2,\frac {1+n}{2};\frac {3+n}{2};\sin ^2(c+d x)\right ) \sin ^{1+n}(c+d x)}{4 d (1+n)}+\frac {a b (2-n) \, _2F_1\left (2,\frac {2+n}{2};\frac {4+n}{2};\sin ^2(c+d x)\right ) \sin ^{2+n}(c+d x)}{2 d (2+n)}+\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.22, size = 158, normalized size = 0.99 \[ \frac {\sin ^{n+1}(c+d x) \left (2 \left (3 a^2-b^2\right ) \, _2F_1\left (1,\frac {n+1}{2};\frac {n+3}{2};\sin ^2(c+d x)\right )+2 (a-b)^2 \, _2F_1(3,n+1;n+2;-\sin (c+d x))+(3 a+b) (a-b) \, _2F_1(2,n+1;n+2;-\sin (c+d x))+(3 a-b) (a+b) \, _2F_1(2,n+1;n+2;\sin (c+d x))+2 (a+b)^2 \, _2F_1(3,n+1;n+2;\sin (c+d x))\right )}{16 d (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.46, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (2 \, a b \sec \left (d x + c\right )^{5} \sin \left (d x + c\right ) - {\left (b^{2} \cos \left (d x + c\right )^{2} - a^{2} - b^{2}\right )} \sec \left (d x + c\right )^{5}\right )} \sin \left (d x + c\right )^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \sin \left (d x + c\right ) + a\right )}^{2} \sin \left (d x + c\right )^{n} \sec \left (d x + c\right )^{5}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 4.76, size = 0, normalized size = 0.00 \[ \int \left (\sec ^{5}\left (d x +c \right )\right ) \left (\sin ^{n}\left (d x +c \right )\right ) \left (a +b \sin \left (d x +c \right )\right )^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \sin \left (d x + c\right ) + a\right )}^{2} \sin \left (d x + c\right )^{n} \sec \left (d x + c\right )^{5}\,{d x} \]
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 {{\sin \left (c+d\,x\right )}^n\,{\left (a+b\,\sin \left (c+d\,x\right )\right )}^2}{{\cos \left (c+d\,x\right )}^5} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [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]
________________________________________________________________________________________