\(\int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx\) [528]

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 = 21, antiderivative size = 129 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {\left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{16 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {\left (6 a^2-b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {\left (6 a^2-b^2\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b^2 \sec ^5(c+d x) \tan (c+d x)}{6 d} \] Output:

1/16*(6*a^2-b^2)*arctanh(sin(d*x+c))/d+2/5*a*b*sec(d*x+c)^5/d+1/16*(6*a^2- 
b^2)*sec(d*x+c)*tan(d*x+c)/d+1/24*(6*a^2-b^2)*sec(d*x+c)^3*tan(d*x+c)/d+1/ 
6*b^2*sec(d*x+c)^5*tan(d*x+c)/d
 

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.30 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {3 a^2 \text {arctanh}(\sin (c+d x))}{8 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{8 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b^2 \sec ^5(c+d x) \tan (c+d x)}{6 d} \] Input:

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

Output:

(3*a^2*ArcTanh[Sin[c + d*x]])/(8*d) - (b^2*ArcTanh[Sin[c + d*x]])/(16*d) + 
 (2*a*b*Sec[c + d*x]^5)/(5*d) + (3*a^2*Sec[c + d*x]*Tan[c + d*x])/(8*d) - 
(b^2*Sec[c + d*x]*Tan[c + d*x])/(16*d) + (a^2*Sec[c + d*x]^3*Tan[c + d*x]) 
/(4*d) - (b^2*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (b^2*Sec[c + d*x]^5*Ta 
n[c + d*x])/(6*d)
 

Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.01, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.524, Rules used = {3042, 3991, 27, 3042, 3086, 15, 4159, 298, 215, 215, 219}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (c+d x)^5 (a+b \tan (c+d x))^2dx\)

\(\Big \downarrow \) 3991

\(\displaystyle \int \sec ^5(c+d x) \left (a^2+b^2 \tan ^2(c+d x)\right )dx+\int 2 a b \sec ^5(c+d x) \tan (c+d x)dx\)

\(\Big \downarrow \) 27

\(\displaystyle \int \sec ^5(c+d x) \left (a^2+b^2 \tan ^2(c+d x)\right )dx+2 a b \int \sec ^5(c+d x) \tan (c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (c+d x)^5 \left (a^2+b^2 \tan (c+d x)^2\right )dx+2 a b \int \sec (c+d x)^5 \tan (c+d x)dx\)

\(\Big \downarrow \) 3086

\(\displaystyle \int \sec (c+d x)^5 \left (a^2+b^2 \tan (c+d x)^2\right )dx+\frac {2 a b \int \sec ^4(c+d x)d\sec (c+d x)}{d}\)

\(\Big \downarrow \) 15

\(\displaystyle \int \sec (c+d x)^5 \left (a^2+b^2 \tan (c+d x)^2\right )dx+\frac {2 a b \sec ^5(c+d x)}{5 d}\)

\(\Big \downarrow \) 4159

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

\(\Big \downarrow \) 298

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

\(\Big \downarrow \) 215

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

\(\Big \downarrow \) 215

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

\(\Big \downarrow \) 219

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

Input:

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

Output:

(2*a*b*Sec[c + d*x]^5)/(5*d) + ((b^2*Sin[c + d*x])/(6*(1 - Sin[c + d*x]^2) 
^3) + ((6*a^2 - b^2)*(Sin[c + d*x]/(4*(1 - Sin[c + d*x]^2)^2) + (3*(ArcTan 
h[Sin[c + d*x]]/2 + Sin[c + d*x]/(2*(1 - Sin[c + d*x]^2))))/4))/6)/d
 

Defintions of rubi rules used

rule 15
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ 
{a, m}, x] && NeQ[m, -1]
 

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 215
Int[((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^2)^(p + 1) 
/(2*a*(p + 1))), x] + Simp[(2*p + 3)/(2*a*(p + 1))   Int[(a + b*x^2)^(p + 1 
), x], x] /; FreeQ[{a, b}, x] && LtQ[p, -1] && (IntegerQ[4*p] || IntegerQ[6 
*p])
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 298
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-( 
b*c - a*d))*x*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] - Simp[(a*d - b*c*( 
2*p + 3))/(2*a*b*(p + 1))   Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, 
 c, d, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/2 + p, 0])
 

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 3991
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n 
_), x_Symbol] :> Module[{k}, Int[Sec[e + f*x]^m*Sum[Binomial[n, 2*k]*a^(n - 
 2*k)*b^(2*k)*Tan[e + f*x]^(2*k), {k, 0, n/2}], x] + Int[Sec[e + f*x]^m*Tan 
[e + f*x]*Sum[Binomial[n, 2*k + 1]*a^(n - 2*k - 1)*b^(2*k + 1)*Tan[e + f*x] 
^(2*k), {k, 0, (n - 1)/2}], x]] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 
 0] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]
 

rule 4159
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ 
))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f 
  Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 
*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} 
, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
 
Maple [A] (verified)

Time = 15.41 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.16

method result size
derivativedivides \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )+\frac {2 a b}{5 \cos \left (d x +c \right )^{5}}+a^{2} \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}\) \(149\)
default \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )+\frac {2 a b}{5 \cos \left (d x +c \right )^{5}}+a^{2} \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}\) \(149\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (90 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}-15 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+510 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-85 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+420 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+570 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+1536 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}-420 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-570 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+1536 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-510 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+85 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-90 a^{2}+15 b^{2}\right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{16 d}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{16 d}\) \(319\)

Input:

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

Output:

1/d*(b^2*(1/6*sin(d*x+c)^3/cos(d*x+c)^6+1/8*sin(d*x+c)^3/cos(d*x+c)^4+1/16 
*sin(d*x+c)^3/cos(d*x+c)^2+1/16*sin(d*x+c)-1/16*ln(sec(d*x+c)+tan(d*x+c))) 
+2/5*a*b/cos(d*x+c)^5+a^2*(-(-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))))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.10 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {15 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 192 \, a b \cos \left (d x + c\right ) + 10 \, {\left (3 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 2 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \] Input:

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

Output:

1/480*(15*(6*a^2 - b^2)*cos(d*x + c)^6*log(sin(d*x + c) + 1) - 15*(6*a^2 - 
 b^2)*cos(d*x + c)^6*log(-sin(d*x + c) + 1) + 192*a*b*cos(d*x + c) + 10*(3 
*(6*a^2 - b^2)*cos(d*x + c)^4 + 2*(6*a^2 - b^2)*cos(d*x + c)^2 + 8*b^2)*si 
n(d*x + c))/(d*cos(d*x + c)^6)
 

Sympy [F]

\[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \sec ^{5}{\left (c + d x \right )}\, dx \] Input:

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

Output:

Integral((a + b*tan(c + d*x))**2*sec(c + d*x)**5, x)
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.40 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {5 \, b^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 8 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \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 )} - 30 \, a^{2} {\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 )} + \frac {192 \, a b}{\cos \left (d x + c\right )^{5}}}{480 \, d} \] Input:

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

Output:

1/480*(5*b^2*(2*(3*sin(d*x + c)^5 - 8*sin(d*x + c)^3 - 3*sin(d*x + c))/(si 
n(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) - 3*log(sin(d*x + 
c) + 1) + 3*log(sin(d*x + c) - 1)) - 30*a^2*(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)) + 192*a*b/cos(d*x + c)^5)/d
 

Giac [B] (verification not implemented)

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

Time = 0.29 (sec) , antiderivative size = 343, normalized size of antiderivative = 2.66 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {15 \, {\left (6 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (6 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 480 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{10} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 235 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 480 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 390 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 960 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 390 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 960 \, 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} + 235 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 96 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{6}}}{240 \, d} \] Input:

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

Output:

1/240*(15*(6*a^2 - b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(6*a^2 - b 
^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(150*a^2*tan(1/2*d*x + 1/2*c)^1 
1 + 15*b^2*tan(1/2*d*x + 1/2*c)^11 - 480*a*b*tan(1/2*d*x + 1/2*c)^10 - 210 
*a^2*tan(1/2*d*x + 1/2*c)^9 + 235*b^2*tan(1/2*d*x + 1/2*c)^9 + 480*a*b*tan 
(1/2*d*x + 1/2*c)^8 + 60*a^2*tan(1/2*d*x + 1/2*c)^7 + 390*b^2*tan(1/2*d*x 
+ 1/2*c)^7 - 960*a*b*tan(1/2*d*x + 1/2*c)^6 + 60*a^2*tan(1/2*d*x + 1/2*c)^ 
5 + 390*b^2*tan(1/2*d*x + 1/2*c)^5 + 960*a*b*tan(1/2*d*x + 1/2*c)^4 - 210* 
a^2*tan(1/2*d*x + 1/2*c)^3 + 235*b^2*tan(1/2*d*x + 1/2*c)^3 - 96*a*b*tan(1 
/2*d*x + 1/2*c)^2 + 150*a^2*tan(1/2*d*x + 1/2*c) + 15*b^2*tan(1/2*d*x + 1/ 
2*c) + 96*a*b)/(tan(1/2*d*x + 1/2*c)^2 - 1)^6)/d
 

Mupad [B] (verification not implemented)

Time = 3.56 (sec) , antiderivative size = 328, normalized size of antiderivative = 2.54 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {\left (\frac {5\,a^2}{4}+\frac {b^2}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\left (\frac {47\,b^2}{24}-\frac {7\,a^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\left (\frac {a^2}{2}+\frac {13\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {a^2}{2}+\frac {13\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {47\,b^2}{24}-\frac {7\,a^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{5}+\left (\frac {5\,a^2}{4}+\frac {b^2}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {4\,a\,b}{5}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,a^2}{4}-\frac {b^2}{8}\right )}{d} \] Input:

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

Output:

((4*a*b)/5 + tan(c/2 + (d*x)/2)^5*(a^2/2 + (13*b^2)/4) + tan(c/2 + (d*x)/2 
)^7*(a^2/2 + (13*b^2)/4) + tan(c/2 + (d*x)/2)^11*((5*a^2)/4 + b^2/8) - tan 
(c/2 + (d*x)/2)^3*((7*a^2)/4 - (47*b^2)/24) - tan(c/2 + (d*x)/2)^9*((7*a^2 
)/4 - (47*b^2)/24) + tan(c/2 + (d*x)/2)*((5*a^2)/4 + b^2/8) - (4*a*b*tan(c 
/2 + (d*x)/2)^2)/5 + 8*a*b*tan(c/2 + (d*x)/2)^4 - 8*a*b*tan(c/2 + (d*x)/2) 
^6 + 4*a*b*tan(c/2 + (d*x)/2)^8 - 4*a*b*tan(c/2 + (d*x)/2)^10)/(d*(15*tan( 
c/2 + (d*x)/2)^4 - 6*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (d*x)/2)^6 + 15*t 
an(c/2 + (d*x)/2)^8 - 6*tan(c/2 + (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1) 
) + (atanh(tan(c/2 + (d*x)/2))*((3*a^2)/4 - b^2/8))/d
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 530, normalized size of antiderivative = 4.11 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx =\text {Too large to display} \] Input:

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

Output:

( - 96*cos(c + d*x)*a*b - 90*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**6*a** 
2 + 15*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**6*b**2 + 270*log(tan((c + d 
*x)/2) - 1)*sin(c + d*x)**4*a**2 - 45*log(tan((c + d*x)/2) - 1)*sin(c + d* 
x)**4*b**2 - 270*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**2 + 45*log(t 
an((c + d*x)/2) - 1)*sin(c + d*x)**2*b**2 + 90*log(tan((c + d*x)/2) - 1)*a 
**2 - 15*log(tan((c + d*x)/2) - 1)*b**2 + 90*log(tan((c + d*x)/2) + 1)*sin 
(c + d*x)**6*a**2 - 15*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**6*b**2 - 27 
0*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**2 + 45*log(tan((c + d*x)/2) 
 + 1)*sin(c + d*x)**4*b**2 + 270*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2 
*a**2 - 45*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**2 - 90*log(tan((c 
+ d*x)/2) + 1)*a**2 + 15*log(tan((c + d*x)/2) + 1)*b**2 - 96*sin(c + d*x)* 
*6*a*b - 90*sin(c + d*x)**5*a**2 + 15*sin(c + d*x)**5*b**2 + 288*sin(c + d 
*x)**4*a*b + 240*sin(c + d*x)**3*a**2 - 40*sin(c + d*x)**3*b**2 - 288*sin( 
c + d*x)**2*a*b - 150*sin(c + d*x)*a**2 - 15*sin(c + d*x)*b**2 + 96*a*b)/( 
240*d*(sin(c + d*x)**6 - 3*sin(c + d*x)**4 + 3*sin(c + d*x)**2 - 1))