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

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [A] (warning: unable to verify)
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 = 14, antiderivative size = 168 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=a \left (a^2-3 b^2\right ) x+\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \tan (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \tan ^2(c+d x)}{2 d}-\frac {a b^2 \tan ^3(c+d x)}{d}+\frac {b^3 \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}-\frac {b^3 \tan ^6(c+d x)}{6 d}+\frac {b^3 \tan ^8(c+d x)}{8 d} \] Output:

a*(a^2-3*b^2)*x+b*(3*a^2-b^2)*ln(cos(d*x+c))/d+3*a*b^2*tan(d*x+c)/d+1/2*b* 
(3*a^2-b^2)*tan(d*x+c)^2/d-a*b^2*tan(d*x+c)^3/d+1/4*b^3*tan(d*x+c)^4/d+3/5 
*a*b^2*tan(d*x+c)^5/d-1/6*b^3*tan(d*x+c)^6/d+1/8*b^3*tan(d*x+c)^8/d
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.31 (sec) , antiderivative size = 160, normalized size of antiderivative = 0.95 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=\frac {60 \left (-i (a-i b)^3 \log (i-\tan (c+d x))+i (a+i b)^3 \log (i+\tan (c+d x))\right )+360 a b^2 \tan (c+d x)-60 b \left (-3 a^2+b^2\right ) \tan ^2(c+d x)-120 a b^2 \tan ^3(c+d x)+30 b^3 \tan ^4(c+d x)+72 a b^2 \tan ^5(c+d x)-20 b^3 \tan ^6(c+d x)+15 b^3 \tan ^8(c+d x)}{120 d} \] Input:

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

Output:

(60*((-I)*(a - I*b)^3*Log[I - Tan[c + d*x]] + I*(a + I*b)^3*Log[I + Tan[c 
+ d*x]]) + 360*a*b^2*Tan[c + d*x] - 60*b*(-3*a^2 + b^2)*Tan[c + d*x]^2 - 1 
20*a*b^2*Tan[c + d*x]^3 + 30*b^3*Tan[c + d*x]^4 + 72*a*b^2*Tan[c + d*x]^5 
- 20*b^3*Tan[c + d*x]^6 + 15*b^3*Tan[c + d*x]^8)/(120*d)
 

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 161, normalized size of antiderivative = 0.96, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4144, 2341, 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 \left (a+b \tan ^3(c+d x)\right )^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4144

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

\(\Big \downarrow \) 2341

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a \left (a^2-3 b^2\right ) \arctan (\tan (c+d x))+\frac {1}{2} b \left (3 a^2-b^2\right ) \tan ^2(c+d x)-\frac {1}{2} b \left (3 a^2-b^2\right ) \log \left (\tan ^2(c+d x)+1\right )+\frac {3}{5} a b^2 \tan ^5(c+d x)-a b^2 \tan ^3(c+d x)+3 a b^2 \tan (c+d x)+\frac {1}{8} b^3 \tan ^8(c+d x)-\frac {1}{6} b^3 \tan ^6(c+d x)+\frac {1}{4} b^3 \tan ^4(c+d x)}{d}\)

Input:

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

Output:

(a*(a^2 - 3*b^2)*ArcTan[Tan[c + d*x]] - (b*(3*a^2 - b^2)*Log[1 + Tan[c + d 
*x]^2])/2 + 3*a*b^2*Tan[c + d*x] + (b*(3*a^2 - b^2)*Tan[c + d*x]^2)/2 - a* 
b^2*Tan[c + d*x]^3 + (b^3*Tan[c + d*x]^4)/4 + (3*a*b^2*Tan[c + d*x]^5)/5 - 
 (b^3*Tan[c + d*x]^6)/6 + (b^3*Tan[c + d*x]^8)/8)/d
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2341
Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq* 
(a + b*x^2)^p, x], x] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 

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

rule 4144
Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> 
With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f)   Subst[Int[(a + b* 
(ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, 
 b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || 
EqQ[n^2, 16])
 
Maple [A] (warning: unable to verify)

Time = 0.24 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.87

method result size
parts \(a^{3} x +\frac {b^{3} \left (\frac {\tan \left (d x +c \right )^{8}}{8}-\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 {3 a^{2} b \left (\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 {3 a \,b^{2} \left (\frac {\tan \left (d x +c \right )^{5}}{5}-\frac {\tan \left (d x +c \right )^{3}}{3}+\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(146\)
derivativedivides \(\frac {\frac {\tan \left (d x +c \right )^{8} b^{3}}{8}-\frac {\tan \left (d x +c \right )^{6} b^{3}}{6}+\frac {3 \tan \left (d x +c \right )^{5} a \,b^{2}}{5}+\frac {\tan \left (d x +c \right )^{4} b^{3}}{4}-a \,b^{2} \tan \left (d x +c \right )^{3}+\frac {3 \tan \left (d x +c \right )^{2} a^{2} b}{2}-\frac {\tan \left (d x +c \right )^{2} b^{3}}{2}+3 \tan \left (d x +c \right ) a \,b^{2}+\frac {\left (-3 a^{2} b +b^{3}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (a^{3}-3 a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(153\)
default \(\frac {\frac {\tan \left (d x +c \right )^{8} b^{3}}{8}-\frac {\tan \left (d x +c \right )^{6} b^{3}}{6}+\frac {3 \tan \left (d x +c \right )^{5} a \,b^{2}}{5}+\frac {\tan \left (d x +c \right )^{4} b^{3}}{4}-a \,b^{2} \tan \left (d x +c \right )^{3}+\frac {3 \tan \left (d x +c \right )^{2} a^{2} b}{2}-\frac {\tan \left (d x +c \right )^{2} b^{3}}{2}+3 \tan \left (d x +c \right ) a \,b^{2}+\frac {\left (-3 a^{2} b +b^{3}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (a^{3}-3 a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(153\)
parallelrisch \(-\frac {-15 \tan \left (d x +c \right )^{8} b^{3}+20 \tan \left (d x +c \right )^{6} b^{3}-72 \tan \left (d x +c \right )^{5} a \,b^{2}-30 \tan \left (d x +c \right )^{4} b^{3}+120 a \,b^{2} \tan \left (d x +c \right )^{3}-120 a^{3} d x +360 a \,b^{2} d x -180 \tan \left (d x +c \right )^{2} a^{2} b +60 \tan \left (d x +c \right )^{2} b^{3}+180 \ln \left (1+\tan \left (d x +c \right )^{2}\right ) a^{2} b -60 \ln \left (1+\tan \left (d x +c \right )^{2}\right ) b^{3}-360 \tan \left (d x +c \right ) a \,b^{2}}{120 d}\) \(161\)
norman \(\left (a^{3}-3 a \,b^{2}\right ) x +\frac {b^{3} \tan \left (d x +c \right )^{4}}{4 d}-\frac {b^{3} \tan \left (d x +c \right )^{6}}{6 d}+\frac {b^{3} \tan \left (d x +c \right )^{8}}{8 d}+\frac {3 a \,b^{2} \tan \left (d x +c \right )}{d}-\frac {a \,b^{2} \tan \left (d x +c \right )^{3}}{d}+\frac {3 a \,b^{2} \tan \left (d x +c \right )^{5}}{5 d}+\frac {b \left (3 a^{2}-b^{2}\right ) \tan \left (d x +c \right )^{2}}{2 d}-\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) \(164\)
risch \(-3 i a^{2} b x +i b^{3} x +a^{3} x -3 a \,b^{2} x -\frac {6 i b \,a^{2} c}{d}+\frac {2 i b^{3} c}{d}-\frac {2 b \left (-1635 i a b \,{\mathrm e}^{10 i \left (d x +c \right )}-45 a^{2} {\mathrm e}^{14 i \left (d x +c \right )}+60 b^{2} {\mathrm e}^{14 i \left (d x +c \right )}-1257 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-270 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}+180 b^{2} {\mathrm e}^{12 i \left (d x +c \right )}-417 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-675 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+500 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}-2229 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}-900 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+520 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-2415 i a b \,{\mathrm e}^{8 i \left (d x +c \right )}-675 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+500 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-69 i a b -270 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+180 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-675 i a b \,{\mathrm e}^{12 i \left (d x +c \right )}-45 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+60 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-135 i a b \,{\mathrm e}^{14 i \left (d x +c \right )}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{8}}+\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(410\)

Input:

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

Output:

a^3*x+b^3/d*(1/8*tan(d*x+c)^8-1/6*tan(d*x+c)^6+1/4*tan(d*x+c)^4-1/2*tan(d* 
x+c)^2+1/2*ln(1+tan(d*x+c)^2))+3*a^2*b/d*(1/2*tan(d*x+c)^2-1/2*ln(1+tan(d* 
x+c)^2))+3*a*b^2/d*(1/5*tan(d*x+c)^5-1/3*tan(d*x+c)^3+tan(d*x+c)-arctan(ta 
n(d*x+c)))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.88 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=\frac {15 \, b^{3} \tan \left (d x + c\right )^{8} - 20 \, b^{3} \tan \left (d x + c\right )^{6} + 72 \, a b^{2} \tan \left (d x + c\right )^{5} + 30 \, b^{3} \tan \left (d x + c\right )^{4} - 120 \, a b^{2} \tan \left (d x + c\right )^{3} + 360 \, a b^{2} \tan \left (d x + c\right ) + 120 \, {\left (a^{3} - 3 \, a b^{2}\right )} d x + 60 \, {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )^{2} + 60 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{120 \, d} \] Input:

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

Output:

1/120*(15*b^3*tan(d*x + c)^8 - 20*b^3*tan(d*x + c)^6 + 72*a*b^2*tan(d*x + 
c)^5 + 30*b^3*tan(d*x + c)^4 - 120*a*b^2*tan(d*x + c)^3 + 360*a*b^2*tan(d* 
x + c) + 120*(a^3 - 3*a*b^2)*d*x + 60*(3*a^2*b - b^3)*tan(d*x + c)^2 + 60* 
(3*a^2*b - b^3)*log(1/(tan(d*x + c)^2 + 1)))/d
 

Sympy [A] (verification not implemented)

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

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

Output:

Piecewise((a**3*x - 3*a**2*b*log(tan(c + d*x)**2 + 1)/(2*d) + 3*a**2*b*tan 
(c + d*x)**2/(2*d) - 3*a*b**2*x + 3*a*b**2*tan(c + d*x)**5/(5*d) - a*b**2* 
tan(c + d*x)**3/d + 3*a*b**2*tan(c + d*x)/d + b**3*log(tan(c + d*x)**2 + 1 
)/(2*d) + b**3*tan(c + d*x)**8/(8*d) - b**3*tan(c + d*x)**6/(6*d) + b**3*t 
an(c + d*x)**4/(4*d) - b**3*tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*ta 
n(c)**3)**3, True))
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.09 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=a^{3} x + \frac {{\left (3 \, \tan \left (d x + c\right )^{5} - 5 \, \tan \left (d x + c\right )^{3} - 15 \, d x - 15 \, c + 15 \, \tan \left (d x + c\right )\right )} a b^{2}}{5 \, d} + \frac {b^{3} {\left (\frac {48 \, \sin \left (d x + c\right )^{6} - 108 \, \sin \left (d x + c\right )^{4} + 88 \, \sin \left (d x + c\right )^{2} - 25}{\sin \left (d x + c\right )^{8} - 4 \, \sin \left (d x + c\right )^{6} + 6 \, \sin \left (d x + c\right )^{4} - 4 \, \sin \left (d x + c\right )^{2} + 1} - 12 \, \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{24 \, d} - \frac {3 \, a^{2} b {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} \] Input:

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

Output:

a^3*x + 1/5*(3*tan(d*x + c)^5 - 5*tan(d*x + c)^3 - 15*d*x - 15*c + 15*tan( 
d*x + c))*a*b^2/d + 1/24*b^3*((48*sin(d*x + c)^6 - 108*sin(d*x + c)^4 + 88 
*sin(d*x + c)^2 - 25)/(sin(d*x + c)^8 - 4*sin(d*x + c)^6 + 6*sin(d*x + c)^ 
4 - 4*sin(d*x + c)^2 + 1) - 12*log(sin(d*x + c)^2 - 1))/d - 3/2*a^2*b*(1/( 
sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d
 

Giac [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.10 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=\frac {{\left (a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )}}{d} - \frac {{\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} + \frac {15 \, b^{3} d^{7} \tan \left (d x + c\right )^{8} - 20 \, b^{3} d^{7} \tan \left (d x + c\right )^{6} + 72 \, a b^{2} d^{7} \tan \left (d x + c\right )^{5} + 30 \, b^{3} d^{7} \tan \left (d x + c\right )^{4} - 120 \, a b^{2} d^{7} \tan \left (d x + c\right )^{3} + 180 \, a^{2} b d^{7} \tan \left (d x + c\right )^{2} - 60 \, b^{3} d^{7} \tan \left (d x + c\right )^{2} + 360 \, a b^{2} d^{7} \tan \left (d x + c\right )}{120 \, d^{8}} \] Input:

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

Output:

(a^3 - 3*a*b^2)*(d*x + c)/d - 1/2*(3*a^2*b - b^3)*log(tan(d*x + c)^2 + 1)/ 
d + 1/120*(15*b^3*d^7*tan(d*x + c)^8 - 20*b^3*d^7*tan(d*x + c)^6 + 72*a*b^ 
2*d^7*tan(d*x + c)^5 + 30*b^3*d^7*tan(d*x + c)^4 - 120*a*b^2*d^7*tan(d*x + 
 c)^3 + 180*a^2*b*d^7*tan(d*x + c)^2 - 60*b^3*d^7*tan(d*x + c)^2 + 360*a*b 
^2*d^7*tan(d*x + c))/d^8
 

Mupad [B] (verification not implemented)

Time = 7.50 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.04 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right )+\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4}-\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^6}{6}+\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^8}{8}-\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right )-a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (c+d\,x\right )\,\left (a^2-3\,b^2\right )}{3\,a\,b^2-a^3}\right )\,\left (a^2-3\,b^2\right )-a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3+\frac {3\,a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5}+3\,a\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d} \] Input:

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

Output:

(tan(c + d*x)^2*((3*a^2*b)/2 - b^3/2) + (b^3*tan(c + d*x)^4)/4 - (b^3*tan( 
c + d*x)^6)/6 + (b^3*tan(c + d*x)^8)/8 - log(tan(c + d*x)^2 + 1)*((3*a^2*b 
)/2 - b^3/2) - a*atan((a*tan(c + d*x)*(a^2 - 3*b^2))/(3*a*b^2 - a^3))*(a^2 
 - 3*b^2) - a*b^2*tan(c + d*x)^3 + (3*a*b^2*tan(c + d*x)^5)/5 + 3*a*b^2*ta 
n(c + d*x))/d
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 160, normalized size of antiderivative = 0.95 \[ \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx=\frac {-180 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a^{2} b +60 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) b^{3}+15 \tan \left (d x +c \right )^{8} b^{3}-20 \tan \left (d x +c \right )^{6} b^{3}+72 \tan \left (d x +c \right )^{5} a \,b^{2}+30 \tan \left (d x +c \right )^{4} b^{3}-120 \tan \left (d x +c \right )^{3} a \,b^{2}+180 \tan \left (d x +c \right )^{2} a^{2} b -60 \tan \left (d x +c \right )^{2} b^{3}+360 \tan \left (d x +c \right ) a \,b^{2}+120 a^{3} d x -360 a \,b^{2} d x}{120 d} \] Input:

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

Output:

( - 180*log(tan(c + d*x)**2 + 1)*a**2*b + 60*log(tan(c + d*x)**2 + 1)*b**3 
 + 15*tan(c + d*x)**8*b**3 - 20*tan(c + d*x)**6*b**3 + 72*tan(c + d*x)**5* 
a*b**2 + 30*tan(c + d*x)**4*b**3 - 120*tan(c + d*x)**3*a*b**2 + 180*tan(c 
+ d*x)**2*a**2*b - 60*tan(c + d*x)**2*b**3 + 360*tan(c + d*x)*a*b**2 + 120 
*a**3*d*x - 360*a*b**2*d*x)/(120*d)