Integrand size = 29, antiderivative size = 160 \[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (a^2 (3-n)-b^2 (1+n)\right ) \operatorname {Hypergeometric2F1}\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) \operatorname {Hypergeometric2F1}\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} \] Output:
1/4*(a^2*(3-n)-b^2*(1+n))*hypergeom([2, 1/2+1/2*n],[3/2+1/2*n],sin(d*x+c)^ 2)*sin(d*x+c)^(1+n)/d/(1+n)+1/2*a*b*(2-n)*hypergeom([2, 1+1/2*n],[2+1/2*n] ,sin(d*x+c)^2)*sin(d*x+c)^(2+n)/d/(2+n)+1/4*sec(d*x+c)^4*sin(d*x+c)^(1+n)* (a^2+b^2+2*a*b*sin(d*x+c))/d
Time = 0.26 (sec) , antiderivative size = 158, normalized size of antiderivative = 0.99 \[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (2 \left (3 a^2-b^2\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {1+n}{2},\frac {3+n}{2},\sin ^2(c+d x)\right )+(a-b) (3 a+b) \operatorname {Hypergeometric2F1}(2,1+n,2+n,-\sin (c+d x))+(3 a-b) (a+b) \operatorname {Hypergeometric2F1}(2,1+n,2+n,\sin (c+d x))+2 (a-b)^2 \operatorname {Hypergeometric2F1}(3,1+n,2+n,-\sin (c+d x))+2 (a+b)^2 \operatorname {Hypergeometric2F1}(3,1+n,2+n,\sin (c+d x))\right ) \sin ^{1+n}(c+d x)}{16 d (1+n)} \] Input:
Integrate[Sec[c + d*x]^5*Sin[c + d*x]^n*(a + b*Sin[c + d*x])^2,x]
Output:
((2*(3*a^2 - b^2)*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, Sin[c + d*x]^ 2] + (a - b)*(3*a + b)*Hypergeometric2F1[2, 1 + n, 2 + n, -Sin[c + d*x]] + (3*a - b)*(a + b)*Hypergeometric2F1[2, 1 + n, 2 + n, Sin[c + d*x]] + 2*(a - b)^2*Hypergeometric2F1[3, 1 + n, 2 + n, -Sin[c + d*x]] + 2*(a + b)^2*Hy pergeometric2F1[3, 1 + n, 2 + n, Sin[c + d*x]])*Sin[c + d*x]^(1 + n))/(16* d*(1 + n))
Time = 0.43 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.12, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {3042, 3316, 558, 25, 557, 278}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (c+d x)^n (a+b \sin (c+d x))^2}{\cos (c+d x)^5}dx\) |
\(\Big \downarrow \) 3316 |
\(\displaystyle \frac {b^5 \int \frac {\sin ^n(c+d x) (a+b \sin (c+d x))^2}{\left (b^2-b^2 \sin ^2(c+d x)\right )^3}d(b \sin (c+d x))}{d}\) |
\(\Big \downarrow \) 558 |
\(\displaystyle \frac {b^5 \left (\frac {\sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 b \left (b^2-b^2 \sin ^2(c+d x)\right )^2}-\frac {\int -\frac {\sin ^n(c+d x) \left ((3-n) a^2+2 b (2-n) \sin (c+d x) a-b^2 (n+1)\right )}{\left (b^2-b^2 \sin ^2(c+d x)\right )^2}d(b \sin (c+d x))}{4 b^2}\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {b^5 \left (\frac {\int \frac {\sin ^n(c+d x) \left ((3-n) a^2+2 b (2-n) \sin (c+d x) a-b^2 (n+1)\right )}{\left (b^2-b^2 \sin ^2(c+d x)\right )^2}d(b \sin (c+d x))}{4 b^2}+\frac {\sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 b \left (b^2-b^2 \sin ^2(c+d x)\right )^2}\right )}{d}\) |
\(\Big \downarrow \) 557 |
\(\displaystyle \frac {b^5 \left (\frac {\left (a^2 (3-n)-b^2 (n+1)\right ) \int \frac {\sin ^n(c+d x)}{\left (b^2-b^2 \sin ^2(c+d x)\right )^2}d(b \sin (c+d x))+2 a b (2-n) \int \frac {\sin ^{n+1}(c+d x)}{\left (b^2-b^2 \sin ^2(c+d x)\right )^2}d(b \sin (c+d x))}{4 b^2}+\frac {\sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 b \left (b^2-b^2 \sin ^2(c+d x)\right )^2}\right )}{d}\) |
\(\Big \downarrow \) 278 |
\(\displaystyle \frac {b^5 \left (\frac {\sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 b \left (b^2-b^2 \sin ^2(c+d x)\right )^2}+\frac {\frac {\left (a^2 (3-n)-b^2 (n+1)\right ) \sin ^{n+1}(c+d x) \operatorname {Hypergeometric2F1}\left (2,\frac {n+1}{2},\frac {n+3}{2},\sin ^2(c+d x)\right )}{b^3 (n+1)}+\frac {2 a (2-n) \sin ^{n+2}(c+d x) \operatorname {Hypergeometric2F1}\left (2,\frac {n+2}{2},\frac {n+4}{2},\sin ^2(c+d x)\right )}{b^2 (n+2)}}{4 b^2}\right )}{d}\) |
Input:
Int[Sec[c + d*x]^5*Sin[c + d*x]^n*(a + b*Sin[c + d*x])^2,x]
Output:
(b^5*((Sin[c + d*x]^(1 + n)*(a^2 + b^2 + 2*a*b*Sin[c + d*x]))/(4*b*(b^2 - b^2*Sin[c + d*x]^2)^2) + (((a^2*(3 - n) - b^2*(1 + n))*Hypergeometric2F1[2 , (1 + n)/2, (3 + n)/2, Sin[c + d*x]^2]*Sin[c + d*x]^(1 + n))/(b^3*(1 + n) ) + (2*a*(2 - n)*Hypergeometric2F1[2, (2 + n)/2, (4 + n)/2, Sin[c + d*x]^2 ]*Sin[c + d*x]^(2 + n))/(b^2*(2 + n)))/(4*b^2)))/d
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[a^p*(( c*x)^(m + 1)/(c*(m + 1)))*Hypergeometric2F1[-p, (m + 1)/2, (m + 1)/2 + 1, ( -b)*(x^2/a)], x] /; FreeQ[{a, b, c, m, p}, x] && !IGtQ[p, 0] && (ILtQ[p, 0 ] || GtQ[a, 0])
Int[((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_))*((a_) + (b_.)*(x_)^2)^(p_), x_Sym bol] :> Simp[c Int[(e*x)^m*(a + b*x^2)^p, x], x] + Simp[d/e Int[(e*x)^( m + 1)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m, p}, x]
Int[((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Qx = PolynomialQuotient[(c + d*x)^n, a + b*x^2, x], f = Coeff[PolynomialRemainder[(c + d*x)^n, a + b*x^2, x], x, 0], g = Coeff[Pol ynomialRemainder[(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(-(e*x)^(m + 1))* (f + g*x)*((a + b*x^2)^(p + 1)/(2*a*e*(p + 1))), x] + Simp[1/(2*a*(p + 1)) Int[(e*x)^m*(a + b*x^2)^(p + 1)*ExpandToSum[2*a*(p + 1)*Qx + f*(m + 2*p + 3) + g*(m + 2*p + 4)*x, x], x], x]] /; FreeQ[{a, b, c, d, e, m}, x] && IGt Q[n, 1] && !IntegerQ[m] && LtQ[p, -1]
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ .)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b^p* f) Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x, b* Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1) /2] && NeQ[a^2 - b^2, 0]
\[\int \sec \left (d x +c \right )^{5} \sin \left (d x +c \right )^{n} \left (a +b \sin \left (d x +c \right )\right )^{2}d x\]
Input:
int(sec(d*x+c)^5*sin(d*x+c)^n*(a+b*sin(d*x+c))^2,x)
Output:
int(sec(d*x+c)^5*sin(d*x+c)^n*(a+b*sin(d*x+c))^2,x)
\[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\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 } \] Input:
integrate(sec(d*x+c)^5*sin(d*x+c)^n*(a+b*sin(d*x+c))^2,x, algorithm="frica s")
Output:
integral((2*a*b*sec(d*x + c)^5*sin(d*x + c) - (b^2*cos(d*x + c)^2 - a^2 - b^2)*sec(d*x + c)^5)*sin(d*x + c)^n, x)
Timed out. \[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \] Input:
integrate(sec(d*x+c)**5*sin(d*x+c)**n*(a+b*sin(d*x+c))**2,x)
Output:
Timed out
\[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\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 } \] Input:
integrate(sec(d*x+c)^5*sin(d*x+c)^n*(a+b*sin(d*x+c))^2,x, algorithm="maxim a")
Output:
integrate((b*sin(d*x + c) + a)^2*sin(d*x + c)^n*sec(d*x + c)^5, x)
Exception generated. \[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate(sec(d*x+c)^5*sin(d*x+c)^n*(a+b*sin(d*x+c))^2,x, algorithm="giac" )
Output:
Exception raised: RuntimeError >> an error occurred running a Giac command :INPUT:sage2OUTPUT:Unable to divide, perhaps due to rounding error%%%{1,[0 ,1,12,0]%%%}+%%%{6,[0,1,10,0]%%%}+%%%{15,[0,1,8,0]%%%}+%%%{20,[0,1,6,0]%%% }+%%%{15,[0,
Timed out. \[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\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 \] Input:
int((sin(c + d*x)^n*(a + b*sin(c + d*x))^2)/cos(c + d*x)^5,x)
Output:
int((sin(c + d*x)^n*(a + b*sin(c + d*x))^2)/cos(c + d*x)^5, x)
\[ \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx=\left (\int \sin \left (d x +c \right )^{n} \sec \left (d x +c \right )^{5} \sin \left (d x +c \right )^{2}d x \right ) b^{2}+2 \left (\int \sin \left (d x +c \right )^{n} \sec \left (d x +c \right )^{5} \sin \left (d x +c \right )d x \right ) a b +\left (\int \sin \left (d x +c \right )^{n} \sec \left (d x +c \right )^{5}d x \right ) a^{2} \] Input:
int(sec(d*x+c)^5*sin(d*x+c)^n*(a+b*sin(d*x+c))^2,x)
Output:
int(sin(c + d*x)**n*sec(c + d*x)**5*sin(c + d*x)**2,x)*b**2 + 2*int(sin(c + d*x)**n*sec(c + d*x)**5*sin(c + d*x),x)*a*b + int(sin(c + d*x)**n*sec(c + d*x)**5,x)*a**2