\(\int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx\) [303]

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

Optimal result

Integrand size = 29, antiderivative size = 250 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {\left (8 a^4 A+24 a^2 A b^2+3 A b^4+16 a^3 b B+12 a b^3 B\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {\left (95 a^3 A b+80 a A b^3+12 a^4 B+112 a^2 b^2 B+16 b^4 B\right ) \tan (c+d x)}{30 d}+\frac {b \left (130 a^2 A b+45 A b^3+24 a^3 B+116 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (35 a A b+12 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 d}+\frac {(5 A b+4 a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 d} \] Output:

1/8*(8*A*a^4+24*A*a^2*b^2+3*A*b^4+16*B*a^3*b+12*B*a*b^3)*arctanh(sin(d*x+c 
))/d+1/30*(95*A*a^3*b+80*A*a*b^3+12*B*a^4+112*B*a^2*b^2+16*B*b^4)*tan(d*x+ 
c)/d+1/120*b*(130*A*a^2*b+45*A*b^3+24*B*a^3+116*B*a*b^2)*sec(d*x+c)*tan(d* 
x+c)/d+1/60*(35*A*a*b+12*B*a^2+16*B*b^2)*(a+b*sec(d*x+c))^2*tan(d*x+c)/d+1 
/20*(5*A*b+4*B*a)*(a+b*sec(d*x+c))^3*tan(d*x+c)/d+1/5*B*(a+b*sec(d*x+c))^4 
*tan(d*x+c)/d
 

Mathematica [A] (verified)

Time = 4.28 (sec) , antiderivative size = 203, normalized size of antiderivative = 0.81 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {120 a^4 A \coth ^{-1}(\sin (c+d x))+15 b \left (24 a^2 A b+3 A b^3+16 a^3 B+12 a b^2 B\right ) \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (120 \left (4 a^3 A b+4 a A b^3+a^4 B+6 a^2 b^2 B+b^4 B\right )+15 b \left (24 a^2 A b+3 A b^3+16 a^3 B+12 a b^2 B\right ) \sec (c+d x)+30 b^3 (A b+4 a B) \sec ^3(c+d x)+80 b^2 \left (2 a A b+3 a^2 B+b^2 B\right ) \tan ^2(c+d x)+24 b^4 B \tan ^4(c+d x)\right )}{120 d} \] Input:

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

Output:

(120*a^4*A*ArcCoth[Sin[c + d*x]] + 15*b*(24*a^2*A*b + 3*A*b^3 + 16*a^3*B + 
 12*a*b^2*B)*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(120*(4*a^3*A*b + 4*a*A* 
b^3 + a^4*B + 6*a^2*b^2*B + b^4*B) + 15*b*(24*a^2*A*b + 3*A*b^3 + 16*a^3*B 
 + 12*a*b^2*B)*Sec[c + d*x] + 30*b^3*(A*b + 4*a*B)*Sec[c + d*x]^3 + 80*b^2 
*(2*a*A*b + 3*a^2*B + b^2*B)*Tan[c + d*x]^2 + 24*b^4*B*Tan[c + d*x]^4))/(1 
20*d)
 

Rubi [A] (verified)

Time = 1.46 (sec) , antiderivative size = 266, normalized size of antiderivative = 1.06, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.483, Rules used = {3042, 4490, 3042, 4490, 3042, 4490, 3042, 4485, 3042, 4274, 3042, 4254, 24, 4257}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4490

\(\displaystyle \frac {1}{5} \int \sec (c+d x) (a+b \sec (c+d x))^3 (5 a A+4 b B+(5 A b+4 a B) \sec (c+d x))dx+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4490

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \int \sec (c+d x) (a+b \sec (c+d x))^2 \left (20 A a^2+28 b B a+15 A b^2+\left (12 B a^2+35 A b a+16 b^2 B\right ) \sec (c+d x)\right )dx+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (20 A a^2+28 b B a+15 A b^2+\left (12 B a^2+35 A b a+16 b^2 B\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 4490

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \int \sec (c+d x) (a+b \sec (c+d x)) \left (60 A a^3+108 b B a^2+115 A b^2 a+32 b^3 B+\left (24 B a^3+130 A b a^2+116 b^2 B a+45 A b^3\right ) \sec (c+d x)\right )dx+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (60 A a^3+108 b B a^2+115 A b^2 a+32 b^3 B+\left (24 B a^3+130 A b a^2+116 b^2 B a+45 A b^3\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 4485

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \int \sec (c+d x) \left (15 \left (8 A a^4+16 b B a^3+24 A b^2 a^2+12 b^3 B a+3 A b^4\right )+4 \left (12 B a^4+95 A b a^3+112 b^2 B a^2+80 A b^3 a+16 b^4 B\right ) \sec (c+d x)\right )dx+\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (15 \left (8 A a^4+16 b B a^3+24 A b^2 a^2+12 b^3 B a+3 A b^4\right )+4 \left (12 B a^4+95 A b a^3+112 b^2 B a^2+80 A b^3 a+16 b^4 B\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 4274

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \left (4 \left (12 a^4 B+95 a^3 A b+112 a^2 b^2 B+80 a A b^3+16 b^4 B\right ) \int \sec ^2(c+d x)dx+15 \left (8 a^4 A+16 a^3 b B+24 a^2 A b^2+12 a b^3 B+3 A b^4\right ) \int \sec (c+d x)dx\right )+\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \left (15 \left (8 a^4 A+16 a^3 b B+24 a^2 A b^2+12 a b^3 B+3 A b^4\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+4 \left (12 a^4 B+95 a^3 A b+112 a^2 b^2 B+80 a A b^3+16 b^4 B\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx\right )+\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 4254

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \left (15 \left (8 a^4 A+16 a^3 b B+24 a^2 A b^2+12 a b^3 B+3 A b^4\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {4 \left (12 a^4 B+95 a^3 A b+112 a^2 b^2 B+80 a A b^3+16 b^4 B\right ) \int 1d(-\tan (c+d x))}{d}\right )+\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \left (15 \left (8 a^4 A+16 a^3 b B+24 a^2 A b^2+12 a b^3 B+3 A b^4\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {4 \left (12 a^4 B+95 a^3 A b+112 a^2 b^2 B+80 a A b^3+16 b^4 B\right ) \tan (c+d x)}{d}\right )+\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {1}{5} \left (\frac {1}{4} \left (\frac {\left (12 a^2 B+35 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}+\frac {1}{3} \left (\frac {b \left (24 a^3 B+130 a^2 A b+116 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {1}{2} \left (\frac {15 \left (8 a^4 A+16 a^3 b B+24 a^2 A b^2+12 a b^3 B+3 A b^4\right ) \text {arctanh}(\sin (c+d x))}{d}+\frac {4 \left (12 a^4 B+95 a^3 A b+112 a^2 b^2 B+80 a A b^3+16 b^4 B\right ) \tan (c+d x)}{d}\right )\right )\right )+\frac {(4 a B+5 A b) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 d}\)

Input:

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

Output:

(B*(a + b*Sec[c + d*x])^4*Tan[c + d*x])/(5*d) + (((5*A*b + 4*a*B)*(a + b*S 
ec[c + d*x])^3*Tan[c + d*x])/(4*d) + (((35*a*A*b + 12*a^2*B + 16*b^2*B)*(a 
 + b*Sec[c + d*x])^2*Tan[c + d*x])/(3*d) + ((b*(130*a^2*A*b + 45*A*b^3 + 2 
4*a^3*B + 116*a*b^2*B)*Sec[c + d*x]*Tan[c + d*x])/(2*d) + ((15*(8*a^4*A + 
24*a^2*A*b^2 + 3*A*b^4 + 16*a^3*b*B + 12*a*b^3*B)*ArcTanh[Sin[c + d*x]])/d 
 + (4*(95*a^3*A*b + 80*a*A*b^3 + 12*a^4*B + 112*a^2*b^2*B + 16*b^4*B)*Tan[ 
c + d*x])/d)/2)/3)/4)/5
 

Defintions of rubi rules used

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

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

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]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4274
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_)), x_Symbol] :> Simp[a   Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d   In 
t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
 

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

rule 4490
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs 
c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*(( 
a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[1/(m + 1)   Int[Csc[e + f*x]* 
(a + b*Csc[e + f*x])^(m - 1)*Simp[b*B*m + a*A*(m + 1) + (a*B*m + A*b*(m + 1 
))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a* 
B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0]
 
Maple [A] (verified)

Time = 1.95 (sec) , antiderivative size = 237, normalized size of antiderivative = 0.95

method result size
parts \(\frac {\left (A \,b^{4}+4 a \,b^{3} B \right ) \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}-\frac {\left (4 A a \,b^{3}+6 B \,a^{2} b^{2}\right ) \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (6 A \,a^{2} b^{2}+4 a^{3} b B \right ) \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {\left (4 A \,a^{3} b +B \,a^{4}\right ) \tan \left (d x +c \right )}{d}+\frac {a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {B \,b^{4} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(237\)
derivativedivides \(\frac {a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{4} \tan \left (d x +c \right )+4 A \,a^{3} b \tan \left (d x +c \right )+4 a^{3} b B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+6 A \,a^{2} b^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-6 B \,a^{2} b^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-4 A a \,b^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+4 a \,b^{3} B \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+A \,b^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-B \,b^{4} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(313\)
default \(\frac {a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{4} \tan \left (d x +c \right )+4 A \,a^{3} b \tan \left (d x +c \right )+4 a^{3} b B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+6 A \,a^{2} b^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-6 B \,a^{2} b^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-4 A a \,b^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+4 a \,b^{3} B \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+A \,b^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-B \,b^{4} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(313\)
parallelrisch \(\frac {-120 \left (a^{4} A +3 A \,a^{2} b^{2}+\frac {3}{8} A \,b^{4}+2 a^{3} b B +\frac {3}{2} a \,b^{3} B \right ) \left (10 \cos \left (d x +c \right )+5 \cos \left (3 d x +3 c \right )+\cos \left (5 d x +5 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+120 \left (a^{4} A +3 A \,a^{2} b^{2}+\frac {3}{8} A \,b^{4}+2 a^{3} b B +\frac {3}{2} a \,b^{3} B \right ) \left (10 \cos \left (d x +c \right )+5 \cos \left (3 d x +3 c \right )+\cos \left (5 d x +5 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (1440 A \,a^{3} b +1600 A a \,b^{3}+360 B \,a^{4}+2400 B \,a^{2} b^{2}+320 B \,b^{4}\right ) \sin \left (3 d x +3 c \right )+\left (480 A \,a^{3} b +320 A a \,b^{3}+120 B \,a^{4}+480 B \,a^{2} b^{2}+64 B \,b^{4}\right ) \sin \left (5 d x +5 c \right )+\left (1440 A \,a^{2} b^{2}+420 A \,b^{4}+960 a^{3} b B +1680 a \,b^{3} B \right ) \sin \left (2 d x +2 c \right )+\left (720 A \,a^{2} b^{2}+90 A \,b^{4}+480 a^{3} b B +360 a \,b^{3} B \right ) \sin \left (4 d x +4 c \right )+960 \sin \left (d x +c \right ) \left (A \,a^{3} b +\frac {4}{3} A a \,b^{3}+\frac {1}{4} B \,a^{4}+2 B \,a^{2} b^{2}+\frac {2}{3} B \,b^{4}\right )}{120 d \left (10 \cos \left (d x +c \right )+5 \cos \left (3 d x +3 c \right )+\cos \left (5 d x +5 c \right )\right )}\) \(409\)
norman \(\frac {-\frac {4 \left (180 A \,a^{3} b +100 A a \,b^{3}+45 B \,a^{4}+150 B \,a^{2} b^{2}+29 B \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{15 d}-\frac {\left (32 A \,a^{3} b -24 A \,a^{2} b^{2}+32 A a \,b^{3}-5 A \,b^{4}+8 B \,a^{4}-16 a^{3} b B +48 B \,a^{2} b^{2}-20 a \,b^{3} B +8 B \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}-\frac {\left (32 A \,a^{3} b +24 A \,a^{2} b^{2}+32 A a \,b^{3}+5 A \,b^{4}+8 B \,a^{4}+16 a^{3} b B +48 B \,a^{2} b^{2}+20 a \,b^{3} B +8 B \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (192 A \,a^{3} b -72 A \,a^{2} b^{2}+128 A a \,b^{3}-3 A \,b^{4}+48 B \,a^{4}-48 a^{3} b B +192 B \,a^{2} b^{2}-12 a \,b^{3} B +16 B \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{6 d}+\frac {\left (192 A \,a^{3} b +72 A \,a^{2} b^{2}+128 A a \,b^{3}+3 A \,b^{4}+48 B \,a^{4}+48 a^{3} b B +192 B \,a^{2} b^{2}+12 a \,b^{3} B +16 B \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{6 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{5}}-\frac {\left (8 a^{4} A +24 A \,a^{2} b^{2}+3 A \,b^{4}+16 a^{3} b B +12 a \,b^{3} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (8 a^{4} A +24 A \,a^{2} b^{2}+3 A \,b^{4}+16 a^{3} b B +12 a \,b^{3} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(499\)
risch \(\frac {i \left (-360 A \,a^{2} b^{2} {\mathrm e}^{9 i \left (d x +c \right )}+64 B \,b^{4}+320 A a \,b^{3}+480 A \,a^{3} b +480 B \,a^{2} b^{2}+1920 A \,a^{3} b \,{\mathrm e}^{2 i \left (d x +c \right )}+1600 A a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+2400 B \,a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+3360 B \,a^{2} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+720 A \,a^{2} b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+480 B \,a^{3} b \,{\mathrm e}^{3 i \left (d x +c \right )}+840 B a \,b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+1440 B \,a^{2} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+2880 A \,a^{3} b \,{\mathrm e}^{4 i \left (d x +c \right )}+2240 A a \,b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-840 B a \,b^{3} {\mathrm e}^{7 i \left (d x +c \right )}+1920 A \,a^{3} b \,{\mathrm e}^{6 i \left (d x +c \right )}+960 A a \,b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-240 B \,a^{3} b \,{\mathrm e}^{9 i \left (d x +c \right )}-180 B a \,b^{3} {\mathrm e}^{9 i \left (d x +c \right )}+480 A \,a^{3} b \,{\mathrm e}^{8 i \left (d x +c \right )}-720 A \,a^{2} b^{2} {\mathrm e}^{7 i \left (d x +c \right )}-480 B \,a^{3} b \,{\mathrm e}^{7 i \left (d x +c \right )}+360 A \,a^{2} b^{2} {\mathrm e}^{i \left (d x +c \right )}+240 B \,a^{3} b \,{\mathrm e}^{i \left (d x +c \right )}+180 B a \,b^{3} {\mathrm e}^{i \left (d x +c \right )}+120 B \,a^{4}+120 B \,a^{4} {\mathrm e}^{8 i \left (d x +c \right )}+210 A \,b^{4} {\mathrm e}^{3 i \left (d x +c \right )}+480 B \,a^{4} {\mathrm e}^{6 i \left (d x +c \right )}+45 A \,b^{4} {\mathrm e}^{i \left (d x +c \right )}+480 B \,a^{4} {\mathrm e}^{2 i \left (d x +c \right )}+320 B \,b^{4} {\mathrm e}^{2 i \left (d x +c \right )}+640 B \,b^{4} {\mathrm e}^{4 i \left (d x +c \right )}+720 B \,a^{4} {\mathrm e}^{4 i \left (d x +c \right )}-210 A \,b^{4} {\mathrm e}^{7 i \left (d x +c \right )}-45 A \,b^{4} {\mathrm e}^{9 i \left (d x +c \right )}\right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{4} A}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,a^{2} b^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{4}}{8 d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{3} b B}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a \,b^{3} B}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{4} A}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,a^{2} b^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{4}}{8 d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{3} b B}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a \,b^{3} B}{2 d}\) \(802\)

Input:

int(sec(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE 
)
 

Output:

(A*b^4+4*B*a*b^3)/d*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln 
(sec(d*x+c)+tan(d*x+c)))-(4*A*a*b^3+6*B*a^2*b^2)/d*(-2/3-1/3*sec(d*x+c)^2) 
*tan(d*x+c)+(6*A*a^2*b^2+4*B*a^3*b)/d*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(se 
c(d*x+c)+tan(d*x+c)))+(4*A*a^3*b+B*a^4)/d*tan(d*x+c)+a^4*A/d*ln(sec(d*x+c) 
+tan(d*x+c))-B*b^4/d*(-8/15-1/5*sec(d*x+c)^4-4/15*sec(d*x+c)^2)*tan(d*x+c)
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 281, normalized size of antiderivative = 1.12 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {15 \, {\left (8 \, A a^{4} + 16 \, B a^{3} b + 24 \, A a^{2} b^{2} + 12 \, B a b^{3} + 3 \, A b^{4}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (8 \, A a^{4} + 16 \, B a^{3} b + 24 \, A a^{2} b^{2} + 12 \, B a b^{3} + 3 \, A b^{4}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (24 \, B b^{4} + 8 \, {\left (15 \, B a^{4} + 60 \, A a^{3} b + 60 \, B a^{2} b^{2} + 40 \, A a b^{3} + 8 \, B b^{4}\right )} \cos \left (d x + c\right )^{4} + 15 \, {\left (16 \, B a^{3} b + 24 \, A a^{2} b^{2} + 12 \, B a b^{3} + 3 \, A b^{4}\right )} \cos \left (d x + c\right )^{3} + 16 \, {\left (15 \, B a^{2} b^{2} + 10 \, A a b^{3} + 2 \, B b^{4}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (4 \, B a b^{3} + A b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \] Input:

integrate(sec(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)),x, algorithm="fri 
cas")
 

Output:

1/240*(15*(8*A*a^4 + 16*B*a^3*b + 24*A*a^2*b^2 + 12*B*a*b^3 + 3*A*b^4)*cos 
(d*x + c)^5*log(sin(d*x + c) + 1) - 15*(8*A*a^4 + 16*B*a^3*b + 24*A*a^2*b^ 
2 + 12*B*a*b^3 + 3*A*b^4)*cos(d*x + c)^5*log(-sin(d*x + c) + 1) + 2*(24*B* 
b^4 + 8*(15*B*a^4 + 60*A*a^3*b + 60*B*a^2*b^2 + 40*A*a*b^3 + 8*B*b^4)*cos( 
d*x + c)^4 + 15*(16*B*a^3*b + 24*A*a^2*b^2 + 12*B*a*b^3 + 3*A*b^4)*cos(d*x 
 + c)^3 + 16*(15*B*a^2*b^2 + 10*A*a*b^3 + 2*B*b^4)*cos(d*x + c)^2 + 30*(4* 
B*a*b^3 + A*b^4)*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^5)
 

Sympy [F]

\[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{4} \sec {\left (c + d x \right )}\, dx \] Input:

integrate(sec(d*x+c)*(a+b*sec(d*x+c))**4*(A+B*sec(d*x+c)),x)
 

Output:

Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))**4*sec(c + d*x), x)
 

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 379, normalized size of antiderivative = 1.52 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {480 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} b^{2} + 320 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a b^{3} + 16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B b^{4} - 60 \, B a b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 15 \, A b^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 240 \, B a^{3} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 360 \, A a^{2} b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 240 \, A a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 240 \, B a^{4} \tan \left (d x + c\right ) + 960 \, A a^{3} b \tan \left (d x + c\right )}{240 \, d} \] Input:

integrate(sec(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)),x, algorithm="max 
ima")
 

Output:

1/240*(480*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*a^2*b^2 + 320*(tan(d*x + c) 
^3 + 3*tan(d*x + c))*A*a*b^3 + 16*(3*tan(d*x + c)^5 + 10*tan(d*x + c)^3 + 
15*tan(d*x + c))*B*b^4 - 60*B*a*b^3*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c)) 
/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log 
(sin(d*x + c) - 1)) - 15*A*b^4*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin 
(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin( 
d*x + c) - 1)) - 240*B*a^3*b*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(si 
n(d*x + c) + 1) + log(sin(d*x + c) - 1)) - 360*A*a^2*b^2*(2*sin(d*x + c)/( 
sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 240 
*A*a^4*log(sec(d*x + c) + tan(d*x + c)) + 240*B*a^4*tan(d*x + c) + 960*A*a 
^3*b*tan(d*x + c))/d
 

Giac [B] (verification not implemented)

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

Time = 0.20 (sec) , antiderivative size = 850, normalized size of antiderivative = 3.40 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\text {Too large to display} \] Input:

integrate(sec(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)),x, algorithm="gia 
c")
 

Output:

1/120*(15*(8*A*a^4 + 16*B*a^3*b + 24*A*a^2*b^2 + 12*B*a*b^3 + 3*A*b^4)*log 
(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(8*A*a^4 + 16*B*a^3*b + 24*A*a^2*b^2 
+ 12*B*a*b^3 + 3*A*b^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(120*B*a^4* 
tan(1/2*d*x + 1/2*c)^9 + 480*A*a^3*b*tan(1/2*d*x + 1/2*c)^9 - 240*B*a^3*b* 
tan(1/2*d*x + 1/2*c)^9 - 360*A*a^2*b^2*tan(1/2*d*x + 1/2*c)^9 + 720*B*a^2* 
b^2*tan(1/2*d*x + 1/2*c)^9 + 480*A*a*b^3*tan(1/2*d*x + 1/2*c)^9 - 300*B*a* 
b^3*tan(1/2*d*x + 1/2*c)^9 - 75*A*b^4*tan(1/2*d*x + 1/2*c)^9 + 120*B*b^4*t 
an(1/2*d*x + 1/2*c)^9 - 480*B*a^4*tan(1/2*d*x + 1/2*c)^7 - 1920*A*a^3*b*ta 
n(1/2*d*x + 1/2*c)^7 + 480*B*a^3*b*tan(1/2*d*x + 1/2*c)^7 + 720*A*a^2*b^2* 
tan(1/2*d*x + 1/2*c)^7 - 1920*B*a^2*b^2*tan(1/2*d*x + 1/2*c)^7 - 1280*A*a* 
b^3*tan(1/2*d*x + 1/2*c)^7 + 120*B*a*b^3*tan(1/2*d*x + 1/2*c)^7 + 30*A*b^4 
*tan(1/2*d*x + 1/2*c)^7 - 160*B*b^4*tan(1/2*d*x + 1/2*c)^7 + 720*B*a^4*tan 
(1/2*d*x + 1/2*c)^5 + 2880*A*a^3*b*tan(1/2*d*x + 1/2*c)^5 + 2400*B*a^2*b^2 
*tan(1/2*d*x + 1/2*c)^5 + 1600*A*a*b^3*tan(1/2*d*x + 1/2*c)^5 + 464*B*b^4* 
tan(1/2*d*x + 1/2*c)^5 - 480*B*a^4*tan(1/2*d*x + 1/2*c)^3 - 1920*A*a^3*b*t 
an(1/2*d*x + 1/2*c)^3 - 480*B*a^3*b*tan(1/2*d*x + 1/2*c)^3 - 720*A*a^2*b^2 
*tan(1/2*d*x + 1/2*c)^3 - 1920*B*a^2*b^2*tan(1/2*d*x + 1/2*c)^3 - 1280*A*a 
*b^3*tan(1/2*d*x + 1/2*c)^3 - 120*B*a*b^3*tan(1/2*d*x + 1/2*c)^3 - 30*A*b^ 
4*tan(1/2*d*x + 1/2*c)^3 - 160*B*b^4*tan(1/2*d*x + 1/2*c)^3 + 120*B*a^4*ta 
n(1/2*d*x + 1/2*c) + 480*A*a^3*b*tan(1/2*d*x + 1/2*c) + 240*B*a^3*b*tan...
 

Mupad [B] (verification not implemented)

Time = 14.76 (sec) , antiderivative size = 555, normalized size of antiderivative = 2.22 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A\,a^4+2\,B\,a^3\,b+3\,A\,a^2\,b^2+\frac {3\,B\,a\,b^3}{2}+\frac {3\,A\,b^4}{8}\right )}{4\,A\,a^4+8\,B\,a^3\,b+12\,A\,a^2\,b^2+6\,B\,a\,b^3+\frac {3\,A\,b^4}{2}}\right )\,\left (2\,A\,a^4+4\,B\,a^3\,b+6\,A\,a^2\,b^2+3\,B\,a\,b^3+\frac {3\,A\,b^4}{4}\right )}{d}-\frac {\left (2\,B\,a^4-\frac {5\,A\,b^4}{4}+2\,B\,b^4-6\,A\,a^2\,b^2+12\,B\,a^2\,b^2+8\,A\,a\,b^3+8\,A\,a^3\,b-5\,B\,a\,b^3-4\,B\,a^3\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {A\,b^4}{2}-8\,B\,a^4-\frac {8\,B\,b^4}{3}+12\,A\,a^2\,b^2-32\,B\,a^2\,b^2-\frac {64\,A\,a\,b^3}{3}-32\,A\,a^3\,b+2\,B\,a\,b^3+8\,B\,a^3\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (12\,B\,a^4+48\,A\,a^3\,b+40\,B\,a^2\,b^2+\frac {80\,A\,a\,b^3}{3}+\frac {116\,B\,b^4}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {A\,b^4}{2}-8\,B\,a^4-\frac {8\,B\,b^4}{3}-12\,A\,a^2\,b^2-32\,B\,a^2\,b^2-\frac {64\,A\,a\,b^3}{3}-32\,A\,a^3\,b-2\,B\,a\,b^3-8\,B\,a^3\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {5\,A\,b^4}{4}+2\,B\,a^4+2\,B\,b^4+6\,A\,a^2\,b^2+12\,B\,a^2\,b^2+8\,A\,a\,b^3+8\,A\,a^3\,b+5\,B\,a\,b^3+4\,B\,a^3\,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(((A + B/cos(c + d*x))*(a + b/cos(c + d*x))^4)/cos(c + d*x),x)
 

Output:

(atanh((4*tan(c/2 + (d*x)/2)*(A*a^4 + (3*A*b^4)/8 + 3*A*a^2*b^2 + (3*B*a*b 
^3)/2 + 2*B*a^3*b))/(4*A*a^4 + (3*A*b^4)/2 + 12*A*a^2*b^2 + 6*B*a*b^3 + 8* 
B*a^3*b))*(2*A*a^4 + (3*A*b^4)/4 + 6*A*a^2*b^2 + 3*B*a*b^3 + 4*B*a^3*b))/d 
 - (tan(c/2 + (d*x)/2)*((5*A*b^4)/4 + 2*B*a^4 + 2*B*b^4 + 6*A*a^2*b^2 + 12 
*B*a^2*b^2 + 8*A*a*b^3 + 8*A*a^3*b + 5*B*a*b^3 + 4*B*a^3*b) + tan(c/2 + (d 
*x)/2)^5*(12*B*a^4 + (116*B*b^4)/15 + 40*B*a^2*b^2 + (80*A*a*b^3)/3 + 48*A 
*a^3*b) + tan(c/2 + (d*x)/2)^9*(2*B*a^4 - (5*A*b^4)/4 + 2*B*b^4 - 6*A*a^2* 
b^2 + 12*B*a^2*b^2 + 8*A*a*b^3 + 8*A*a^3*b - 5*B*a*b^3 - 4*B*a^3*b) - tan( 
c/2 + (d*x)/2)^3*((A*b^4)/2 + 8*B*a^4 + (8*B*b^4)/3 + 12*A*a^2*b^2 + 32*B* 
a^2*b^2 + (64*A*a*b^3)/3 + 32*A*a^3*b + 2*B*a*b^3 + 8*B*a^3*b) - tan(c/2 + 
 (d*x)/2)^7*(8*B*a^4 - (A*b^4)/2 + (8*B*b^4)/3 - 12*A*a^2*b^2 + 32*B*a^2*b 
^2 + (64*A*a*b^3)/3 + 32*A*a^3*b - 2*B*a*b^3 - 8*B*a^3*b))/(d*(5*tan(c/2 + 
 (d*x)/2)^2 - 10*tan(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/2)^6 - 5*tan(c/ 
2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 - 1))
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 773, normalized size of antiderivative = 3.09 \[ \int \sec (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx =\text {Too large to display} \] Input:

int(sec(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)),x)
 

Output:

( - 120*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**5 - 600* 
cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**3*b**2 - 225*cos 
(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a*b**4 + 240*cos(c + d 
*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**5 + 1200*cos(c + d*x)*log 
(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**3*b**2 + 450*cos(c + d*x)*log(ta 
n((c + d*x)/2) - 1)*sin(c + d*x)**2*a*b**4 - 120*cos(c + d*x)*log(tan((c + 
 d*x)/2) - 1)*a**5 - 600*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a**3*b**2 
- 225*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a*b**4 + 120*cos(c + d*x)*log 
(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**5 + 600*cos(c + d*x)*log(tan((c 
+ d*x)/2) + 1)*sin(c + d*x)**4*a**3*b**2 + 225*cos(c + d*x)*log(tan((c + d 
*x)/2) + 1)*sin(c + d*x)**4*a*b**4 - 240*cos(c + d*x)*log(tan((c + d*x)/2) 
 + 1)*sin(c + d*x)**2*a**5 - 1200*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*s 
in(c + d*x)**2*a**3*b**2 - 450*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin( 
c + d*x)**2*a*b**4 + 120*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a**5 + 600 
*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a**3*b**2 + 225*cos(c + d*x)*log(t 
an((c + d*x)/2) + 1)*a*b**4 - 600*cos(c + d*x)*sin(c + d*x)**3*a**3*b**2 - 
 225*cos(c + d*x)*sin(c + d*x)**3*a*b**4 + 600*cos(c + d*x)*sin(c + d*x)*a 
**3*b**2 + 375*cos(c + d*x)*sin(c + d*x)*a*b**4 + 600*sin(c + d*x)**5*a**4 
*b + 800*sin(c + d*x)**5*a**2*b**3 + 64*sin(c + d*x)**5*b**5 - 1200*sin(c 
+ d*x)**3*a**4*b - 2000*sin(c + d*x)**3*a**2*b**3 - 160*sin(c + d*x)**3...