\(\int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx\) [1079]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [B] (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 = 26, antiderivative size = 107 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=a (c-i d)^3 x+\frac {a (i c+d)^3 \log (\cos (e+f x))}{f}+\frac {i a (c-i d)^2 d \tan (e+f x)}{f}+\frac {a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac {i a (c+d \tan (e+f x))^3}{3 f} \] Output:

a*(c-I*d)^3*x+a*(I*c+d)^3*ln(cos(f*x+e))/f+I*a*(c-I*d)^2*d*tan(f*x+e)/f+1/ 
2*a*(I*c+d)*(c+d*tan(f*x+e))^2/f+1/3*I*a*(c+d*tan(f*x+e))^3/f
 

Mathematica [A] (verified)

Time = 0.70 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.00 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=\frac {i a^2 \left (\frac {(c-i d)^3 \log (i+\tan (e+f x))}{a}-\frac {d (i c+d)^2 \tan (e+f x)}{a}+\frac {(c-i d) (a c+a d \tan (e+f x))^2}{2 a^3}+\frac {(a c+a d \tan (e+f x))^3}{3 a^4}\right )}{f} \] Input:

Integrate[(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])^3,x]
 

Output:

(I*a^2*(((c - I*d)^3*Log[I + Tan[e + f*x]])/a - (d*(I*c + d)^2*Tan[e + f*x 
])/a + ((c - I*d)*(a*c + a*d*Tan[e + f*x])^2)/(2*a^3) + (a*c + a*d*Tan[e + 
 f*x])^3/(3*a^4)))/f
 

Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3042, 4011, 3042, 4011, 3042, 4008, 3042, 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 (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3dx\)

\(\Big \downarrow \) 4011

\(\displaystyle \int (c+d \tan (e+f x))^2 (a (c-i d)+a (i c+d) \tan (e+f x))dx+\frac {i a (c+d \tan (e+f x))^3}{3 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (c+d \tan (e+f x))^2 (a (c-i d)+a (i c+d) \tan (e+f x))dx+\frac {i a (c+d \tan (e+f x))^3}{3 f}\)

\(\Big \downarrow \) 4011

\(\displaystyle \int \left (a (c-i d)^2+i a \tan (e+f x) (c-i d)^2\right ) (c+d \tan (e+f x))dx+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\frac {a (d+i c) (c+d \tan (e+f x))^2}{2 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a (c-i d)^2+i a \tan (e+f x) (c-i d)^2\right ) (c+d \tan (e+f x))dx+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\frac {a (d+i c) (c+d \tan (e+f x))^2}{2 f}\)

\(\Big \downarrow \) 4008

\(\displaystyle -a (d+i c)^3 \int \tan (e+f x)dx+\frac {i a d (c-i d)^2 \tan (e+f x)}{f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\frac {a (d+i c) (c+d \tan (e+f x))^2}{2 f}+a x (c-i d)^3\)

\(\Big \downarrow \) 3042

\(\displaystyle -a (d+i c)^3 \int \tan (e+f x)dx+\frac {i a d (c-i d)^2 \tan (e+f x)}{f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\frac {a (d+i c) (c+d \tan (e+f x))^2}{2 f}+a x (c-i d)^3\)

\(\Big \downarrow \) 3956

\(\displaystyle \frac {i a d (c-i d)^2 \tan (e+f x)}{f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\frac {a (d+i c) (c+d \tan (e+f x))^2}{2 f}+\frac {a (d+i c)^3 \log (\cos (e+f x))}{f}+a x (c-i d)^3\)

Input:

Int[(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])^3,x]
 

Output:

a*(c - I*d)^3*x + (a*(I*c + d)^3*Log[Cos[e + f*x]])/f + (I*a*(c - I*d)^2*d 
*Tan[e + f*x])/f + (a*(I*c + d)*(c + d*Tan[e + f*x])^2)/(2*f) + ((I/3)*a*( 
c + d*Tan[e + f*x])^3)/f
 

Defintions of rubi rules used

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

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

rule 4008
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), 
x] + Simp[(b*c + a*d)   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, 
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] 
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 
 0] && GtQ[m, 0]
 
Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.39

method result size
norman \(\left (-3 i a \,c^{2} d +i a \,d^{3}+a \,c^{3}-3 a c \,d^{2}\right ) x +\frac {\left (3 i a c \,d^{2}+a \,d^{3}\right ) \tan \left (f x +e \right )^{2}}{2 f}+\frac {i a \,d^{3} \tan \left (f x +e \right )^{3}}{3 f}-\frac {i a d \left (3 i c d -3 c^{2}+d^{2}\right ) \tan \left (f x +e \right )}{f}-\frac {\left (-i a \,c^{3}+3 i a c \,d^{2}-3 a \,c^{2} d +a \,d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}\) \(149\)
parts \(a \,c^{3} x +\frac {\left (i a \,c^{3}+3 a \,c^{2} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {\left (3 i a c \,d^{2}+a \,d^{3}\right ) \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {\left (3 i a \,c^{2} d +3 a c \,d^{2}\right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {i a \,d^{3} \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) \(153\)
derivativedivides \(\frac {a \left (\frac {i d^{3} \tan \left (f x +e \right )^{3}}{3}+\frac {3 i c \,d^{2} \tan \left (f x +e \right )^{2}}{2}+3 i \tan \left (f x +e \right ) c^{2} d -i \tan \left (f x +e \right ) d^{3}+\frac {d^{3} \tan \left (f x +e \right )^{2}}{2}+3 c \,d^{2} \tan \left (f x +e \right )+\frac {\left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\arctan \left (\tan \left (f x +e \right )\right ) \left (-3 i c^{2} d +i d^{3}+c^{3}-3 c \,d^{2}\right )\right )}{f}\) \(155\)
default \(\frac {a \left (\frac {i d^{3} \tan \left (f x +e \right )^{3}}{3}+\frac {3 i c \,d^{2} \tan \left (f x +e \right )^{2}}{2}+3 i \tan \left (f x +e \right ) c^{2} d -i \tan \left (f x +e \right ) d^{3}+\frac {d^{3} \tan \left (f x +e \right )^{2}}{2}+3 c \,d^{2} \tan \left (f x +e \right )+\frac {\left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\arctan \left (\tan \left (f x +e \right )\right ) \left (-3 i c^{2} d +i d^{3}+c^{3}-3 c \,d^{2}\right )\right )}{f}\) \(155\)
parallelrisch \(\frac {2 i a \,d^{3} \tan \left (f x +e \right )^{3}-18 i x a \,c^{2} d f +6 i x a \,d^{3} f +9 i \tan \left (f x +e \right )^{2} a c \,d^{2}+3 i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a \,c^{3}-9 i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a c \,d^{2}+18 i \tan \left (f x +e \right ) a \,c^{2} d -6 i \tan \left (f x +e \right ) a \,d^{3}+6 x a \,c^{3} f -18 x a c \,d^{2} f +3 \tan \left (f x +e \right )^{2} a \,d^{3}+9 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a \,c^{2} d -3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a \,d^{3}+18 \tan \left (f x +e \right ) a c \,d^{2}}{6 f}\) \(200\)
risch \(-\frac {i a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{3}}{f}+\frac {3 i a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c \,d^{2}}{f}+\frac {6 i a \,c^{2} d e}{f}-\frac {2 i a \,d^{3} e}{f}-\frac {2 a \,c^{3} e}{f}+\frac {6 a c \,d^{2} e}{f}+\frac {2 a d \left (18 i c d \,{\mathrm e}^{4 i \left (f x +e \right )}-9 c^{2} {\mathrm e}^{4 i \left (f x +e \right )}+9 d^{2} {\mathrm e}^{4 i \left (f x +e \right )}+27 i c d \,{\mathrm e}^{2 i \left (f x +e \right )}-18 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 i c d -9 c^{2}+4 d^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {3 a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{2} d}{f}+\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d^{3}}{f}\) \(253\)

Input:

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

Output:

(a*c^3+I*a*d^3-3*I*a*c^2*d-3*a*c*d^2)*x+1/2*(3*I*a*c*d^2+a*d^3)/f*tan(f*x+ 
e)^2+1/3*I/f*a*d^3*tan(f*x+e)^3-I*a*d*(3*I*c*d-3*c^2+d^2)/f*tan(f*x+e)-1/2 
/f*(3*I*a*c*d^2+a*d^3-I*a*c^3-3*a*c^2*d)*ln(1+tan(f*x+e)^2)
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 279 vs. \(2 (91) = 182\).

Time = 0.10 (sec) , antiderivative size = 279, normalized size of antiderivative = 2.61 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=-\frac {18 \, a c^{2} d - 18 i \, a c d^{2} - 8 \, a d^{3} + 18 \, {\left (a c^{2} d - 2 i \, a c d^{2} - a d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 18 \, {\left (2 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 3 \, {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3} + {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \] Input:

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

Output:

-1/3*(18*a*c^2*d - 18*I*a*c*d^2 - 8*a*d^3 + 18*(a*c^2*d - 2*I*a*c*d^2 - a* 
d^3)*e^(4*I*f*x + 4*I*e) + 18*(2*a*c^2*d - 3*I*a*c*d^2 - a*d^3)*e^(2*I*f*x 
 + 2*I*e) + 3*(I*a*c^3 + 3*a*c^2*d - 3*I*a*c*d^2 - a*d^3 + (I*a*c^3 + 3*a* 
c^2*d - 3*I*a*c*d^2 - a*d^3)*e^(6*I*f*x + 6*I*e) + 3*(I*a*c^3 + 3*a*c^2*d 
- 3*I*a*c*d^2 - a*d^3)*e^(4*I*f*x + 4*I*e) + 3*(I*a*c^3 + 3*a*c^2*d - 3*I* 
a*c*d^2 - a*d^3)*e^(2*I*f*x + 2*I*e))*log(e^(2*I*f*x + 2*I*e) + 1))/(f*e^( 
6*I*f*x + 6*I*e) + 3*f*e^(4*I*f*x + 4*I*e) + 3*f*e^(2*I*f*x + 2*I*e) + f)
 

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 223 vs. \(2 (88) = 176\).

Time = 0.47 (sec) , antiderivative size = 223, normalized size of antiderivative = 2.08 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=- \frac {i a \left (c - i d\right )^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 18 a c^{2} d + 18 i a c d^{2} + 8 a d^{3} + \left (- 36 a c^{2} d e^{2 i e} + 54 i a c d^{2} e^{2 i e} + 18 a d^{3} e^{2 i e}\right ) e^{2 i f x} + \left (- 18 a c^{2} d e^{4 i e} + 36 i a c d^{2} e^{4 i e} + 18 a d^{3} e^{4 i e}\right ) e^{4 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \] Input:

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))**3,x)
 

Output:

-I*a*(c - I*d)**3*log(exp(2*I*f*x) + exp(-2*I*e))/f + (-18*a*c**2*d + 18*I 
*a*c*d**2 + 8*a*d**3 + (-36*a*c**2*d*exp(2*I*e) + 54*I*a*c*d**2*exp(2*I*e) 
 + 18*a*d**3*exp(2*I*e))*exp(2*I*f*x) + (-18*a*c**2*d*exp(4*I*e) + 36*I*a* 
c*d**2*exp(4*I*e) + 18*a*d**3*exp(4*I*e))*exp(4*I*f*x))/(3*f*exp(6*I*e)*ex 
p(6*I*f*x) + 9*f*exp(4*I*e)*exp(4*I*f*x) + 9*f*exp(2*I*e)*exp(2*I*f*x) + 3 
*f)
 

Maxima [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.36 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=-\frac {-2 i \, a d^{3} \tan \left (f x + e\right )^{3} + 3 \, {\left (-3 i \, a c d^{2} - a d^{3}\right )} \tan \left (f x + e\right )^{2} - 6 \, {\left (a c^{3} - 3 i \, a c^{2} d - 3 \, a c d^{2} + i \, a d^{3}\right )} {\left (f x + e\right )} + 3 \, {\left (-i \, a c^{3} - 3 \, a c^{2} d + 3 i \, a c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (-3 i \, a c^{2} d - 3 \, a c d^{2} + i \, a d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \] Input:

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

Output:

-1/6*(-2*I*a*d^3*tan(f*x + e)^3 + 3*(-3*I*a*c*d^2 - a*d^3)*tan(f*x + e)^2 
- 6*(a*c^3 - 3*I*a*c^2*d - 3*a*c*d^2 + I*a*d^3)*(f*x + e) + 3*(-I*a*c^3 - 
3*a*c^2*d + 3*I*a*c*d^2 + a*d^3)*log(tan(f*x + e)^2 + 1) + 6*(-3*I*a*c^2*d 
 - 3*a*c*d^2 + I*a*d^3)*tan(f*x + e))/f
 

Giac [A] (verification not implemented)

Time = 0.50 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.36 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=\frac {{\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{f} - \frac {-2 i \, a d^{3} f^{2} \tan \left (f x + e\right )^{3} - 9 i \, a c d^{2} f^{2} \tan \left (f x + e\right )^{2} - 3 \, a d^{3} f^{2} \tan \left (f x + e\right )^{2} - 18 i \, a c^{2} d f^{2} \tan \left (f x + e\right ) - 18 \, a c d^{2} f^{2} \tan \left (f x + e\right ) + 6 i \, a d^{3} f^{2} \tan \left (f x + e\right )}{6 \, f^{3}} \] Input:

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

Output:

(I*a*c^3 + 3*a*c^2*d - 3*I*a*c*d^2 - a*d^3)*log(tan(f*x + e) + I)/f - 1/6* 
(-2*I*a*d^3*f^2*tan(f*x + e)^3 - 9*I*a*c*d^2*f^2*tan(f*x + e)^2 - 3*a*d^3* 
f^2*tan(f*x + e)^2 - 18*I*a*c^2*d*f^2*tan(f*x + e) - 18*a*c*d^2*f^2*tan(f* 
x + e) + 6*I*a*d^3*f^2*tan(f*x + e))/f^3
 

Mupad [B] (verification not implemented)

Time = 1.96 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.14 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (3{}\mathrm {i}\,a\,c^2\,d+3\,a\,c\,d^2-1{}\mathrm {i}\,a\,d^3\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (1{}\mathrm {i}\,a\,c^3+3\,a\,c^2\,d-3{}\mathrm {i}\,a\,c\,d^2-a\,d^3\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a\,d^3}{2}+\frac {3{}\mathrm {i}\,a\,c\,d^2}{2}\right )}{f}+\frac {a\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,f} \] Input:

int((a + a*tan(e + f*x)*1i)*(c + d*tan(e + f*x))^3,x)
 

Output:

(tan(e + f*x)*(3*a*c*d^2 - a*d^3*1i + a*c^2*d*3i))/f + (log(tan(e + f*x) + 
 1i)*(a*c^3*1i - a*d^3 - a*c*d^2*3i + 3*a*c^2*d))/f + (tan(e + f*x)^2*((a* 
d^3)/2 + (a*c*d^2*3i)/2))/f + (a*d^3*tan(e + f*x)^3*1i)/(3*f)
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.74 \[ \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx=\frac {a \left (3 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c^{3} i +9 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c^{2} d -9 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c \,d^{2} i -3 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) d^{3}+2 \tan \left (f x +e \right )^{3} d^{3} i +9 \tan \left (f x +e \right )^{2} c \,d^{2} i +3 \tan \left (f x +e \right )^{2} d^{3}+18 \tan \left (f x +e \right ) c^{2} d i +18 \tan \left (f x +e \right ) c \,d^{2}-6 \tan \left (f x +e \right ) d^{3} i +6 c^{3} f x -18 c^{2} d f i x -18 c \,d^{2} f x +6 d^{3} f i x \right )}{6 f} \] Input:

int((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))^3,x)
 

Output:

(a*(3*log(tan(e + f*x)**2 + 1)*c**3*i + 9*log(tan(e + f*x)**2 + 1)*c**2*d 
- 9*log(tan(e + f*x)**2 + 1)*c*d**2*i - 3*log(tan(e + f*x)**2 + 1)*d**3 + 
2*tan(e + f*x)**3*d**3*i + 9*tan(e + f*x)**2*c*d**2*i + 3*tan(e + f*x)**2* 
d**3 + 18*tan(e + f*x)*c**2*d*i + 18*tan(e + f*x)*c*d**2 - 6*tan(e + f*x)* 
d**3*i + 6*c**3*f*x - 18*c**2*d*f*i*x - 18*c*d**2*f*x + 6*d**3*f*i*x))/(6* 
f)