\(\int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx\) [256]

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

Optimal result

Integrand size = 19, antiderivative size = 111 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\frac {a \log (\cos (c+d x))}{d}-\frac {16 b \sec (c+d x)}{35 d}+\frac {(35 a+16 b \sec (c+d x)) \tan ^2(c+d x)}{70 d}-\frac {(35 a+24 b \sec (c+d x)) \tan ^4(c+d x)}{140 d}+\frac {(7 a+6 b \sec (c+d x)) \tan ^6(c+d x)}{42 d} \] Output:

a*ln(cos(d*x+c))/d-16/35*b*sec(d*x+c)/d+1/70*(35*a+16*b*sec(d*x+c))*tan(d* 
x+c)^2/d-1/140*(35*a+24*b*sec(d*x+c))*tan(d*x+c)^4/d+1/42*(7*a+6*b*sec(d*x 
+c))*tan(d*x+c)^6/d
 

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.95 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=-\frac {b \sec (c+d x)}{d}+\frac {b \sec ^3(c+d x)}{d}-\frac {3 b \sec ^5(c+d x)}{5 d}+\frac {b \sec ^7(c+d x)}{7 d}+\frac {a \left (12 \log (\cos (c+d x))+18 \sec ^2(c+d x)-9 \sec ^4(c+d x)+2 \sec ^6(c+d x)\right )}{12 d} \] Input:

Integrate[(a + b*Sec[c + d*x])*Tan[c + d*x]^7,x]
 

Output:

-((b*Sec[c + d*x])/d) + (b*Sec[c + d*x]^3)/d - (3*b*Sec[c + d*x]^5)/(5*d) 
+ (b*Sec[c + d*x]^7)/(7*d) + (a*(12*Log[Cos[c + d*x]] + 18*Sec[c + d*x]^2 
- 9*Sec[c + d*x]^4 + 2*Sec[c + d*x]^6))/(12*d)
 

Rubi [A] (verified)

Time = 0.74 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.08, number of steps used = 21, number of rules used = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.053, Rules used = {3042, 25, 4369, 25, 3042, 25, 4369, 25, 3042, 25, 4369, 27, 3042, 25, 4372, 25, 3042, 3086, 24, 3956}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int -\cot \left (c+d x+\frac {\pi }{2}\right )^7 \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 4369

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 4369

\(\displaystyle \frac {1}{7} \left (-\frac {1}{5} \int -\left ((35 a+24 b \sec (c+d x)) \tan ^3(c+d x)\right )dx-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \int (35 a+24 b \sec (c+d x)) \tan ^3(c+d x)dx-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \int -\cot \left (c+d x+\frac {\pi }{2}\right )^3 \left (35 a+24 b \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{7} \left (-\frac {1}{5} \int \cot \left (\frac {1}{2} (2 c+\pi )+d x\right )^3 \left (35 a+24 b \csc \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )dx-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 4369

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (\frac {1}{3} \int -3 (35 a+16 b \sec (c+d x)) \tan (c+d x)dx+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}-\int (35 a+16 b \sec (c+d x)) \tan (c+d x)dx\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}-\int -\cot \left (c+d x+\frac {\pi }{2}\right ) \left (35 a+16 b \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (\int \cot \left (\frac {1}{2} (2 c+\pi )+d x\right ) \left (35 a+16 b \csc \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )dx+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 4372

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (35 a \int -\tan (c+d x)dx+16 b \int -\sec (c+d x) \tan (c+d x)dx+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-35 a \int \tan (c+d x)dx-16 b \int \sec (c+d x) \tan (c+d x)dx+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-35 a \int \tan (c+d x)dx-16 b \int \sec (c+d x) \tan (c+d x)dx+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 3086

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-35 a \int \tan (c+d x)dx-\frac {16 b \int 1d\sec (c+d x)}{d}+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-35 a \int \tan (c+d x)dx+\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}-\frac {16 b \sec (c+d x)}{d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )+\frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}\)

\(\Big \downarrow \) 3956

\(\displaystyle \frac {\tan ^6(c+d x) (7 a+6 b \sec (c+d x))}{42 d}+\frac {1}{7} \left (\frac {1}{5} \left (\frac {\tan ^2(c+d x) (35 a+16 b \sec (c+d x))}{2 d}+\frac {35 a \log (\cos (c+d x))}{d}-\frac {16 b \sec (c+d x)}{d}\right )-\frac {\tan ^4(c+d x) (35 a+24 b \sec (c+d x))}{20 d}\right )\)

Input:

Int[(a + b*Sec[c + d*x])*Tan[c + d*x]^7,x]
 

Output:

((7*a + 6*b*Sec[c + d*x])*Tan[c + d*x]^6)/(42*d) + (-1/20*((35*a + 24*b*Se 
c[c + d*x])*Tan[c + d*x]^4)/d + ((35*a*Log[Cos[c + d*x]])/d - (16*b*Sec[c 
+ d*x])/d + ((35*a + 16*b*Sec[c + d*x])*Tan[c + d*x]^2)/(2*d))/5)/7
 

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 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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

rule 3086
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_.), x_Symbol] :> Simp[a/f   Subst[Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2 
), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2 
] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 4369
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_)), x_Symbol] :> Simp[(-e)*(e*Cot[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc 
[c + d*x])/(d*m*(m - 1))), x] - Simp[e^2/m   Int[(e*Cot[c + d*x])^(m - 2)*( 
a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m 
, 1]
 

rule 4372
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + 
(a_)), x_Symbol] :> Simp[a   Int[(e*Cot[c + d*x])^m, x], x] + Simp[b   Int[ 
(e*Cot[c + d*x])^m*Csc[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, m}, x]
 
Maple [A] (verified)

Time = 0.86 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.81

method result size
derivativedivides \(\frac {\frac {b \sec \left (d x +c \right )^{7}}{7}+\frac {a \sec \left (d x +c \right )^{6}}{6}-\frac {3 b \sec \left (d x +c \right )^{5}}{5}-\frac {3 a \sec \left (d x +c \right )^{4}}{4}+b \sec \left (d x +c \right )^{3}+\frac {3 a \sec \left (d x +c \right )^{2}}{2}-b \sec \left (d x +c \right )-a \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(90\)
default \(\frac {\frac {b \sec \left (d x +c \right )^{7}}{7}+\frac {a \sec \left (d x +c \right )^{6}}{6}-\frac {3 b \sec \left (d x +c \right )^{5}}{5}-\frac {3 a \sec \left (d x +c \right )^{4}}{4}+b \sec \left (d x +c \right )^{3}+\frac {3 a \sec \left (d x +c \right )^{2}}{2}-b \sec \left (d x +c \right )-a \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(90\)
parts \(\frac {a \left (\frac {\tan \left (d x +c \right )^{6}}{6}-\frac {\tan \left (d x +c \right )^{4}}{4}+\frac {\tan \left (d x +c \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}+\frac {b \left (\frac {\sec \left (d x +c \right )^{7}}{7}-\frac {3 \sec \left (d x +c \right )^{5}}{5}+\sec \left (d x +c \right )^{3}-\sec \left (d x +c \right )\right )}{d}\) \(93\)
risch \(-i a x -\frac {2 i a c}{d}-\frac {2 \left (105 b \,{\mathrm e}^{13 i \left (d x +c \right )}-315 a \,{\mathrm e}^{12 i \left (d x +c \right )}+210 b \,{\mathrm e}^{11 i \left (d x +c \right )}-945 a \,{\mathrm e}^{10 i \left (d x +c \right )}+903 b \,{\mathrm e}^{9 i \left (d x +c \right )}-1820 a \,{\mathrm e}^{8 i \left (d x +c \right )}+636 b \,{\mathrm e}^{7 i \left (d x +c \right )}-1820 a \,{\mathrm e}^{6 i \left (d x +c \right )}+903 b \,{\mathrm e}^{5 i \left (d x +c \right )}-945 a \,{\mathrm e}^{4 i \left (d x +c \right )}+210 b \,{\mathrm e}^{3 i \left (d x +c \right )}-315 a \,{\mathrm e}^{2 i \left (d x +c \right )}+105 b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(207\)

Input:

int((a+b*sec(d*x+c))*tan(d*x+c)^7,x,method=_RETURNVERBOSE)
 

Output:

1/d*(1/7*b*sec(d*x+c)^7+1/6*a*sec(d*x+c)^6-3/5*b*sec(d*x+c)^5-3/4*a*sec(d* 
x+c)^4+b*sec(d*x+c)^3+3/2*a*sec(d*x+c)^2-b*sec(d*x+c)-a*ln(sec(d*x+c)))
 

Fricas [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.91 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\frac {420 \, a \cos \left (d x + c\right )^{7} \log \left (-\cos \left (d x + c\right )\right ) - 420 \, b \cos \left (d x + c\right )^{6} + 630 \, a \cos \left (d x + c\right )^{5} + 420 \, b \cos \left (d x + c\right )^{4} - 315 \, a \cos \left (d x + c\right )^{3} - 252 \, b \cos \left (d x + c\right )^{2} + 70 \, a \cos \left (d x + c\right ) + 60 \, b}{420 \, d \cos \left (d x + c\right )^{7}} \] Input:

integrate((a+b*sec(d*x+c))*tan(d*x+c)^7,x, algorithm="fricas")
 

Output:

1/420*(420*a*cos(d*x + c)^7*log(-cos(d*x + c)) - 420*b*cos(d*x + c)^6 + 63 
0*a*cos(d*x + c)^5 + 420*b*cos(d*x + c)^4 - 315*a*cos(d*x + c)^3 - 252*b*c 
os(d*x + c)^2 + 70*a*cos(d*x + c) + 60*b)/(d*cos(d*x + c)^7)
 

Sympy [A] (verification not implemented)

Time = 0.95 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.33 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\begin {cases} - \frac {a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a \tan ^{6}{\left (c + d x \right )}}{6 d} - \frac {a \tan ^{4}{\left (c + d x \right )}}{4 d} + \frac {a \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {b \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{7 d} - \frac {6 b \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} + \frac {8 b \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} - \frac {16 b \sec {\left (c + d x \right )}}{35 d} & \text {for}\: d \neq 0 \\x \left (a + b \sec {\left (c \right )}\right ) \tan ^{7}{\left (c \right )} & \text {otherwise} \end {cases} \] Input:

integrate((a+b*sec(d*x+c))*tan(d*x+c)**7,x)
 

Output:

Piecewise((-a*log(tan(c + d*x)**2 + 1)/(2*d) + a*tan(c + d*x)**6/(6*d) - a 
*tan(c + d*x)**4/(4*d) + a*tan(c + d*x)**2/(2*d) + b*tan(c + d*x)**6*sec(c 
 + d*x)/(7*d) - 6*b*tan(c + d*x)**4*sec(c + d*x)/(35*d) + 8*b*tan(c + d*x) 
**2*sec(c + d*x)/(35*d) - 16*b*sec(c + d*x)/(35*d), Ne(d, 0)), (x*(a + b*s 
ec(c))*tan(c)**7, True))
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.85 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\frac {420 \, a \log \left (\cos \left (d x + c\right )\right ) - \frac {420 \, b \cos \left (d x + c\right )^{6} - 630 \, a \cos \left (d x + c\right )^{5} - 420 \, b \cos \left (d x + c\right )^{4} + 315 \, a \cos \left (d x + c\right )^{3} + 252 \, b \cos \left (d x + c\right )^{2} - 70 \, a \cos \left (d x + c\right ) - 60 \, b}{\cos \left (d x + c\right )^{7}}}{420 \, d} \] Input:

integrate((a+b*sec(d*x+c))*tan(d*x+c)^7,x, algorithm="maxima")
 

Output:

1/420*(420*a*log(cos(d*x + c)) - (420*b*cos(d*x + c)^6 - 630*a*cos(d*x + c 
)^5 - 420*b*cos(d*x + c)^4 + 315*a*cos(d*x + c)^3 + 252*b*cos(d*x + c)^2 - 
 70*a*cos(d*x + c) - 60*b)/cos(d*x + c)^7)/d
 

Giac [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.86 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\frac {420 \, a \log \left ({\left | \cos \left (d x + c\right ) \right |}\right ) - \frac {420 \, b \cos \left (d x + c\right )^{6} - 630 \, a \cos \left (d x + c\right )^{5} - 420 \, b \cos \left (d x + c\right )^{4} + 315 \, a \cos \left (d x + c\right )^{3} + 252 \, b \cos \left (d x + c\right )^{2} - 70 \, a \cos \left (d x + c\right ) - 60 \, b}{\cos \left (d x + c\right )^{7}}}{420 \, d} \] Input:

integrate((a+b*sec(d*x+c))*tan(d*x+c)^7,x, algorithm="giac")
 

Output:

1/420*(420*a*log(abs(cos(d*x + c))) - (420*b*cos(d*x + c)^6 - 630*a*cos(d* 
x + c)^5 - 420*b*cos(d*x + c)^4 + 315*a*cos(d*x + c)^3 + 252*b*cos(d*x + c 
)^2 - 70*a*cos(d*x + c) - 60*b)/cos(d*x + c)^7)/d
 

Mupad [B] (verification not implemented)

Time = 14.65 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.99 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\frac {2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-14\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\frac {128\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{3}+\left (-\frac {128\,a}{3}-32\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (14\,a+\frac {96\,b}{5}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (-2\,a-\frac {32\,b}{5}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {32\,b}{35}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {2\,a\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \] Input:

int(tan(c + d*x)^7*(a + b/cos(c + d*x)),x)
 

Output:

((32*b)/35 - tan(c/2 + (d*x)/2)^2*(2*a + (32*b)/5) + tan(c/2 + (d*x)/2)^4* 
(14*a + (96*b)/5) - tan(c/2 + (d*x)/2)^6*((128*a)/3 + 32*b) + (128*a*tan(c 
/2 + (d*x)/2)^8)/3 - 14*a*tan(c/2 + (d*x)/2)^10 + 2*a*tan(c/2 + (d*x)/2)^1 
2)/(d*(7*tan(c/2 + (d*x)/2)^2 - 21*tan(c/2 + (d*x)/2)^4 + 35*tan(c/2 + (d* 
x)/2)^6 - 35*tan(c/2 + (d*x)/2)^8 + 21*tan(c/2 + (d*x)/2)^10 - 7*tan(c/2 + 
 (d*x)/2)^12 + tan(c/2 + (d*x)/2)^14 - 1)) - (2*a*atanh(tan(c/2 + (d*x)/2) 
^2))/d
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.02 \[ \int (a+b \sec (c+d x)) \tan ^7(c+d x) \, dx=\frac {-210 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a +60 \sec \left (d x +c \right ) \tan \left (d x +c \right )^{6} b -72 \sec \left (d x +c \right ) \tan \left (d x +c \right )^{4} b +96 \sec \left (d x +c \right ) \tan \left (d x +c \right )^{2} b -192 \sec \left (d x +c \right ) b +70 \tan \left (d x +c \right )^{6} a -105 \tan \left (d x +c \right )^{4} a +210 \tan \left (d x +c \right )^{2} a}{420 d} \] Input:

int((a+b*sec(d*x+c))*tan(d*x+c)^7,x)
 

Output:

( - 210*log(tan(c + d*x)**2 + 1)*a + 60*sec(c + d*x)*tan(c + d*x)**6*b - 7 
2*sec(c + d*x)*tan(c + d*x)**4*b + 96*sec(c + d*x)*tan(c + d*x)**2*b - 192 
*sec(c + d*x)*b + 70*tan(c + d*x)**6*a - 105*tan(c + d*x)**4*a + 210*tan(c 
 + d*x)**2*a)/(420*d)