\(\int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\) [293]

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 = 31, antiderivative size = 180 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {1}{8} \left (6 a A b+3 a^2 B+4 b^2 B\right ) x+\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin (c+d x)}{5 d}+\frac {\left (6 a A b+3 a^2 B+4 b^2 B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+a B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin ^3(c+d x)}{15 d} \] Output:

1/8*(6*A*a*b+3*B*a^2+4*B*b^2)*x+1/5*(4*A*a^2+5*A*b^2+10*B*a*b)*sin(d*x+c)/ 
d+1/8*(6*A*a*b+3*B*a^2+4*B*b^2)*cos(d*x+c)*sin(d*x+c)/d+1/4*a*(2*A*b+B*a)* 
cos(d*x+c)^3*sin(d*x+c)/d+1/5*a^2*A*cos(d*x+c)^4*sin(d*x+c)/d-1/15*(4*A*a^ 
2+5*A*b^2+10*B*a*b)*sin(d*x+c)^3/d
 

Mathematica [A] (verified)

Time = 1.06 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.81 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {60 \left (6 a A b+3 a^2 B+4 b^2 B\right ) (c+d x)+60 \left (5 a^2 A+6 A b^2+12 a b B\right ) \sin (c+d x)+120 \left (2 a A b+a^2 B+b^2 B\right ) \sin (2 (c+d x))+10 \left (5 a^2 A+4 A b^2+8 a b B\right ) \sin (3 (c+d x))+15 a (2 A b+a B) \sin (4 (c+d x))+6 a^2 A \sin (5 (c+d x))}{480 d} \] Input:

Integrate[Cos[c + d*x]^5*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]
 

Output:

(60*(6*a*A*b + 3*a^2*B + 4*b^2*B)*(c + d*x) + 60*(5*a^2*A + 6*A*b^2 + 12*a 
*b*B)*Sin[c + d*x] + 120*(2*a*A*b + a^2*B + b^2*B)*Sin[2*(c + d*x)] + 10*( 
5*a^2*A + 4*A*b^2 + 8*a*b*B)*Sin[3*(c + d*x)] + 15*a*(2*A*b + a*B)*Sin[4*( 
c + d*x)] + 6*a^2*A*Sin[5*(c + d*x)])/(480*d)
 

Rubi [A] (verified)

Time = 0.79 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.84, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.387, Rules used = {3042, 4512, 25, 3042, 4535, 3042, 3113, 2009, 4533, 3042, 3115, 24}

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 \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^5}dx\)

\(\Big \downarrow \) 4512

\(\displaystyle \frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}-\frac {1}{5} \int -\cos ^4(c+d x) \left (5 b^2 B \sec ^2(c+d x)+\left (4 A a^2+10 b B a+5 A b^2\right ) \sec (c+d x)+5 a (2 A b+a B)\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{5} \int \cos ^4(c+d x) \left (5 b^2 B \sec ^2(c+d x)+\left (4 A a^2+10 b B a+5 A b^2\right ) \sec (c+d x)+5 a (2 A b+a B)\right )dx+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \int \frac {5 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+\left (4 A a^2+10 b B a+5 A b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )+5 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^4}dx+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 4535

\(\displaystyle \frac {1}{5} \left (\left (4 a^2 A+10 a b B+5 A b^2\right ) \int \cos ^3(c+d x)dx+\int \cos ^4(c+d x) \left (5 b^2 B \sec ^2(c+d x)+5 a (2 A b+a B)\right )dx\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\left (4 a^2 A+10 a b B+5 A b^2\right ) \int \sin \left (c+d x+\frac {\pi }{2}\right )^3dx+\int \frac {5 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+5 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^4}dx\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 3113

\(\displaystyle \frac {1}{5} \left (\int \frac {5 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+5 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^4}dx-\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \int \left (1-\sin ^2(c+d x)\right )d(-\sin (c+d x))}{d}\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{5} \left (\int \frac {5 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+5 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^4}dx-\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 4533

\(\displaystyle \frac {1}{5} \left (\frac {5}{4} \left (3 a^2 B+6 a A b+4 b^2 B\right ) \int \cos ^2(c+d x)dx-\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}+\frac {5 a (a B+2 A b) \sin (c+d x) \cos ^3(c+d x)}{4 d}\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {5}{4} \left (3 a^2 B+6 a A b+4 b^2 B\right ) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}+\frac {5 a (a B+2 A b) \sin (c+d x) \cos ^3(c+d x)}{4 d}\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 3115

\(\displaystyle \frac {1}{5} \left (\frac {5}{4} \left (3 a^2 B+6 a A b+4 b^2 B\right ) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}+\frac {5 a (a B+2 A b) \sin (c+d x) \cos ^3(c+d x)}{4 d}\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{5} \left (-\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}+\frac {5}{4} \left (3 a^2 B+6 a A b+4 b^2 B\right ) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )+\frac {5 a (a B+2 A b) \sin (c+d x) \cos ^3(c+d x)}{4 d}\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}\)

Input:

Int[Cos[c + d*x]^5*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]
 

Output:

(a^2*A*Cos[c + d*x]^4*Sin[c + d*x])/(5*d) + ((5*a*(2*A*b + a*B)*Cos[c + d* 
x]^3*Sin[c + d*x])/(4*d) + (5*(6*a*A*b + 3*a^2*B + 4*b^2*B)*(x/2 + (Cos[c 
+ d*x]*Sin[c + d*x])/(2*d)))/4 - ((4*a^2*A + 5*A*b^2 + 10*a*b*B)*(-Sin[c + 
 d*x] + Sin[c + d*x]^3/3))/d)/5
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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 3113
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] 
 && IGtQ[(n - 1)/2, 0]
 

rule 3115
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 

rule 4512
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^2*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[a^2*A*Cos[ 
e + f*x]*((d*Csc[e + f*x])^(n + 1)/(d*f*n)), x] + Simp[1/(d*n)   Int[(d*Csc 
[e + f*x])^(n + 1)*(a*(2*A*b + a*B)*n + (2*a*b*B*n + A*(b^2*n + a^2*(n + 1) 
))*Csc[e + f*x] + b^2*B*n*Csc[e + f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, 
A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]
 

rule 4533
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) 
+ (A_)), x_Symbol] :> Simp[A*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + 
Simp[(C*m + A*(m + 1))/(b^2*m)   Int[(b*Csc[e + f*x])^(m + 2), x], x] /; Fr 
eeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]
 

rule 4535
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]* 
(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.)), x_Symbol] :> Simp[B/b   Int[(b*Cs 
c[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x]^2) 
, x] /; FreeQ[{b, e, f, A, B, C, m}, x]
 
Maple [A] (verified)

Time = 1.21 (sec) , antiderivative size = 147, normalized size of antiderivative = 0.82

method result size
parallelrisch \(\frac {120 \left (2 A a b +B \,a^{2}+b^{2} B \right ) \sin \left (2 d x +2 c \right )+10 \left (5 A \,a^{2}+4 A \,b^{2}+8 B a b \right ) \sin \left (3 d x +3 c \right )+15 \left (2 A a b +B \,a^{2}\right ) \sin \left (4 d x +4 c \right )+6 A \,a^{2} \sin \left (5 d x +5 c \right )+60 \left (5 A \,a^{2}+6 A \,b^{2}+12 B a b \right ) \sin \left (d x +c \right )+360 x \left (A a b +\frac {1}{2} B \,a^{2}+\frac {2}{3} b^{2} B \right ) d}{480 d}\) \(147\)
derivativedivides \(\frac {\frac {A \,a^{2} \left (\frac {8}{3}+\cos \left (d x +c \right )^{4}+\frac {4 \cos \left (d x +c \right )^{2}}{3}\right ) \sin \left (d x +c \right )}{5}+B \,a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 A a b \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 B a b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {A \,b^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+b^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(184\)
default \(\frac {\frac {A \,a^{2} \left (\frac {8}{3}+\cos \left (d x +c \right )^{4}+\frac {4 \cos \left (d x +c \right )^{2}}{3}\right ) \sin \left (d x +c \right )}{5}+B \,a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 A a b \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 B a b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {A \,b^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+b^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(184\)
risch \(\frac {3 A a b x}{4}+\frac {3 B \,a^{2} x}{8}+\frac {x \,b^{2} B}{2}+\frac {5 a^{2} A \sin \left (d x +c \right )}{8 d}+\frac {3 \sin \left (d x +c \right ) A \,b^{2}}{4 d}+\frac {3 \sin \left (d x +c \right ) B a b}{2 d}+\frac {A \,a^{2} \sin \left (5 d x +5 c \right )}{80 d}+\frac {\sin \left (4 d x +4 c \right ) A a b}{16 d}+\frac {\sin \left (4 d x +4 c \right ) B \,a^{2}}{32 d}+\frac {5 A \,a^{2} \sin \left (3 d x +3 c \right )}{48 d}+\frac {\sin \left (3 d x +3 c \right ) A \,b^{2}}{12 d}+\frac {\sin \left (3 d x +3 c \right ) B a b}{6 d}+\frac {\sin \left (2 d x +2 c \right ) A a b}{2 d}+\frac {\sin \left (2 d x +2 c \right ) B \,a^{2}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) b^{2} B}{4 d}\) \(225\)
norman \(\frac {\left (\frac {3}{4} A a b +\frac {3}{8} B \,a^{2}+\frac {1}{2} b^{2} B \right ) x +\left (-\frac {15}{4} A a b -\frac {15}{8} B \,a^{2}-\frac {5}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (-\frac {15}{4} A a b -\frac {15}{8} B \,a^{2}-\frac {5}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {3}{4} A a b +\frac {3}{8} B \,a^{2}+\frac {1}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (\frac {3}{4} A a b +\frac {3}{8} B \,a^{2}+\frac {1}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (\frac {3}{4} A a b +\frac {3}{8} B \,a^{2}+\frac {1}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}+\left (\frac {9}{4} A a b +\frac {9}{8} B \,a^{2}+\frac {3}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {9}{4} A a b +\frac {9}{8} B \,a^{2}+\frac {3}{2} b^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}-\frac {8 \left (19 A \,a^{2}+5 A \,b^{2}+10 B a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{15 d}-\frac {2 \left (2 A \,a^{2}-6 A a b -2 A \,b^{2}-3 B \,a^{2}-4 B a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{3 d}-\frac {2 \left (2 A \,a^{2}+6 A a b -2 A \,b^{2}+3 B \,a^{2}-4 B a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}+\frac {\left (8 A \,a^{2}-10 A a b +8 A \,b^{2}-5 B \,a^{2}+16 B a b -4 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{4 d}+\frac {\left (8 A \,a^{2}+10 A a b +8 A \,b^{2}+5 B \,a^{2}+16 B a b +4 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (88 A \,a^{2}-10 A a b -40 A \,b^{2}-5 B \,a^{2}-80 B a b +60 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{20 d}+\frac {\left (88 A \,a^{2}+10 A a b -40 A \,b^{2}+5 B \,a^{2}-80 B a b -60 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{20 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{5} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2}}\) \(596\)

Input:

int(cos(d*x+c)^5*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x,method=_RETURNVERBO 
SE)
 

Output:

1/480*(120*(2*A*a*b+B*a^2+B*b^2)*sin(2*d*x+2*c)+10*(5*A*a^2+4*A*b^2+8*B*a* 
b)*sin(3*d*x+3*c)+15*(2*A*a*b+B*a^2)*sin(4*d*x+4*c)+6*A*a^2*sin(5*d*x+5*c) 
+60*(5*A*a^2+6*A*b^2+12*B*a*b)*sin(d*x+c)+360*x*(A*a*b+1/2*B*a^2+2/3*b^2*B 
)*d)/d
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.79 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {15 \, {\left (3 \, B a^{2} + 6 \, A a b + 4 \, B b^{2}\right )} d x + {\left (24 \, A a^{2} \cos \left (d x + c\right )^{4} + 30 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{3} + 64 \, A a^{2} + 160 \, B a b + 80 \, A b^{2} + 8 \, {\left (4 \, A a^{2} + 10 \, B a b + 5 \, A b^{2}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (3 \, B a^{2} + 6 \, A a b + 4 \, B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \] Input:

integrate(cos(d*x+c)^5*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="f 
ricas")
 

Output:

1/120*(15*(3*B*a^2 + 6*A*a*b + 4*B*b^2)*d*x + (24*A*a^2*cos(d*x + c)^4 + 3 
0*(B*a^2 + 2*A*a*b)*cos(d*x + c)^3 + 64*A*a^2 + 160*B*a*b + 80*A*b^2 + 8*( 
4*A*a^2 + 10*B*a*b + 5*A*b^2)*cos(d*x + c)^2 + 15*(3*B*a^2 + 6*A*a*b + 4*B 
*b^2)*cos(d*x + c))*sin(d*x + c))/d
 

Sympy [F(-1)]

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

integrate(cos(d*x+c)**5*(a+b*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.98 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} A a^{2} + 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} + 30 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a b - 320 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a b - 160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b^{2} + 120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b^{2}}{480 \, d} \] Input:

integrate(cos(d*x+c)^5*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="m 
axima")
 

Output:

1/480*(32*(3*sin(d*x + c)^5 - 10*sin(d*x + c)^3 + 15*sin(d*x + c))*A*a^2 + 
 15*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*B*a^2 + 30*(12 
*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*A*a*b - 320*(sin(d*x 
+ c)^3 - 3*sin(d*x + c))*B*a*b - 160*(sin(d*x + c)^3 - 3*sin(d*x + c))*A*b 
^2 + 120*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*b^2)/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 487 vs. \(2 (168) = 336\).

Time = 0.18 (sec) , antiderivative size = 487, normalized size of antiderivative = 2.71 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx =\text {Too large to display} \] Input:

integrate(cos(d*x+c)^5*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="g 
iac")
 

Output:

1/120*(15*(3*B*a^2 + 6*A*a*b + 4*B*b^2)*(d*x + c) + 2*(120*A*a^2*tan(1/2*d 
*x + 1/2*c)^9 - 75*B*a^2*tan(1/2*d*x + 1/2*c)^9 - 150*A*a*b*tan(1/2*d*x + 
1/2*c)^9 + 240*B*a*b*tan(1/2*d*x + 1/2*c)^9 + 120*A*b^2*tan(1/2*d*x + 1/2* 
c)^9 - 60*B*b^2*tan(1/2*d*x + 1/2*c)^9 + 160*A*a^2*tan(1/2*d*x + 1/2*c)^7 
- 30*B*a^2*tan(1/2*d*x + 1/2*c)^7 - 60*A*a*b*tan(1/2*d*x + 1/2*c)^7 + 640* 
B*a*b*tan(1/2*d*x + 1/2*c)^7 + 320*A*b^2*tan(1/2*d*x + 1/2*c)^7 - 120*B*b^ 
2*tan(1/2*d*x + 1/2*c)^7 + 464*A*a^2*tan(1/2*d*x + 1/2*c)^5 + 800*B*a*b*ta 
n(1/2*d*x + 1/2*c)^5 + 400*A*b^2*tan(1/2*d*x + 1/2*c)^5 + 160*A*a^2*tan(1/ 
2*d*x + 1/2*c)^3 + 30*B*a^2*tan(1/2*d*x + 1/2*c)^3 + 60*A*a*b*tan(1/2*d*x 
+ 1/2*c)^3 + 640*B*a*b*tan(1/2*d*x + 1/2*c)^3 + 320*A*b^2*tan(1/2*d*x + 1/ 
2*c)^3 + 120*B*b^2*tan(1/2*d*x + 1/2*c)^3 + 120*A*a^2*tan(1/2*d*x + 1/2*c) 
 + 75*B*a^2*tan(1/2*d*x + 1/2*c) + 150*A*a*b*tan(1/2*d*x + 1/2*c) + 240*B* 
a*b*tan(1/2*d*x + 1/2*c) + 120*A*b^2*tan(1/2*d*x + 1/2*c) + 60*B*b^2*tan(1 
/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^5)/d
 

Mupad [B] (verification not implemented)

Time = 15.40 (sec) , antiderivative size = 307, normalized size of antiderivative = 1.71 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {x\,\left (\frac {3\,B\,a^2}{4}+\frac {3\,A\,a\,b}{2}+B\,b^2\right )}{2}+\frac {\left (2\,A\,a^2+2\,A\,b^2-\frac {5\,B\,a^2}{4}-B\,b^2-\frac {5\,A\,a\,b}{2}+4\,B\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {8\,A\,a^2}{3}+\frac {16\,A\,b^2}{3}-\frac {B\,a^2}{2}-2\,B\,b^2-A\,a\,b+\frac {32\,B\,a\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {116\,A\,a^2}{15}+\frac {40\,B\,a\,b}{3}+\frac {20\,A\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {8\,A\,a^2}{3}+\frac {16\,A\,b^2}{3}+\frac {B\,a^2}{2}+2\,B\,b^2+A\,a\,b+\frac {32\,B\,a\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,A\,a^2+2\,A\,b^2+\frac {5\,B\,a^2}{4}+B\,b^2+\frac {5\,A\,a\,b}{2}+4\,B\,a\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \] Input:

int(cos(c + d*x)^5*(A + B/cos(c + d*x))*(a + b/cos(c + d*x))^2,x)
 

Output:

(x*((3*B*a^2)/4 + B*b^2 + (3*A*a*b)/2))/2 + (tan(c/2 + (d*x)/2)^5*((116*A* 
a^2)/15 + (20*A*b^2)/3 + (40*B*a*b)/3) + tan(c/2 + (d*x)/2)^9*(2*A*a^2 + 2 
*A*b^2 - (5*B*a^2)/4 - B*b^2 - (5*A*a*b)/2 + 4*B*a*b) + tan(c/2 + (d*x)/2) 
^3*((8*A*a^2)/3 + (16*A*b^2)/3 + (B*a^2)/2 + 2*B*b^2 + A*a*b + (32*B*a*b)/ 
3) + tan(c/2 + (d*x)/2)^7*((8*A*a^2)/3 + (16*A*b^2)/3 - (B*a^2)/2 - 2*B*b^ 
2 - A*a*b + (32*B*a*b)/3) + tan(c/2 + (d*x)/2)*(2*A*a^2 + 2*A*b^2 + (5*B*a 
^2)/4 + B*b^2 + (5*A*a*b)/2 + 4*B*a*b))/(d*(5*tan(c/2 + (d*x)/2)^2 + 10*ta 
n(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/2)^6 + 5*tan(c/2 + (d*x)/2)^8 + ta 
n(c/2 + (d*x)/2)^10 + 1))
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.77 \[ \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {-90 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a^{2} b +225 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{2} b +60 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{3}+24 \sin \left (d x +c \right )^{5} a^{3}-80 \sin \left (d x +c \right )^{3} a^{3}-120 \sin \left (d x +c \right )^{3} a \,b^{2}+120 \sin \left (d x +c \right ) a^{3}+360 \sin \left (d x +c \right ) a \,b^{2}+135 a^{2} b d x +60 b^{3} d x}{120 d} \] Input:

int(cos(d*x+c)^5*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x)
 

Output:

( - 90*cos(c + d*x)*sin(c + d*x)**3*a**2*b + 225*cos(c + d*x)*sin(c + d*x) 
*a**2*b + 60*cos(c + d*x)*sin(c + d*x)*b**3 + 24*sin(c + d*x)**5*a**3 - 80 
*sin(c + d*x)**3*a**3 - 120*sin(c + d*x)**3*a*b**2 + 120*sin(c + d*x)*a**3 
 + 360*sin(c + d*x)*a*b**2 + 135*a**2*b*d*x + 60*b**3*d*x)/(120*d)