\(\int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx\) [396]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F(-1)]
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 129 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a b \sec ^5(c+d x)}{7 d}+\frac {\sec ^7(c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{7 d}+\frac {\left (6 a^2-b^2\right ) \tan (c+d x)}{7 d}+\frac {2 \left (6 a^2-b^2\right ) \tan ^3(c+d x)}{21 d}+\frac {\left (6 a^2-b^2\right ) \tan ^5(c+d x)}{35 d} \] Output:

1/7*a*b*sec(d*x+c)^5/d+1/7*sec(d*x+c)^7*(b+a*sin(d*x+c))*(a+b*sin(d*x+c))/ 
d+1/7*(6*a^2-b^2)*tan(d*x+c)/d+2/21*(6*a^2-b^2)*tan(d*x+c)^3/d+1/35*(6*a^2 
-b^2)*tan(d*x+c)^5/d
 

Mathematica [A] (verified)

Time = 0.87 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.85 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\sec ^7(c+d x) \left (240 a b+105 \left (2 a^2+b^2\right ) \sin (c+d x)+21 \left (6 a^2-b^2\right ) \sin (3 (c+d x))+42 a^2 \sin (5 (c+d x))-7 b^2 \sin (5 (c+d x))+6 a^2 \sin (7 (c+d x))-b^2 \sin (7 (c+d x))\right )}{840 d} \] Input:

Integrate[Sec[c + d*x]^8*(a + b*Sin[c + d*x])^2,x]
 

Output:

(Sec[c + d*x]^7*(240*a*b + 105*(2*a^2 + b^2)*Sin[c + d*x] + 21*(6*a^2 - b^ 
2)*Sin[3*(c + d*x)] + 42*a^2*Sin[5*(c + d*x)] - 7*b^2*Sin[5*(c + d*x)] + 6 
*a^2*Sin[7*(c + d*x)] - b^2*Sin[7*(c + d*x)]))/(840*d)
 

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.81, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 3170, 25, 3042, 3148, 3042, 4254, 2009}

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 ^8(c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+b \sin (c+d x))^2}{\cos (c+d x)^8}dx\)

\(\Big \downarrow \) 3170

\(\displaystyle \frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}-\frac {1}{7} \int -\sec ^6(c+d x) \left (6 a^2+5 b \sin (c+d x) a-b^2\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{7} \int \sec ^6(c+d x) \left (6 a^2+5 b \sin (c+d x) a-b^2\right )dx+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \int \frac {6 a^2+5 b \sin (c+d x) a-b^2}{\cos (c+d x)^6}dx+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}\)

\(\Big \downarrow \) 3148

\(\displaystyle \frac {1}{7} \left (\left (6 a^2-b^2\right ) \int \sec ^6(c+d x)dx+\frac {a b \sec ^5(c+d x)}{d}\right )+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \left (\left (6 a^2-b^2\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )^6dx+\frac {a b \sec ^5(c+d x)}{d}\right )+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}\)

\(\Big \downarrow \) 4254

\(\displaystyle \frac {1}{7} \left (\frac {a b \sec ^5(c+d x)}{d}-\frac {\left (6 a^2-b^2\right ) \int \left (\tan ^4(c+d x)+2 \tan ^2(c+d x)+1\right )d(-\tan (c+d x))}{d}\right )+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{7} \left (\frac {a b \sec ^5(c+d x)}{d}-\frac {\left (6 a^2-b^2\right ) \left (-\frac {1}{5} \tan ^5(c+d x)-\frac {2}{3} \tan ^3(c+d x)-\tan (c+d x)\right )}{d}\right )+\frac {\sec ^7(c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{7 d}\)

Input:

Int[Sec[c + d*x]^8*(a + b*Sin[c + d*x])^2,x]
 

Output:

(Sec[c + d*x]^7*(b + a*Sin[c + d*x])*(a + b*Sin[c + d*x]))/(7*d) + ((a*b*S 
ec[c + d*x]^5)/d - ((6*a^2 - b^2)*(-Tan[c + d*x] - (2*Tan[c + d*x]^3)/3 - 
Tan[c + d*x]^5/5))/d)/7
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3148
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[(-b)*((g*Cos[e + f*x])^(p + 1)/(f*g*(p + 1))), x] + 
 Simp[a   Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && 
 (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])
 

rule 3170
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x 
_)])^(m_), x_Symbol] :> Simp[(-(g*Cos[e + f*x])^(p + 1))*(a + b*Sin[e + f*x 
])^(m - 1)*((b + a*Sin[e + f*x])/(f*g*(p + 1))), x] + Simp[1/(g^2*(p + 1)) 
  Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 2)*(b^2*(m - 1) + 
a^2*(p + 2) + a*b*(m + p + 1)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, g 
}, x] && NeQ[a^2 - b^2, 0] && GtQ[m, 1] && LtQ[p, -1] && (IntegersQ[2*m, 2* 
p] || IntegerQ[m])
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 
Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.93

method result size
derivativedivides \(\frac {-a^{2} \left (-\frac {16}{35}-\frac {\sec \left (d x +c \right )^{6}}{7}-\frac {6 \sec \left (d x +c \right )^{4}}{35}-\frac {8 \sec \left (d x +c \right )^{2}}{35}\right ) \tan \left (d x +c \right )+\frac {2 a b}{7 \cos \left (d x +c \right )^{7}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{7 \cos \left (d x +c \right )^{7}}+\frac {4 \sin \left (d x +c \right )^{3}}{35 \cos \left (d x +c \right )^{5}}+\frac {8 \sin \left (d x +c \right )^{3}}{105 \cos \left (d x +c \right )^{3}}\right )}{d}\) \(120\)
default \(\frac {-a^{2} \left (-\frac {16}{35}-\frac {\sec \left (d x +c \right )^{6}}{7}-\frac {6 \sec \left (d x +c \right )^{4}}{35}-\frac {8 \sec \left (d x +c \right )^{2}}{35}\right ) \tan \left (d x +c \right )+\frac {2 a b}{7 \cos \left (d x +c \right )^{7}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{7 \cos \left (d x +c \right )^{7}}+\frac {4 \sin \left (d x +c \right )^{3}}{35 \cos \left (d x +c \right )^{5}}+\frac {8 \sin \left (d x +c \right )^{3}}{105 \cos \left (d x +c \right )^{3}}\right )}{d}\) \(120\)
risch \(-\frac {16 i \left (240 i a b \,{\mathrm e}^{7 i \left (d x +c \right )}+70 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-210 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-35 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-126 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+21 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-42 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+7 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 a^{2}+b^{2}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}\) \(141\)
parallelrisch \(-\frac {2 \left (105 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}+210 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12} a b -210 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11} a^{2}+140 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11} b^{2}+903 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}+112 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9} b^{2}+1050 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8} a b -636 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} a^{2}+456 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} b^{2}+903 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} a^{2}+112 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} b^{2}+630 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a b -210 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a^{2}+140 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} b^{2}+105 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+30 a b \right )}{105 d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{7}}\) \(261\)

Input:

int(sec(d*x+c)^8*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

1/d*(-a^2*(-16/35-1/7*sec(d*x+c)^6-6/35*sec(d*x+c)^4-8/35*sec(d*x+c)^2)*ta 
n(d*x+c)+2/7*a*b/cos(d*x+c)^7+b^2*(1/7*sin(d*x+c)^3/cos(d*x+c)^7+4/35*sin( 
d*x+c)^3/cos(d*x+c)^5+8/105*sin(d*x+c)^3/cos(d*x+c)^3))
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.77 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {30 \, a b + {\left (8 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} + 4 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 15 \, a^{2} + 15 \, b^{2}\right )} \sin \left (d x + c\right )}{105 \, d \cos \left (d x + c\right )^{7}} \] Input:

integrate(sec(d*x+c)^8*(a+b*sin(d*x+c))^2,x, algorithm="fricas")
 

Output:

1/105*(30*a*b + (8*(6*a^2 - b^2)*cos(d*x + c)^6 + 4*(6*a^2 - b^2)*cos(d*x 
+ c)^4 + 3*(6*a^2 - b^2)*cos(d*x + c)^2 + 15*a^2 + 15*b^2)*sin(d*x + c))/( 
d*cos(d*x + c)^7)
 

Sympy [F(-1)]

Timed out. \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \] Input:

integrate(sec(d*x+c)**8*(a+b*sin(d*x+c))**2,x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.75 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {3 \, {\left (5 \, \tan \left (d x + c\right )^{7} + 21 \, \tan \left (d x + c\right )^{5} + 35 \, \tan \left (d x + c\right )^{3} + 35 \, \tan \left (d x + c\right )\right )} a^{2} + {\left (15 \, \tan \left (d x + c\right )^{7} + 42 \, \tan \left (d x + c\right )^{5} + 35 \, \tan \left (d x + c\right )^{3}\right )} b^{2} + \frac {30 \, a b}{\cos \left (d x + c\right )^{7}}}{105 \, d} \] Input:

integrate(sec(d*x+c)^8*(a+b*sin(d*x+c))^2,x, algorithm="maxima")
 

Output:

1/105*(3*(5*tan(d*x + c)^7 + 21*tan(d*x + c)^5 + 35*tan(d*x + c)^3 + 35*ta 
n(d*x + c))*a^2 + (15*tan(d*x + c)^7 + 42*tan(d*x + c)^5 + 35*tan(d*x + c) 
^3)*b^2 + 30*a*b/cos(d*x + c)^7)/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 260 vs. \(2 (119) = 238\).

Time = 0.16 (sec) , antiderivative size = 260, normalized size of antiderivative = 2.02 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {2 \, {\left (105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{13} + 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{12} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 140 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 903 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 112 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 1050 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 636 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 456 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 903 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 112 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 630 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 140 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 30 \, a b\right )}}{105 \, {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{7} d} \] Input:

integrate(sec(d*x+c)^8*(a+b*sin(d*x+c))^2,x, algorithm="giac")
 

Output:

-2/105*(105*a^2*tan(1/2*d*x + 1/2*c)^13 + 210*a*b*tan(1/2*d*x + 1/2*c)^12 
- 210*a^2*tan(1/2*d*x + 1/2*c)^11 + 140*b^2*tan(1/2*d*x + 1/2*c)^11 + 903* 
a^2*tan(1/2*d*x + 1/2*c)^9 + 112*b^2*tan(1/2*d*x + 1/2*c)^9 + 1050*a*b*tan 
(1/2*d*x + 1/2*c)^8 - 636*a^2*tan(1/2*d*x + 1/2*c)^7 + 456*b^2*tan(1/2*d*x 
 + 1/2*c)^7 + 903*a^2*tan(1/2*d*x + 1/2*c)^5 + 112*b^2*tan(1/2*d*x + 1/2*c 
)^5 + 630*a*b*tan(1/2*d*x + 1/2*c)^4 - 210*a^2*tan(1/2*d*x + 1/2*c)^3 + 14 
0*b^2*tan(1/2*d*x + 1/2*c)^3 + 105*a^2*tan(1/2*d*x + 1/2*c) + 30*a*b)/((ta 
n(1/2*d*x + 1/2*c)^2 - 1)^7*d)
 

Mupad [B] (verification not implemented)

Time = 16.22 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.05 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\frac {2\,a\,b}{7}+\frac {a^2\,\sin \left (c+d\,x\right )}{7}+\frac {b^2\,\sin \left (c+d\,x\right )}{7}+{\cos \left (c+d\,x\right )}^2\,\left (\frac {6\,a^2\,\sin \left (c+d\,x\right )}{35}-\frac {b^2\,\sin \left (c+d\,x\right )}{35}\right )+{\cos \left (c+d\,x\right )}^4\,\left (\frac {8\,a^2\,\sin \left (c+d\,x\right )}{35}-\frac {4\,b^2\,\sin \left (c+d\,x\right )}{105}\right )+{\cos \left (c+d\,x\right )}^6\,\left (\frac {16\,a^2\,\sin \left (c+d\,x\right )}{35}-\frac {8\,b^2\,\sin \left (c+d\,x\right )}{105}\right )}{d\,{\cos \left (c+d\,x\right )}^7} \] Input:

int((a + b*sin(c + d*x))^2/cos(c + d*x)^8,x)
 

Output:

((2*a*b)/7 + (a^2*sin(c + d*x))/7 + (b^2*sin(c + d*x))/7 + cos(c + d*x)^2* 
((6*a^2*sin(c + d*x))/35 - (b^2*sin(c + d*x))/35) + cos(c + d*x)^4*((8*a^2 
*sin(c + d*x))/35 - (4*b^2*sin(c + d*x))/105) + cos(c + d*x)^6*((16*a^2*si 
n(c + d*x))/35 - (8*b^2*sin(c + d*x))/105))/(d*cos(c + d*x)^7)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 203, normalized size of antiderivative = 1.57 \[ \int \sec ^8(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-30 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{6} a b +90 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} a b -90 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a b +30 \cos \left (d x +c \right ) a b +48 \sin \left (d x +c \right )^{7} a^{2}-8 \sin \left (d x +c \right )^{7} b^{2}-168 \sin \left (d x +c \right )^{5} a^{2}+28 \sin \left (d x +c \right )^{5} b^{2}+210 \sin \left (d x +c \right )^{3} a^{2}-35 \sin \left (d x +c \right )^{3} b^{2}-105 \sin \left (d x +c \right ) a^{2}-30 a b}{105 \cos \left (d x +c \right ) d \left (\sin \left (d x +c \right )^{6}-3 \sin \left (d x +c \right )^{4}+3 \sin \left (d x +c \right )^{2}-1\right )} \] Input:

int(sec(d*x+c)^8*(a+b*sin(d*x+c))^2,x)
 

Output:

( - 30*cos(c + d*x)*sin(c + d*x)**6*a*b + 90*cos(c + d*x)*sin(c + d*x)**4* 
a*b - 90*cos(c + d*x)*sin(c + d*x)**2*a*b + 30*cos(c + d*x)*a*b + 48*sin(c 
 + d*x)**7*a**2 - 8*sin(c + d*x)**7*b**2 - 168*sin(c + d*x)**5*a**2 + 28*s 
in(c + d*x)**5*b**2 + 210*sin(c + d*x)**3*a**2 - 35*sin(c + d*x)**3*b**2 - 
 105*sin(c + d*x)*a**2 - 30*a*b)/(105*cos(c + d*x)*d*(sin(c + d*x)**6 - 3* 
sin(c + d*x)**4 + 3*sin(c + d*x)**2 - 1))