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

Optimal result
Mathematica [B] (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 = 161 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {3 a \left (2 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{16 d}+\frac {b \left (3 a^2-b^2\right ) \sec ^5(c+d x)}{5 d}+\frac {b^3 \sec ^7(c+d x)}{7 d}+\frac {3 a \left (2 a^2-b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a \left (2 a^2-b^2\right ) \sec ^3(c+d x) \tan (c+d x)}{8 d}+\frac {a b^2 \sec ^5(c+d x) \tan (c+d x)}{2 d} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(637\) vs. \(2(161)=322\).

Time = 2.07 (sec) , antiderivative size = 637, normalized size of antiderivative = 3.96 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {\sec ^7(c+d x) \left (10752 a^2 b+1536 b^3+3584 \left (3 a^2 b-b^3\right ) \cos (2 (c+d x))-4410 a^3 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2205 a b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-1470 a^3 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+735 a b^2 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-210 a^3 \cos (7 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+105 a b^2 \cos (7 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-3675 a \left (2 a^2-b^2\right ) \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+4410 a^3 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-2205 a b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+1470 a^3 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-735 a b^2 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+210 a^3 \cos (7 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-105 a b^2 \cos (7 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4340 a^3 \sin (2 (c+d x))+6790 a b^2 \sin (2 (c+d x))+2800 a^3 \sin (4 (c+d x))-1400 a b^2 \sin (4 (c+d x))+420 a^3 \sin (6 (c+d x))-210 a b^2 \sin (6 (c+d x))\right )}{35840 d} \] Input:

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

Output:

(Sec[c + d*x]^7*(10752*a^2*b + 1536*b^3 + 3584*(3*a^2*b - b^3)*Cos[2*(c + 
d*x)] - 4410*a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] 
 + 2205*a*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 
1470*a^3*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 735*a 
*b^2*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 210*a^3*C 
os[7*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 105*a*b^2*Cos[7 
*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 3675*a*(2*a^2 - b^2 
)*Cos[c + d*x]*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d* 
x)/2] + Sin[(c + d*x)/2]]) + 4410*a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2 
] + Sin[(c + d*x)/2]] - 2205*a*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] + 
 Sin[(c + d*x)/2]] + 1470*a^3*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[ 
(c + d*x)/2]] - 735*a*b^2*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + 
 d*x)/2]] + 210*a^3*Cos[7*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/ 
2]] - 105*a*b^2*Cos[7*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] 
+ 4340*a^3*Sin[2*(c + d*x)] + 6790*a*b^2*Sin[2*(c + d*x)] + 2800*a^3*Sin[4 
*(c + d*x)] - 1400*a*b^2*Sin[4*(c + d*x)] + 420*a^3*Sin[6*(c + d*x)] - 210 
*a*b^2*Sin[6*(c + d*x)]))/(35840*d)
 

Rubi [A] (verified)

Time = 0.58 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.99, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.619, Rules used = {3042, 3991, 3042, 4159, 27, 298, 215, 215, 219, 4861, 27, 244, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3991

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4159

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 298

\(\displaystyle \int \sec (c+d x)^5 \tan (c+d x) \left (\tan (c+d x)^2 b^3+3 a^2 b\right )dx+\frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}\)

\(\Big \downarrow \) 215

\(\displaystyle \int \sec (c+d x)^5 \tan (c+d x) \left (\tan (c+d x)^2 b^3+3 a^2 b\right )dx+\frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}\)

\(\Big \downarrow \) 215

\(\displaystyle \int \sec (c+d x)^5 \tan (c+d x) \left (\tan (c+d x)^2 b^3+3 a^2 b\right )dx+\frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}\)

\(\Big \downarrow \) 219

\(\displaystyle \int \sec (c+d x)^5 \tan (c+d x) \left (\tan (c+d x)^2 b^3+3 a^2 b\right )dx+\frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}\)

\(\Big \downarrow \) 4861

\(\displaystyle \frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}-\frac {\int b \left (b^2+\left (3 a^2-b^2\right ) \cos ^2(c+d x)\right ) \sec ^8(c+d x)d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}-\frac {b \int \left (b^2+\left (3 a^2-b^2\right ) \cos ^2(c+d x)\right ) \sec ^8(c+d x)d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 244

\(\displaystyle \frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}-\frac {b \int \left (b^2 \sec ^8(c+d x)+\left (3 a^2-b^2\right ) \sec ^6(c+d x)\right )d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a \left (\frac {1}{2} \left (2 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)}{2 \left (1-\sin ^2(c+d x)\right )^3}\right )}{d}-\frac {b \left (-\frac {1}{5} \left (3 a^2-b^2\right ) \sec ^5(c+d x)-\frac {1}{7} b^2 \sec ^7(c+d x)\right )}{d}\)

Input:

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

Output:

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

Defintions of rubi rules used

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 244
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p 
, 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 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 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]
 

rule 4861
Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFacto 
rs[Cos[c*(a + b*x)], x]}, Simp[-(b*c)^(-1)   Subst[Int[SubstFor[1/x, Cos[c* 
(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a 
 + b*x)]/d, u, x]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Tan] || EqQ[F, tan])
 
Maple [A] (verified)

Time = 30.78 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.54

method result size
derivativedivides \(\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{7 \cos \left (d x +c \right )^{7}}+\frac {3 \sin \left (d x +c \right )^{4}}{35 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{35 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{35 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{35}\right )+3 a \,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 {3 a^{2} b}{5 \cos \left (d x +c \right )^{5}}+a^{3} \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}\) \(248\)
default \(\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{7 \cos \left (d x +c \right )^{7}}+\frac {3 \sin \left (d x +c \right )^{4}}{35 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{35 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{35 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{35}\right )+3 a \,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 {3 a^{2} b}{5 \cos \left (d x +c \right )^{5}}+a^{3} \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}\) \(248\)
risch \(-\frac {{\mathrm e}^{i \left (d x +c \right )} \left (-1400 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-2170 i a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-210 i a^{3}+2170 i a^{3} {\mathrm e}^{8 i \left (d x +c \right )}+210 i a^{3} {\mathrm e}^{12 i \left (d x +c \right )}+105 i a \,b^{2}-5376 a^{2} b \,{\mathrm e}^{8 i \left (d x +c \right )}+1792 b^{3} {\mathrm e}^{8 i \left (d x +c \right )}-10752 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}-1536 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-3395 i a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-105 i a \,b^{2} {\mathrm e}^{12 i \left (d x +c \right )}-5376 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+1792 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+3395 i a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+700 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-700 i a \,b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+1400 i a^{3} {\mathrm e}^{10 i \left (d x +c \right )}\right )}{280 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{16 d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{16 d}\) \(405\)

Input:

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

Output:

1/d*(b^3*(1/7*sin(d*x+c)^4/cos(d*x+c)^7+3/35*sin(d*x+c)^4/cos(d*x+c)^5+1/3 
5*sin(d*x+c)^4/cos(d*x+c)^3-1/35*sin(d*x+c)^4/cos(d*x+c)-1/35*(2+sin(d*x+c 
)^2)*cos(d*x+c))+3*a*b^2*(1/6*sin(d*x+c)^3/cos(d*x+c)^6+1/8*sin(d*x+c)^3/c 
os(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)))+3/5*a^2*b/cos(d*x+c)^5+a^3*(-(-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.11 (sec) , antiderivative size = 170, normalized size of antiderivative = 1.06 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {105 \, {\left (2 \, a^{3} - a b^{2}\right )} \cos \left (d x + c\right )^{7} \log \left (\sin \left (d x + c\right ) + 1\right ) - 105 \, {\left (2 \, a^{3} - a b^{2}\right )} \cos \left (d x + c\right )^{7} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 160 \, b^{3} + 224 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 70 \, {\left (3 \, {\left (2 \, a^{3} - a b^{2}\right )} \cos \left (d x + c\right )^{5} + 8 \, a b^{2} \cos \left (d x + c\right ) + 2 \, {\left (2 \, a^{3} - a b^{2}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{1120 \, d \cos \left (d x + c\right )^{7}} \] Input:

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

Output:

1/1120*(105*(2*a^3 - a*b^2)*cos(d*x + c)^7*log(sin(d*x + c) + 1) - 105*(2* 
a^3 - a*b^2)*cos(d*x + c)^7*log(-sin(d*x + c) + 1) + 160*b^3 + 224*(3*a^2* 
b - b^3)*cos(d*x + c)^2 + 70*(3*(2*a^3 - a*b^2)*cos(d*x + c)^5 + 8*a*b^2*c 
os(d*x + c) + 2*(2*a^3 - a*b^2)*cos(d*x + c)^3)*sin(d*x + c))/(d*cos(d*x + 
 c)^7)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.29 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {35 \, a 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 )} - 70 \, a^{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 )} + \frac {672 \, a^{2} b}{\cos \left (d x + c\right )^{5}} - \frac {32 \, {\left (7 \, \cos \left (d x + c\right )^{2} - 5\right )} b^{3}}{\cos \left (d x + c\right )^{7}}}{1120 \, d} \] Input:

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

Output:

1/1120*(35*a*b^2*(2*(3*sin(d*x + c)^5 - 8*sin(d*x + c)^3 - 3*sin(d*x + c)) 
/(sin(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)) - 70*a^3*(2*(3*sin(d*x + c)^3 - 5*s 
in(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)) + 672*a^2*b/cos(d*x + c)^5 - 32*(7*cos(d*x 
 + c)^2 - 5)*b^3/cos(d*x + c)^7)/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 465 vs. \(2 (149) = 298\).

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

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

Output:

1/560*(105*(2*a^3 - a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 105*(2*a^3 
 - a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(350*a^3*tan(1/2*d*x + 1/ 
2*c)^13 + 105*a*b^2*tan(1/2*d*x + 1/2*c)^13 - 1680*a^2*b*tan(1/2*d*x + 1/2 
*c)^12 - 840*a^3*tan(1/2*d*x + 1/2*c)^11 + 1540*a*b^2*tan(1/2*d*x + 1/2*c) 
^11 + 3360*a^2*b*tan(1/2*d*x + 1/2*c)^10 - 1120*b^3*tan(1/2*d*x + 1/2*c)^1 
0 + 630*a^3*tan(1/2*d*x + 1/2*c)^9 + 1085*a*b^2*tan(1/2*d*x + 1/2*c)^9 - 5 
040*a^2*b*tan(1/2*d*x + 1/2*c)^8 - 1120*b^3*tan(1/2*d*x + 1/2*c)^8 + 6720* 
a^2*b*tan(1/2*d*x + 1/2*c)^6 - 2240*b^3*tan(1/2*d*x + 1/2*c)^6 - 630*a^3*t 
an(1/2*d*x + 1/2*c)^5 - 1085*a*b^2*tan(1/2*d*x + 1/2*c)^5 - 3696*a^2*b*tan 
(1/2*d*x + 1/2*c)^4 - 448*b^3*tan(1/2*d*x + 1/2*c)^4 + 840*a^3*tan(1/2*d*x 
 + 1/2*c)^3 - 1540*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 672*a^2*b*tan(1/2*d*x + 
1/2*c)^2 - 224*b^3*tan(1/2*d*x + 1/2*c)^2 - 350*a^3*tan(1/2*d*x + 1/2*c) - 
 105*a*b^2*tan(1/2*d*x + 1/2*c) - 336*a^2*b + 32*b^3)/(tan(1/2*d*x + 1/2*c 
)^2 - 1)^7)/d
 

Mupad [B] (verification not implemented)

Time = 4.53 (sec) , antiderivative size = 423, normalized size of antiderivative = 2.63 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {3\,a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a^2-b^2\right )}{8\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {5\,a^3}{4}+\frac {3\,a\,b^2}{8}\right )+\frac {6\,a^2\,b}{5}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {11\,a\,b^2}{2}-3\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (\frac {11\,a\,b^2}{2}-3\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}\,\left (\frac {5\,a^3}{4}+\frac {3\,a\,b^2}{8}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {9\,a^3}{4}+\frac {31\,a\,b^2}{8}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (\frac {9\,a^3}{4}+\frac {31\,a\,b^2}{8}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,\left (12\,a^2\,b-4\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {12\,a^2\,b}{5}-\frac {4\,b^3}{5}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (18\,a^2\,b+4\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (24\,a^2\,b-8\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {66\,a^2\,b}{5}+\frac {8\,b^3}{5}\right )-\frac {4\,b^3}{35}+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}}{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 )} \] Input:

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

Output:

(3*a*atanh(tan(c/2 + (d*x)/2))*(2*a^2 - b^2))/(8*d) - (tan(c/2 + (d*x)/2)* 
((3*a*b^2)/8 + (5*a^3)/4) + (6*a^2*b)/5 + tan(c/2 + (d*x)/2)^3*((11*a*b^2) 
/2 - 3*a^3) - tan(c/2 + (d*x)/2)^11*((11*a*b^2)/2 - 3*a^3) - tan(c/2 + (d* 
x)/2)^13*((3*a*b^2)/8 + (5*a^3)/4) + tan(c/2 + (d*x)/2)^5*((31*a*b^2)/8 + 
(9*a^3)/4) - tan(c/2 + (d*x)/2)^9*((31*a*b^2)/8 + (9*a^3)/4) - tan(c/2 + ( 
d*x)/2)^10*(12*a^2*b - 4*b^3) - tan(c/2 + (d*x)/2)^2*((12*a^2*b)/5 - (4*b^ 
3)/5) + tan(c/2 + (d*x)/2)^8*(18*a^2*b + 4*b^3) - tan(c/2 + (d*x)/2)^6*(24 
*a^2*b - 8*b^3) + tan(c/2 + (d*x)/2)^4*((66*a^2*b)/5 + (8*b^3)/5) - (4*b^3 
)/35 + 6*a^2*b*tan(c/2 + (d*x)/2)^12)/(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))
 

Reduce [B] (verification not implemented)

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

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

Output:

( - 210*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**6*a**3 + 105* 
cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**6*a*b**2 + 630*cos(c 
+ d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**3 - 315*cos(c + d*x)*l 
og(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a*b**2 - 630*cos(c + d*x)*log(tan 
((c + d*x)/2) - 1)*sin(c + d*x)**2*a**3 + 315*cos(c + d*x)*log(tan((c + d* 
x)/2) - 1)*sin(c + d*x)**2*a*b**2 + 210*cos(c + d*x)*log(tan((c + d*x)/2) 
- 1)*a**3 - 105*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a*b**2 + 210*cos(c 
+ d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**6*a**3 - 105*cos(c + d*x)*l 
og(tan((c + d*x)/2) + 1)*sin(c + d*x)**6*a*b**2 - 630*cos(c + d*x)*log(tan 
((c + d*x)/2) + 1)*sin(c + d*x)**4*a**3 + 315*cos(c + d*x)*log(tan((c + d* 
x)/2) + 1)*sin(c + d*x)**4*a*b**2 + 630*cos(c + d*x)*log(tan((c + d*x)/2) 
+ 1)*sin(c + d*x)**2*a**3 - 315*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin 
(c + d*x)**2*a*b**2 - 210*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a**3 + 10 
5*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a*b**2 - 336*cos(c + d*x)*sin(c + 
 d*x)**6*a**2*b + 32*cos(c + d*x)*sin(c + d*x)**6*b**3 - 210*cos(c + d*x)* 
sin(c + d*x)**5*a**3 + 105*cos(c + d*x)*sin(c + d*x)**5*a*b**2 + 1008*cos( 
c + d*x)*sin(c + d*x)**4*a**2*b - 96*cos(c + d*x)*sin(c + d*x)**4*b**3 + 5 
60*cos(c + d*x)*sin(c + d*x)**3*a**3 - 280*cos(c + d*x)*sin(c + d*x)**3*a* 
b**2 - 1008*cos(c + d*x)*sin(c + d*x)**2*a**2*b + 96*cos(c + d*x)*sin(c + 
d*x)**2*b**3 - 350*cos(c + d*x)*sin(c + d*x)*a**3 - 105*cos(c + d*x)*si...