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

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(464\) vs. \(2(128)=256\).

Time = 1.52 (sec) , antiderivative size = 464, normalized size of antiderivative = 3.62 \[ \int \sec ^3(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {\sec ^5(c+d x) \left (960 a^2 b+64 b^3+320 \left (3 a^2 b-b^3\right ) \cos (2 (c+d x))-300 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 )+225 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 )-60 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 )+45 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 )-150 a \left (4 a^2-3 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 )+300 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 )-225 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 )+60 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 )-45 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 )+240 a^3 \sin (2 (c+d x))+540 a b^2 \sin (2 (c+d x))+120 a^3 \sin (4 (c+d x))-90 a b^2 \sin (4 (c+d x))\right )}{1920 d} \] Input:

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

Output:

(Sec[c + d*x]^5*(960*a^2*b + 64*b^3 + 320*(3*a^2*b - b^3)*Cos[2*(c + d*x)] 
 - 300*a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 225 
*a*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 60*a^3* 
Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 45*a*b^2*Cos[5 
*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 150*a*(4*a^2 - 3*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]]) + 300*a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2 
] + Sin[(c + d*x)/2]] - 225*a*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] + 
Sin[(c + d*x)/2]] + 60*a^3*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c 
+ d*x)/2]] - 45*a*b^2*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x 
)/2]] + 240*a^3*Sin[2*(c + d*x)] + 540*a*b^2*Sin[2*(c + d*x)] + 120*a^3*Si 
n[4*(c + d*x)] - 90*a*b^2*Sin[4*(c + d*x)]))/(1920*d)
 

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.02, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {3042, 3991, 3042, 4159, 27, 298, 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 ^3(c+d x) (a+b \tan (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3991

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

\(\Big \downarrow \) 27

\(\displaystyle \int \sec (c+d x)^3 \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 )^3}d\sin (c+d x)}{d}\)

\(\Big \downarrow \) 298

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

\(\Big \downarrow \) 215

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

\(\Big \downarrow \) 219

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

\(\Big \downarrow \) 4861

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 244

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-((b*(-1/3*((3*a^2 - b^2)*Sec[c + d*x]^3) - (b^2*Sec[c + d*x]^5)/5))/d) + 
(a*((3*b^2*Sin[c + d*x])/(4*(1 - Sin[c + d*x]^2)^2) + ((4*a^2 - 3*b^2)*(Ar 
cTanh[Sin[c + d*x]]/2 + Sin[c + d*x]/(2*(1 - Sin[c + d*x]^2))))/4))/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 = 8.77 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.55

method result size
derivativedivides \(\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )+3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {a^{2} b}{\cos \left (d x +c \right )^{3}}+a^{3} \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}\) \(198\)
default \(\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )+3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {a^{2} b}{\cos \left (d x +c \right )^{3}}+a^{3} \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}\) \(198\)
risch \(-\frac {{\mathrm e}^{i \left (d x +c \right )} \left (60 i a^{3} {\mathrm e}^{8 i \left (d x +c \right )}-45 i a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+120 i a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+270 i a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-480 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+160 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-960 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}-64 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-120 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-270 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-480 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+160 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-60 i a^{3}+45 i a \,b^{2}\right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{8 d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{8 d}\) \(335\)

Input:

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

Output:

1/d*(b^3*(1/5*sin(d*x+c)^4/cos(d*x+c)^5+1/15*sin(d*x+c)^4/cos(d*x+c)^3-1/1 
5*sin(d*x+c)^4/cos(d*x+c)-1/15*(2+sin(d*x+c)^2)*cos(d*x+c))+3*a*b^2*(1/4*s 
in(d*x+c)^3/cos(d*x+c)^4+1/8*sin(d*x+c)^3/cos(d*x+c)^2+1/8*sin(d*x+c)-1/8* 
ln(sec(d*x+c)+tan(d*x+c)))+a^2*b/cos(d*x+c)^3+a^3*(1/2*sec(d*x+c)*tan(d*x+ 
c)+1/2*ln(sec(d*x+c)+tan(d*x+c))))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.15 \[ \int \sec ^3(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 48 \, b^{3} + 80 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (6 \, a b^{2} \cos \left (d x + c\right ) + {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \] Input:

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

Output:

1/240*(15*(4*a^3 - 3*a*b^2)*cos(d*x + c)^5*log(sin(d*x + c) + 1) - 15*(4*a 
^3 - 3*a*b^2)*cos(d*x + c)^5*log(-sin(d*x + c) + 1) + 48*b^3 + 80*(3*a^2*b 
 - b^3)*cos(d*x + c)^2 + 30*(6*a*b^2*cos(d*x + c) + (4*a^3 - 3*a*b^2)*cos( 
d*x + c)^3)*sin(d*x + c))/(d*cos(d*x + c)^5)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.23 \[ \int \sec ^3(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {45 \, a b^{2} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \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 )} - 60 \, a^{3} {\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 )} + \frac {240 \, a^{2} b}{\cos \left (d x + c\right )^{3}} - \frac {16 \, {\left (5 \, \cos \left (d x + c\right )^{2} - 3\right )} b^{3}}{\cos \left (d x + c\right )^{5}}}{240 \, d} \] Input:

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

Output:

1/240*(45*a*b^2*(2*(sin(d*x + c)^3 + sin(d*x + c))/(sin(d*x + c)^4 - 2*sin 
(d*x + c)^2 + 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) - 60*a^3 
*(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^2*b/cos(d*x + c)^3 - 16*(5*cos(d*x + c)^2 - 3)*b^3/co 
s(d*x + c)^5)/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 333 vs. \(2 (118) = 236\).

Time = 0.32 (sec) , antiderivative size = 333, normalized size of antiderivative = 2.60 \[ \int \sec ^3(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (60 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 45 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 360 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 120 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 270 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 240 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 480 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 80 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 120 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 270 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 240 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 80 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 60 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 45 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, a^{2} b + 16 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \] Input:

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

Output:

1/120*(15*(4*a^3 - 3*a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(4*a^3 
 - 3*a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(60*a^3*tan(1/2*d*x + 1 
/2*c)^9 + 45*a*b^2*tan(1/2*d*x + 1/2*c)^9 - 360*a^2*b*tan(1/2*d*x + 1/2*c) 
^8 - 120*a^3*tan(1/2*d*x + 1/2*c)^7 + 270*a*b^2*tan(1/2*d*x + 1/2*c)^7 + 7 
20*a^2*b*tan(1/2*d*x + 1/2*c)^6 - 240*b^3*tan(1/2*d*x + 1/2*c)^6 - 480*a^2 
*b*tan(1/2*d*x + 1/2*c)^4 - 80*b^3*tan(1/2*d*x + 1/2*c)^4 + 120*a^3*tan(1/ 
2*d*x + 1/2*c)^3 - 270*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 240*a^2*b*tan(1/2*d* 
x + 1/2*c)^2 - 80*b^3*tan(1/2*d*x + 1/2*c)^2 - 60*a^3*tan(1/2*d*x + 1/2*c) 
 - 45*a*b^2*tan(1/2*d*x + 1/2*c) - 120*a^2*b + 16*b^3)/(tan(1/2*d*x + 1/2* 
c)^2 - 1)^5)/d
 

Mupad [B] (verification not implemented)

Time = 4.36 (sec) , antiderivative size = 293, normalized size of antiderivative = 2.29 \[ \int \sec ^3(c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (a^3+\frac {3\,a\,b^2}{4}\right )-2\,a^2\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {9\,a\,b^2}{2}-2\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {9\,a\,b^2}{2}-2\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,a^2\,b-\frac {4\,b^3}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (8\,a^2\,b+\frac {4\,b^3}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (12\,a^2\,b-4\,b^3\right )+\frac {4\,b^3}{15}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^3+\frac {3\,a\,b^2}{4}\right )-6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{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 )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,a\,b^2}{4}-a^3\right )}{d} \] Input:

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

Output:

(tan(c/2 + (d*x)/2)^9*((3*a*b^2)/4 + a^3) - 2*a^2*b - tan(c/2 + (d*x)/2)^3 
*((9*a*b^2)/2 - 2*a^3) + tan(c/2 + (d*x)/2)^7*((9*a*b^2)/2 - 2*a^3) + tan( 
c/2 + (d*x)/2)^2*(4*a^2*b - (4*b^3)/3) - tan(c/2 + (d*x)/2)^4*(8*a^2*b + ( 
4*b^3)/3) + tan(c/2 + (d*x)/2)^6*(12*a^2*b - 4*b^3) + (4*b^3)/15 - tan(c/2 
 + (d*x)/2)*((3*a*b^2)/4 + a^3) - 6*a^2*b*tan(c/2 + (d*x)/2)^8)/(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*t 
an(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 - 1)) - (atanh(tan(c/2 + (d*x) 
/2))*((3*a*b^2)/4 - a^3))/d
 

Reduce [B] (verification not implemented)

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

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

Output:

( - 60*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**3 + 45*co 
s(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a*b**2 + 120*cos(c + 
d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**3 - 90*cos(c + d*x)*log( 
tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a*b**2 - 60*cos(c + d*x)*log(tan((c 
+ d*x)/2) - 1)*a**3 + 45*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a*b**2 + 6 
0*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**3 - 45*cos(c + 
 d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a*b**2 - 120*cos(c + d*x)* 
log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**3 + 90*cos(c + d*x)*log(tan(( 
c + d*x)/2) + 1)*sin(c + d*x)**2*a*b**2 + 60*cos(c + d*x)*log(tan((c + d*x 
)/2) + 1)*a**3 - 45*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a*b**2 - 120*co 
s(c + d*x)*sin(c + d*x)**4*a**2*b + 16*cos(c + d*x)*sin(c + d*x)**4*b**3 - 
 60*cos(c + d*x)*sin(c + d*x)**3*a**3 + 45*cos(c + d*x)*sin(c + d*x)**3*a* 
b**2 + 240*cos(c + d*x)*sin(c + d*x)**2*a**2*b - 32*cos(c + d*x)*sin(c + d 
*x)**2*b**3 + 60*cos(c + d*x)*sin(c + d*x)*a**3 + 45*cos(c + d*x)*sin(c + 
d*x)*a*b**2 - 120*cos(c + d*x)*a**2*b + 16*cos(c + d*x)*b**3 - 120*sin(c + 
 d*x)**2*a**2*b + 40*sin(c + d*x)**2*b**3 + 120*a**2*b - 16*b**3)/(120*cos 
(c + d*x)*d*(sin(c + d*x)**4 - 2*sin(c + d*x)**2 + 1))