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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (warning: unable to verify)
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 = 28, antiderivative size = 190 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=4 a^3 (c-i d)^3 x+\frac {4 a^3 (i c+d)^3 \log (\cos (e+f x))}{f}+\frac {4 i a^3 (c-i d)^2 d \tan (e+f x)}{f}+\frac {2 a^3 (i c+d) (c+d \tan (e+f x))^2}{f}+\frac {4 i a^3 (c+d \tan (e+f x))^3}{3 f}+\frac {a^3 (i c-11 d) (c+d \tan (e+f x))^4}{20 d^2 f}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^4}{5 d f} \] Output:

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

Mathematica [A] (verified)

Time = 1.95 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.01 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=-\frac {a^3 \left (d \left (-60 c^2+45 i c d+17 d^2\right )-240 i (c-i d)^3 \log (i+\tan (e+f x))+60 \left (3 c^3-12 i c^2 d-12 c d^2+4 i d^3\right ) \tan (e+f x)+30 \left (i c^3+9 c^2 d-12 i c d^2-4 d^3\right ) \tan ^2(e+f x)+20 d \left (3 i c^2+9 c d-4 i d^2\right ) \tan ^3(e+f x)+45 d^2 (i c+d) \tan ^4(e+f x)+12 i d^3 \tan ^5(e+f x)\right )}{60 f} \] Input:

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

Output:

-1/60*(a^3*(d*(-60*c^2 + (45*I)*c*d + 17*d^2) - (240*I)*(c - I*d)^3*Log[I 
+ Tan[e + f*x]] + 60*(3*c^3 - (12*I)*c^2*d - 12*c*d^2 + (4*I)*d^3)*Tan[e + 
 f*x] + 30*(I*c^3 + 9*c^2*d - (12*I)*c*d^2 - 4*d^3)*Tan[e + f*x]^2 + 20*d* 
((3*I)*c^2 + 9*c*d - (4*I)*d^2)*Tan[e + f*x]^3 + 45*d^2*(I*c + d)*Tan[e + 
f*x]^4 + (12*I)*d^3*Tan[e + f*x]^5))/f
 

Rubi [A] (verified)

Time = 1.09 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.08, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 4039, 3042, 4075, 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))^3 (c+d \tan (e+f x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4039

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4075

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4008

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3956

\(\displaystyle \frac {a \left (\frac {20 i a^2 d^2 (c-i d)^2 \tan (e+f x)}{f}+\frac {a^2 (-11 d+i c) (c+d \tan (e+f x))^4}{4 d f}+\frac {20 i a^2 d (c+d \tan (e+f x))^3}{3 f}+\frac {10 a^2 d (d+i c) (c+d \tan (e+f x))^2}{f}+\frac {20 a^2 d (d+i c)^3 \log (\cos (e+f x))}{f}+20 a^2 d x (c-i d)^3\right )}{5 d}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^4}{5 d f}\)

Input:

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

Output:

-1/5*((a^3 + I*a^3*Tan[e + f*x])*(c + d*Tan[e + f*x])^4)/(d*f) + (a*(20*a^ 
2*(c - I*d)^3*d*x + (20*a^2*d*(I*c + d)^3*Log[Cos[e + f*x]])/f + ((20*I)*a 
^2*(c - I*d)^2*d^2*Tan[e + f*x])/f + (10*a^2*d*(I*c + d)*(c + d*Tan[e + f* 
x])^2)/f + (((20*I)/3)*a^2*d*(c + d*Tan[e + f*x])^3)/f + (a^2*(I*c - 11*d) 
*(c + d*Tan[e + f*x])^4)/(4*d*f)))/(5*d)
 

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]
 

rule 4039
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + 
 d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Simp[a/(d*(m + n - 1)) 
Int[(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^n*Simp[b*c*(m - 2) + 
a*d*(m + 2*n) + (a*c*(m - 2) + b*d*(3*m + 2*n - 4))*Tan[e + f*x], x], x], x 
] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 
 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 1] && NeQ[m + n - 1, 0] 
 && (IntegerQ[m] || IntegersQ[2*m, 2*n])
 

rule 4075
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) 
+ (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B 
*d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f* 
x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, 
d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ[m, -1]
 
Maple [A] (warning: unable to verify)

Time = 0.29 (sec) , antiderivative size = 269, normalized size of antiderivative = 1.42

method result size
derivativedivides \(\frac {a^{3} \left (-i c^{2} d \tan \left (f x +e \right )^{3}+12 i \tan \left (f x +e \right ) c^{2} d -\frac {3 i c \,d^{2} \tan \left (f x +e \right )^{4}}{4}-4 i \tan \left (f x +e \right ) d^{3}-\frac {3 d^{3} \tan \left (f x +e \right )^{4}}{4}+6 i c \,d^{2} \tan \left (f x +e \right )^{2}-\frac {i c^{3} \tan \left (f x +e \right )^{2}}{2}-3 c \,d^{2} \tan \left (f x +e \right )^{3}-\frac {i d^{3} \tan \left (f x +e \right )^{5}}{5}+\frac {4 i d^{3} \tan \left (f x +e \right )^{3}}{3}-\frac {9 c^{2} d \tan \left (f x +e \right )^{2}}{2}+2 d^{3} \tan \left (f x +e \right )^{2}-3 c^{3} \tan \left (f x +e \right )+12 c \,d^{2} \tan \left (f x +e \right )+\frac {\left (4 i c^{3}-12 i c \,d^{2}+12 c^{2} d -4 d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (-12 i c^{2} d +4 i d^{3}+4 c^{3}-12 c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) \(269\)
default \(\frac {a^{3} \left (-i c^{2} d \tan \left (f x +e \right )^{3}+12 i \tan \left (f x +e \right ) c^{2} d -\frac {3 i c \,d^{2} \tan \left (f x +e \right )^{4}}{4}-4 i \tan \left (f x +e \right ) d^{3}-\frac {3 d^{3} \tan \left (f x +e \right )^{4}}{4}+6 i c \,d^{2} \tan \left (f x +e \right )^{2}-\frac {i c^{3} \tan \left (f x +e \right )^{2}}{2}-3 c \,d^{2} \tan \left (f x +e \right )^{3}-\frac {i d^{3} \tan \left (f x +e \right )^{5}}{5}+\frac {4 i d^{3} \tan \left (f x +e \right )^{3}}{3}-\frac {9 c^{2} d \tan \left (f x +e \right )^{2}}{2}+2 d^{3} \tan \left (f x +e \right )^{2}-3 c^{3} \tan \left (f x +e \right )+12 c \,d^{2} \tan \left (f x +e \right )+\frac {\left (4 i c^{3}-12 i c \,d^{2}+12 c^{2} d -4 d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (-12 i c^{2} d +4 i d^{3}+4 c^{3}-12 c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) \(269\)
norman \(\left (-12 i a^{3} c^{2} d +4 i a^{3} d^{3}+4 a^{3} c^{3}-12 a^{3} c \,d^{2}\right ) x -\frac {3 \left (i a^{3} c \,d^{2}+a^{3} d^{3}\right ) \tan \left (f x +e \right )^{4}}{4 f}-\frac {\left (-12 i a^{3} c^{2} d +4 i a^{3} d^{3}+3 a^{3} c^{3}-12 a^{3} c \,d^{2}\right ) \tan \left (f x +e \right )}{f}+\frac {\left (-i a^{3} c^{3}+12 i a^{3} c \,d^{2}-9 a^{3} c^{2} d +4 a^{3} d^{3}\right ) \tan \left (f x +e \right )^{2}}{2 f}-\frac {i a^{3} d^{3} \tan \left (f x +e \right )^{5}}{5 f}-\frac {i a^{3} d \left (-9 i c d +3 c^{2}-4 d^{2}\right ) \tan \left (f x +e \right )^{3}}{3 f}-\frac {2 \left (-i a^{3} c^{3}+3 i a^{3} c \,d^{2}-3 a^{3} c^{2} d +a^{3} d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f}\) \(276\)
parts \(a^{3} c^{3} x +\frac {\left (3 i a^{3} c^{3}+3 a^{3} c^{2} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {\left (-3 i a^{3} c \,d^{2}-3 a^{3} d^{3}\right ) \left (\frac {\tan \left (f x +e \right )^{4}}{4}-\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^{3} c^{2} d +3 i a^{3} d^{3}-9 a^{3} c \,d^{2}\right ) \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}+\frac {\left (9 i a^{3} c^{2} d -3 a^{3} c^{3}+3 a^{3} c \,d^{2}\right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {\left (-i a^{3} c^{3}+9 i a^{3} c \,d^{2}-9 a^{3} c^{2} d +a^{3} 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 {i a^{3} d^{3} \left (\frac {\tan \left (f x +e \right )^{5}}{5}-\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}\) \(321\)
parallelrisch \(\frac {-720 i x \,a^{3} c^{2} d f +240 i x \,a^{3} d^{3} f -60 i \tan \left (f x +e \right )^{3} a^{3} c^{2} d +720 i \tan \left (f x +e \right ) a^{3} c^{2} d -45 \tan \left (f x +e \right )^{4} a^{3} d^{3}+120 i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} c^{3}+360 i \tan \left (f x +e \right )^{2} a^{3} c \,d^{2}-30 i \tan \left (f x +e \right )^{2} a^{3} c^{3}-45 i \tan \left (f x +e \right )^{4} a^{3} c \,d^{2}-180 \tan \left (f x +e \right )^{3} a^{3} c \,d^{2}+80 i \tan \left (f x +e \right )^{3} a^{3} d^{3}-360 i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} c \,d^{2}-12 i a^{3} d^{3} \tan \left (f x +e \right )^{5}-240 i \tan \left (f x +e \right ) a^{3} d^{3}+240 x \,a^{3} c^{3} f -720 x \,a^{3} c \,d^{2} f -270 \tan \left (f x +e \right )^{2} a^{3} c^{2} d +120 \tan \left (f x +e \right )^{2} a^{3} d^{3}+360 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} c^{2} d -120 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} d^{3}-180 \tan \left (f x +e \right ) a^{3} c^{3}+720 \tan \left (f x +e \right ) a^{3} c \,d^{2}}{60 f}\) \(362\)
risch \(\frac {24 i a^{3} c^{2} d e}{f}+\frac {12 i a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c \,d^{2}}{f}-\frac {4 i a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{3}}{f}-\frac {8 i a^{3} d^{3} e}{f}-\frac {8 a^{3} c^{3} e}{f}+\frac {24 a^{3} c \,d^{2} e}{f}+\frac {2 a^{3} \left (1575 i c \,d^{2} {\mathrm e}^{6 i \left (f x +e \right )}-225 i c^{3} {\mathrm e}^{6 i \left (f x +e \right )}-360 c^{2} d \,{\mathrm e}^{8 i \left (f x +e \right )}+240 d^{3} {\mathrm e}^{8 i \left (f x +e \right )}-195 i c^{3} {\mathrm e}^{2 i \left (f x +e \right )}-60 i c^{3} {\mathrm e}^{8 i \left (f x +e \right )}-1215 c^{2} d \,{\mathrm e}^{6 i \left (f x +e \right )}+585 d^{3} {\mathrm e}^{6 i \left (f x +e \right )}+1845 i c \,d^{2} {\mathrm e}^{4 i \left (f x +e \right )}+1035 i c \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-1545 c^{2} d \,{\mathrm e}^{4 i \left (f x +e \right )}+695 d^{3} {\mathrm e}^{4 i \left (f x +e \right )}+540 i c \,d^{2} {\mathrm e}^{8 i \left (f x +e \right )}-315 i c^{3} {\mathrm e}^{4 i \left (f x +e \right )}-885 c^{2} d \,{\mathrm e}^{2 i \left (f x +e \right )}+385 d^{3} {\mathrm e}^{2 i \left (f x +e \right )}+225 i c \,d^{2}-45 i c^{3}-195 c^{2} d +83 d^{3}\right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{5}}-\frac {12 a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{2} d}{f}+\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d^{3}}{f}\) \(436\)

Input:

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

Output:

1/f*a^3*(-I*c^2*d*tan(f*x+e)^3+12*I*tan(f*x+e)*c^2*d-3/4*I*c*d^2*tan(f*x+e 
)^4-4*I*tan(f*x+e)*d^3-3/4*d^3*tan(f*x+e)^4+6*I*c*d^2*tan(f*x+e)^2-1/2*I*c 
^3*tan(f*x+e)^2-3*c*d^2*tan(f*x+e)^3-1/5*I*d^3*tan(f*x+e)^5+4/3*I*d^3*tan( 
f*x+e)^3-9/2*c^2*d*tan(f*x+e)^2+2*d^3*tan(f*x+e)^2-3*c^3*tan(f*x+e)+12*c*d 
^2*tan(f*x+e)+1/2*(-12*I*c*d^2-4*d^3+4*I*c^3+12*c^2*d)*ln(1+tan(f*x+e)^2)+ 
(4*I*d^3-12*I*c^2*d-12*c*d^2+4*c^3)*arctan(tan(f*x+e)))
 

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. 562 vs. \(2 (170) = 340\).

Time = 0.09 (sec) , antiderivative size = 562, normalized size of antiderivative = 2.96 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=-\frac {2 \, {\left (45 i \, a^{3} c^{3} + 195 \, a^{3} c^{2} d - 225 i \, a^{3} c d^{2} - 83 \, a^{3} d^{3} + 60 \, {\left (i \, a^{3} c^{3} + 6 \, a^{3} c^{2} d - 9 i \, a^{3} c d^{2} - 4 \, a^{3} d^{3}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 45 \, {\left (5 i \, a^{3} c^{3} + 27 \, a^{3} c^{2} d - 35 i \, a^{3} c d^{2} - 13 \, a^{3} d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 5 \, {\left (63 i \, a^{3} c^{3} + 309 \, a^{3} c^{2} d - 369 i \, a^{3} c d^{2} - 139 \, a^{3} d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, {\left (39 i \, a^{3} c^{3} + 177 \, a^{3} c^{2} d - 207 i \, a^{3} c d^{2} - 77 \, a^{3} d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 30 \, {\left (i \, a^{3} c^{3} + 3 \, a^{3} c^{2} d - 3 i \, a^{3} c d^{2} - a^{3} d^{3} + {\left (i \, a^{3} c^{3} + 3 \, a^{3} c^{2} d - 3 i \, a^{3} c d^{2} - a^{3} d^{3}\right )} e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, {\left (i \, a^{3} c^{3} + 3 \, a^{3} c^{2} d - 3 i \, a^{3} c d^{2} - a^{3} d^{3}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, {\left (i \, a^{3} c^{3} + 3 \, a^{3} c^{2} d - 3 i \, a^{3} c d^{2} - a^{3} d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, {\left (i \, a^{3} c^{3} + 3 \, a^{3} c^{2} d - 3 i \, a^{3} c d^{2} - a^{3} d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, {\left (i \, a^{3} c^{3} + 3 \, a^{3} c^{2} d - 3 i \, a^{3} c d^{2} - a^{3} 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 )\right )}}{15 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \] Input:

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

Output:

-2/15*(45*I*a^3*c^3 + 195*a^3*c^2*d - 225*I*a^3*c*d^2 - 83*a^3*d^3 + 60*(I 
*a^3*c^3 + 6*a^3*c^2*d - 9*I*a^3*c*d^2 - 4*a^3*d^3)*e^(8*I*f*x + 8*I*e) + 
45*(5*I*a^3*c^3 + 27*a^3*c^2*d - 35*I*a^3*c*d^2 - 13*a^3*d^3)*e^(6*I*f*x + 
 6*I*e) + 5*(63*I*a^3*c^3 + 309*a^3*c^2*d - 369*I*a^3*c*d^2 - 139*a^3*d^3) 
*e^(4*I*f*x + 4*I*e) + 5*(39*I*a^3*c^3 + 177*a^3*c^2*d - 207*I*a^3*c*d^2 - 
 77*a^3*d^3)*e^(2*I*f*x + 2*I*e) + 30*(I*a^3*c^3 + 3*a^3*c^2*d - 3*I*a^3*c 
*d^2 - a^3*d^3 + (I*a^3*c^3 + 3*a^3*c^2*d - 3*I*a^3*c*d^2 - a^3*d^3)*e^(10 
*I*f*x + 10*I*e) + 5*(I*a^3*c^3 + 3*a^3*c^2*d - 3*I*a^3*c*d^2 - a^3*d^3)*e 
^(8*I*f*x + 8*I*e) + 10*(I*a^3*c^3 + 3*a^3*c^2*d - 3*I*a^3*c*d^2 - a^3*d^3 
)*e^(6*I*f*x + 6*I*e) + 10*(I*a^3*c^3 + 3*a^3*c^2*d - 3*I*a^3*c*d^2 - a^3* 
d^3)*e^(4*I*f*x + 4*I*e) + 5*(I*a^3*c^3 + 3*a^3*c^2*d - 3*I*a^3*c*d^2 - a^ 
3*d^3)*e^(2*I*f*x + 2*I*e))*log(e^(2*I*f*x + 2*I*e) + 1))/(f*e^(10*I*f*x + 
 10*I*e) + 5*f*e^(8*I*f*x + 8*I*e) + 10*f*e^(6*I*f*x + 6*I*e) + 10*f*e^(4* 
I*f*x + 4*I*e) + 5*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. 476 vs. \(2 (167) = 334\).

Time = 0.73 (sec) , antiderivative size = 476, normalized size of antiderivative = 2.51 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=- \frac {4 i a^{3} \left (c - i d\right )^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 90 i a^{3} c^{3} - 390 a^{3} c^{2} d + 450 i a^{3} c d^{2} + 166 a^{3} d^{3} + \left (- 390 i a^{3} c^{3} e^{2 i e} - 1770 a^{3} c^{2} d e^{2 i e} + 2070 i a^{3} c d^{2} e^{2 i e} + 770 a^{3} d^{3} e^{2 i e}\right ) e^{2 i f x} + \left (- 630 i a^{3} c^{3} e^{4 i e} - 3090 a^{3} c^{2} d e^{4 i e} + 3690 i a^{3} c d^{2} e^{4 i e} + 1390 a^{3} d^{3} e^{4 i e}\right ) e^{4 i f x} + \left (- 450 i a^{3} c^{3} e^{6 i e} - 2430 a^{3} c^{2} d e^{6 i e} + 3150 i a^{3} c d^{2} e^{6 i e} + 1170 a^{3} d^{3} e^{6 i e}\right ) e^{6 i f x} + \left (- 120 i a^{3} c^{3} e^{8 i e} - 720 a^{3} c^{2} d e^{8 i e} + 1080 i a^{3} c d^{2} e^{8 i e} + 480 a^{3} d^{3} e^{8 i e}\right ) e^{8 i f x}}{15 f e^{10 i e} e^{10 i f x} + 75 f e^{8 i e} e^{8 i f x} + 150 f e^{6 i e} e^{6 i f x} + 150 f e^{4 i e} e^{4 i f x} + 75 f e^{2 i e} e^{2 i f x} + 15 f} \] Input:

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

Output:

-4*I*a**3*(c - I*d)**3*log(exp(2*I*f*x) + exp(-2*I*e))/f + (-90*I*a**3*c** 
3 - 390*a**3*c**2*d + 450*I*a**3*c*d**2 + 166*a**3*d**3 + (-390*I*a**3*c** 
3*exp(2*I*e) - 1770*a**3*c**2*d*exp(2*I*e) + 2070*I*a**3*c*d**2*exp(2*I*e) 
 + 770*a**3*d**3*exp(2*I*e))*exp(2*I*f*x) + (-630*I*a**3*c**3*exp(4*I*e) - 
 3090*a**3*c**2*d*exp(4*I*e) + 3690*I*a**3*c*d**2*exp(4*I*e) + 1390*a**3*d 
**3*exp(4*I*e))*exp(4*I*f*x) + (-450*I*a**3*c**3*exp(6*I*e) - 2430*a**3*c* 
*2*d*exp(6*I*e) + 3150*I*a**3*c*d**2*exp(6*I*e) + 1170*a**3*d**3*exp(6*I*e 
))*exp(6*I*f*x) + (-120*I*a**3*c**3*exp(8*I*e) - 720*a**3*c**2*d*exp(8*I*e 
) + 1080*I*a**3*c*d**2*exp(8*I*e) + 480*a**3*d**3*exp(8*I*e))*exp(8*I*f*x) 
)/(15*f*exp(10*I*e)*exp(10*I*f*x) + 75*f*exp(8*I*e)*exp(8*I*f*x) + 150*f*e 
xp(6*I*e)*exp(6*I*f*x) + 150*f*exp(4*I*e)*exp(4*I*f*x) + 75*f*exp(2*I*e)*e 
xp(2*I*f*x) + 15*f)
 

Maxima [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 262, normalized size of antiderivative = 1.38 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=-\frac {12 i \, a^{3} d^{3} \tan \left (f x + e\right )^{5} + 45 \, {\left (i \, a^{3} c d^{2} + a^{3} d^{3}\right )} \tan \left (f x + e\right )^{4} + 20 \, {\left (3 i \, a^{3} c^{2} d + 9 \, a^{3} c d^{2} - 4 i \, a^{3} d^{3}\right )} \tan \left (f x + e\right )^{3} + 30 \, {\left (i \, a^{3} c^{3} + 9 \, a^{3} c^{2} d - 12 i \, a^{3} c d^{2} - 4 \, a^{3} d^{3}\right )} \tan \left (f x + e\right )^{2} - 240 \, {\left (a^{3} c^{3} - 3 i \, a^{3} c^{2} d - 3 \, a^{3} c d^{2} + i \, a^{3} d^{3}\right )} {\left (f x + e\right )} + 120 \, {\left (-i \, a^{3} c^{3} - 3 \, a^{3} c^{2} d + 3 i \, a^{3} c d^{2} + a^{3} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 60 \, {\left (3 \, a^{3} c^{3} - 12 i \, a^{3} c^{2} d - 12 \, a^{3} c d^{2} + 4 i \, a^{3} d^{3}\right )} \tan \left (f x + e\right )}{60 \, f} \] Input:

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

Output:

-1/60*(12*I*a^3*d^3*tan(f*x + e)^5 + 45*(I*a^3*c*d^2 + a^3*d^3)*tan(f*x + 
e)^4 + 20*(3*I*a^3*c^2*d + 9*a^3*c*d^2 - 4*I*a^3*d^3)*tan(f*x + e)^3 + 30* 
(I*a^3*c^3 + 9*a^3*c^2*d - 12*I*a^3*c*d^2 - 4*a^3*d^3)*tan(f*x + e)^2 - 24 
0*(a^3*c^3 - 3*I*a^3*c^2*d - 3*a^3*c*d^2 + I*a^3*d^3)*(f*x + e) + 120*(-I* 
a^3*c^3 - 3*a^3*c^2*d + 3*I*a^3*c*d^2 + a^3*d^3)*log(tan(f*x + e)^2 + 1) + 
 60*(3*a^3*c^3 - 12*I*a^3*c^2*d - 12*a^3*c*d^2 + 4*I*a^3*d^3)*tan(f*x + e) 
)/f
 

Giac [A] (verification not implemented)

Time = 0.66 (sec) , antiderivative size = 320, normalized size of antiderivative = 1.68 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=-\frac {4 \, {\left (-i \, a^{3} c^{3} - 3 \, a^{3} c^{2} d + 3 i \, a^{3} c d^{2} + a^{3} d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{f} - \frac {12 i \, a^{3} d^{3} f^{4} \tan \left (f x + e\right )^{5} + 45 i \, a^{3} c d^{2} f^{4} \tan \left (f x + e\right )^{4} + 45 \, a^{3} d^{3} f^{4} \tan \left (f x + e\right )^{4} + 60 i \, a^{3} c^{2} d f^{4} \tan \left (f x + e\right )^{3} + 180 \, a^{3} c d^{2} f^{4} \tan \left (f x + e\right )^{3} - 80 i \, a^{3} d^{3} f^{4} \tan \left (f x + e\right )^{3} + 30 i \, a^{3} c^{3} f^{4} \tan \left (f x + e\right )^{2} + 270 \, a^{3} c^{2} d f^{4} \tan \left (f x + e\right )^{2} - 360 i \, a^{3} c d^{2} f^{4} \tan \left (f x + e\right )^{2} - 120 \, a^{3} d^{3} f^{4} \tan \left (f x + e\right )^{2} + 180 \, a^{3} c^{3} f^{4} \tan \left (f x + e\right ) - 720 i \, a^{3} c^{2} d f^{4} \tan \left (f x + e\right ) - 720 \, a^{3} c d^{2} f^{4} \tan \left (f x + e\right ) + 240 i \, a^{3} d^{3} f^{4} \tan \left (f x + e\right )}{60 \, f^{5}} \] Input:

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

Output:

-4*(-I*a^3*c^3 - 3*a^3*c^2*d + 3*I*a^3*c*d^2 + a^3*d^3)*log(tan(f*x + e) + 
 I)/f - 1/60*(12*I*a^3*d^3*f^4*tan(f*x + e)^5 + 45*I*a^3*c*d^2*f^4*tan(f*x 
 + e)^4 + 45*a^3*d^3*f^4*tan(f*x + e)^4 + 60*I*a^3*c^2*d*f^4*tan(f*x + e)^ 
3 + 180*a^3*c*d^2*f^4*tan(f*x + e)^3 - 80*I*a^3*d^3*f^4*tan(f*x + e)^3 + 3 
0*I*a^3*c^3*f^4*tan(f*x + e)^2 + 270*a^3*c^2*d*f^4*tan(f*x + e)^2 - 360*I* 
a^3*c*d^2*f^4*tan(f*x + e)^2 - 120*a^3*d^3*f^4*tan(f*x + e)^2 + 180*a^3*c^ 
3*f^4*tan(f*x + e) - 720*I*a^3*c^2*d*f^4*tan(f*x + e) - 720*a^3*c*d^2*f^4* 
tan(f*x + e) + 240*I*a^3*d^3*f^4*tan(f*x + e))/f^5
 

Mupad [B] (verification not implemented)

Time = 2.05 (sec) , antiderivative size = 356, normalized size of antiderivative = 1.87 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=-\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {a^3\,d^3}{4}+\frac {a^3\,d^2\,\left (2\,d+c\,3{}\mathrm {i}\right )}{4}\right )}{f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^3\,d^3\,1{}\mathrm {i}-a^3\,c\,\left (c^2\,1{}\mathrm {i}+6\,c\,d-d^2\,3{}\mathrm {i}\right )\,1{}\mathrm {i}-a^3\,d\,\left (c^2\,3{}\mathrm {i}+6\,c\,d-d^2\,1{}\mathrm {i}\right )+a^3\,c^2\,\left (2\,c-d\,3{}\mathrm {i}\right )+a^3\,d^2\,\left (2\,d+c\,3{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a^3\,c^3\,4{}\mathrm {i}+12\,a^3\,c^2\,d-a^3\,c\,d^2\,12{}\mathrm {i}-4\,a^3\,d^3\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {a^3\,d^3\,1{}\mathrm {i}}{3}-\frac {a^3\,d\,\left (c^2\,3{}\mathrm {i}+6\,c\,d-d^2\,1{}\mathrm {i}\right )}{3}+\frac {a^3\,d^2\,\left (2\,d+c\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^3\,d^3}{2}-\frac {a^3\,c\,\left (c^2\,1{}\mathrm {i}+6\,c\,d-d^2\,3{}\mathrm {i}\right )}{2}+\frac {a^3\,d\,\left (c^2\,3{}\mathrm {i}+6\,c\,d-d^2\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^3\,d^2\,\left (2\,d+c\,3{}\mathrm {i}\right )}{2}\right )}{f}-\frac {a^3\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^5\,1{}\mathrm {i}}{5\,f} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 298, normalized size of antiderivative = 1.57 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx=\frac {a^{3} \left (120 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c^{3} i +360 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c^{2} d -360 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c \,d^{2} i -120 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) d^{3}-12 \tan \left (f x +e \right )^{5} d^{3} i -45 \tan \left (f x +e \right )^{4} c \,d^{2} i -45 \tan \left (f x +e \right )^{4} d^{3}-60 \tan \left (f x +e \right )^{3} c^{2} d i -180 \tan \left (f x +e \right )^{3} c \,d^{2}+80 \tan \left (f x +e \right )^{3} d^{3} i -30 \tan \left (f x +e \right )^{2} c^{3} i -270 \tan \left (f x +e \right )^{2} c^{2} d +360 \tan \left (f x +e \right )^{2} c \,d^{2} i +120 \tan \left (f x +e \right )^{2} d^{3}-180 \tan \left (f x +e \right ) c^{3}+720 \tan \left (f x +e \right ) c^{2} d i +720 \tan \left (f x +e \right ) c \,d^{2}-240 \tan \left (f x +e \right ) d^{3} i +240 c^{3} f x -720 c^{2} d f i x -720 c \,d^{2} f x +240 d^{3} f i x \right )}{60 f} \] Input:

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

Output:

(a**3*(120*log(tan(e + f*x)**2 + 1)*c**3*i + 360*log(tan(e + f*x)**2 + 1)* 
c**2*d - 360*log(tan(e + f*x)**2 + 1)*c*d**2*i - 120*log(tan(e + f*x)**2 + 
 1)*d**3 - 12*tan(e + f*x)**5*d**3*i - 45*tan(e + f*x)**4*c*d**2*i - 45*ta 
n(e + f*x)**4*d**3 - 60*tan(e + f*x)**3*c**2*d*i - 180*tan(e + f*x)**3*c*d 
**2 + 80*tan(e + f*x)**3*d**3*i - 30*tan(e + f*x)**2*c**3*i - 270*tan(e + 
f*x)**2*c**2*d + 360*tan(e + f*x)**2*c*d**2*i + 120*tan(e + f*x)**2*d**3 - 
 180*tan(e + f*x)*c**3 + 720*tan(e + f*x)*c**2*d*i + 720*tan(e + f*x)*c*d* 
*2 - 240*tan(e + f*x)*d**3*i + 240*c**3*f*x - 720*c**2*d*f*i*x - 720*c*d** 
2*f*x + 240*d**3*f*i*x))/(60*f)