\(\int \frac {(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx\) [1095]

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

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

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(283\) vs. \(2(134)=268\).

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

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

Output:

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

Rubi [A] (verified)

Time = 0.80 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.31, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.321, Rules used = {3042, 4028, 3042, 4025, 27, 3042, 4014, 3042, 4013}

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 \frac {(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4028

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4025

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4014

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4013

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

Input:

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

Output:

-1/2*(a*(a + I*a*Tan[e + f*x])^2)/((I*c + d)*f*(c + d*Tan[e + f*x])^2) + ( 
2*a*((2*((a^2*(c + I*d)*x)/(c - I*d) - (a^2*(I*c - d)*Log[c*Cos[e + f*x] + 
 d*Sin[e + f*x]])/((c - I*d)*f)))/(c^2 + d^2) + (a^2*(I*c - d))/(d*(I*c + 
d)*f*(c + d*Tan[e + f*x]))))/(c - I*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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4013
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* 
(x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si 
n[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] && EqQ[a*c + b*d, 0]
 

rule 4014
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a 
*d)/(a^2 + b^2)   Int[(b - a*Tan[e + f*x])/(a + b*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] && N 
eQ[a*c + b*d, 0]
 

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

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

Time = 0.31 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.78

method result size
derivativedivides \(\frac {a^{3} \left (\frac {\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 )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {-i c^{4}-6 i c^{2} d^{2}+3 i d^{4}+8 c \,d^{3}}{\left (c^{2}+d^{2}\right )^{2} d^{2} \left (c +d \tan \left (f x +e \right )\right )}-\frac {i c^{3}-3 i c \,d^{2}-3 c^{2} d +d^{3}}{2 d^{2} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {4 \left (i c^{3}-3 i c \,d^{2}-3 c^{2} d +d^{3}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}\right )}{f}\) \(239\)
default \(\frac {a^{3} \left (\frac {\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 )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {-i c^{4}-6 i c^{2} d^{2}+3 i d^{4}+8 c \,d^{3}}{\left (c^{2}+d^{2}\right )^{2} d^{2} \left (c +d \tan \left (f x +e \right )\right )}-\frac {i c^{3}-3 i c \,d^{2}-3 c^{2} d +d^{3}}{2 d^{2} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {4 \left (i c^{3}-3 i c \,d^{2}-3 c^{2} d +d^{3}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}\right )}{f}\) \(239\)
risch \(-\frac {8 a^{3} x}{3 i c^{2} d -i d^{3}-c^{3}+3 c \,d^{2}}-\frac {8 i a^{3} x}{i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}}-\frac {8 i a^{3} e}{f \left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right )}-\frac {2 i a^{3} \left (4 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}+4 d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+6 i c d +3 c^{2}-3 d^{2}\right )}{f \left (-i d +c \right )^{3} \left (-i d \,{\mathrm e}^{2 i \left (f x +e \right )}+{\mathrm e}^{2 i \left (f x +e \right )} c +i d +c \right )^{2}}+\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{f \left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right )}\) \(263\)
norman \(\frac {\frac {\left (i a^{3} c^{2}+3 i a^{3} d^{2}+2 a^{3} c d \right ) \tan \left (f x +e \right )}{f d \left (-2 i c d +c^{2}-d^{2}\right )}+\frac {4 a^{3} c^{2} x}{\left (-i d +c \right )^{3}}+\frac {i a^{3} c^{3}+5 i a^{3} c \,d^{2}+5 a^{3} c^{2} d +a^{3} d^{3}}{2 d^{2} f \left (-2 i c d +c^{2}-d^{2}\right )}+\frac {8 c d \,a^{3} x \tan \left (f x +e \right )}{\left (-i d +c \right )^{3}}-\frac {4 i a^{3} d^{2} x \tan \left (f x +e \right )^{2}}{\left (i c +d \right )^{3}}}{\left (c +d \tan \left (f x +e \right )\right )^{2}}+\frac {2 i a^{3} \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f \left (-3 i c^{2} d +i d^{3}+c^{3}-3 c \,d^{2}\right )}-\frac {4 i a^{3} \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (-3 i c^{2} d +i d^{3}+c^{3}-3 c \,d^{2}\right )}\) \(286\)
parallelrisch \(\text {Expression too large to display}\) \(1077\)

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*(1/(c^2+d^2)^3*(1/2*(4*I*c^3-12*I*c*d^2-12*c^2*d+4*d^3)*ln(1+tan(f 
*x+e)^2)+(12*I*c^2*d-4*I*d^3+4*c^3-12*c*d^2)*arctan(tan(f*x+e)))-(-I*c^4-6 
*I*c^2*d^2+3*I*d^4+8*c*d^3)/(c^2+d^2)^2/d^2/(c+d*tan(f*x+e))-1/2*(I*c^3-3* 
I*c*d^2-3*c^2*d+d^3)/d^2/(c^2+d^2)/(c+d*tan(f*x+e))^2-4*(I*c^3-3*I*c*d^2-3 
*c^2*d+d^3)/(c^2+d^2)^3*ln(c+d*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. 305 vs. \(2 (120) = 240\).

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

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

Output:

2*(3*a^3*c^2 + 6*I*a^3*c*d - 3*a^3*d^2 + 4*(a^3*c^2 + a^3*d^2)*e^(2*I*f*x 
+ 2*I*e) + 2*(a^3*c^2 + 2*I*a^3*c*d - a^3*d^2 + (a^3*c^2 - 2*I*a^3*c*d - a 
^3*d^2)*e^(4*I*f*x + 4*I*e) + 2*(a^3*c^2 + a^3*d^2)*e^(2*I*f*x + 2*I*e))*l 
og(((I*c + d)*e^(2*I*f*x + 2*I*e) + I*c - d)/(I*c + d)))/((I*c^5 + 5*c^4*d 
 - 10*I*c^3*d^2 - 10*c^2*d^3 + 5*I*c*d^4 + d^5)*f*e^(4*I*f*x + 4*I*e) - 2* 
(-I*c^5 - 3*c^4*d + 2*I*c^3*d^2 - 2*c^2*d^3 + 3*I*c*d^4 + d^5)*f*e^(2*I*f* 
x + 2*I*e) + (I*c^5 + c^4*d + 2*I*c^3*d^2 + 2*c^2*d^3 + I*c*d^4 + d^5)*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. 377 vs. \(2 (110) = 220\).

Time = 3.76 (sec) , antiderivative size = 377, normalized size of antiderivative = 2.81 \[ \int \frac {(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=- \frac {4 i a^{3} \log {\left (\frac {c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{f \left (c - i d\right )^{3}} + \frac {- 6 i a^{3} c^{2} + 12 a^{3} c d + 6 i a^{3} d^{2} + \left (- 8 i a^{3} c^{2} e^{2 i e} - 8 i a^{3} d^{2} e^{2 i e}\right ) e^{2 i f x}}{c^{5} f - i c^{4} d f + 2 c^{3} d^{2} f - 2 i c^{2} d^{3} f + c d^{4} f - i d^{5} f + \left (2 c^{5} f e^{2 i e} - 6 i c^{4} d f e^{2 i e} - 4 c^{3} d^{2} f e^{2 i e} - 4 i c^{2} d^{3} f e^{2 i e} - 6 c d^{4} f e^{2 i e} + 2 i d^{5} f e^{2 i e}\right ) e^{2 i f x} + \left (c^{5} f e^{4 i e} - 5 i c^{4} d f e^{4 i e} - 10 c^{3} d^{2} f e^{4 i e} + 10 i c^{2} d^{3} f e^{4 i e} + 5 c d^{4} f e^{4 i e} - i d^{5} f e^{4 i e}\right ) e^{4 i f x}} \] Input:

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

Output:

-4*I*a**3*log((c + I*d)/(c*exp(2*I*e) - I*d*exp(2*I*e)) + exp(2*I*f*x))/(f 
*(c - I*d)**3) + (-6*I*a**3*c**2 + 12*a**3*c*d + 6*I*a**3*d**2 + (-8*I*a** 
3*c**2*exp(2*I*e) - 8*I*a**3*d**2*exp(2*I*e))*exp(2*I*f*x))/(c**5*f - I*c* 
*4*d*f + 2*c**3*d**2*f - 2*I*c**2*d**3*f + c*d**4*f - I*d**5*f + (2*c**5*f 
*exp(2*I*e) - 6*I*c**4*d*f*exp(2*I*e) - 4*c**3*d**2*f*exp(2*I*e) - 4*I*c** 
2*d**3*f*exp(2*I*e) - 6*c*d**4*f*exp(2*I*e) + 2*I*d**5*f*exp(2*I*e))*exp(2 
*I*f*x) + (c**5*f*exp(4*I*e) - 5*I*c**4*d*f*exp(4*I*e) - 10*c**3*d**2*f*ex 
p(4*I*e) + 10*I*c**2*d**3*f*exp(4*I*e) + 5*c*d**4*f*exp(4*I*e) - I*d**5*f* 
exp(4*I*e))*exp(4*I*f*x))
 

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 403 vs. \(2 (120) = 240\).

Time = 0.22 (sec) , antiderivative size = 403, normalized size of antiderivative = 3.01 \[ \int \frac {(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {8 \, {\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 )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac {8 \, {\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 (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \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 )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {i \, a^{3} c^{5} + 3 \, a^{3} c^{4} d + 14 i \, a^{3} c^{3} d^{2} - 14 \, a^{3} c^{2} d^{3} - 3 i \, a^{3} c d^{4} - a^{3} d^{5} + 2 \, {\left (i \, a^{3} c^{4} d + 6 i \, a^{3} c^{2} d^{3} - 8 \, a^{3} c d^{4} - 3 i \, a^{3} d^{5}\right )} \tan \left (f x + e\right )}{c^{6} d^{2} + 2 \, c^{4} d^{4} + c^{2} d^{6} + {\left (c^{4} d^{4} + 2 \, c^{2} d^{6} + d^{8}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{5} d^{3} + 2 \, c^{3} d^{5} + c d^{7}\right )} \tan \left (f x + e\right )}}{2 \, f} \] Input:

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

Output:

1/2*(8*(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)/(c^6 
+ 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 8*(I*a^3*c^3 - 3*a^3*c^2*d - 3*I*a^3*c*d^ 
2 + a^3*d^3)*log(d*tan(f*x + e) + c)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 
 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)^2 
 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (I*a^3*c^5 + 3*a^3*c^4*d + 14* 
I*a^3*c^3*d^2 - 14*a^3*c^2*d^3 - 3*I*a^3*c*d^4 - a^3*d^5 + 2*(I*a^3*c^4*d 
+ 6*I*a^3*c^2*d^3 - 8*a^3*c*d^4 - 3*I*a^3*d^5)*tan(f*x + e))/(c^6*d^2 + 2* 
c^4*d^4 + c^2*d^6 + (c^4*d^4 + 2*c^2*d^6 + d^8)*tan(f*x + e)^2 + 2*(c^5*d^ 
3 + 2*c^3*d^5 + c*d^7)*tan(f*x + e)))/f
 

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 2.71 (sec) , antiderivative size = 314, normalized size of antiderivative = 2.34 \[ \int \frac {(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=-\frac {\frac {a^3\,\left (c^3\,1{}\mathrm {i}+5\,c^2\,d+c\,d^2\,5{}\mathrm {i}+d^3\right )}{2\,d^4\,\left (-c^2+c\,d\,2{}\mathrm {i}+d^2\right )}+\frac {a^3\,\mathrm {tan}\left (e+f\,x\right )\,\left (c^2-c\,d\,2{}\mathrm {i}+3\,d^2\right )\,1{}\mathrm {i}}{d^3\,\left (-c^2+c\,d\,2{}\mathrm {i}+d^2\right )}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^2+\frac {c^2}{d^2}+\frac {2\,c\,\mathrm {tan}\left (e+f\,x\right )}{d}\right )}+\frac {a^3\,\mathrm {atan}\left (\frac {c^3-c^2\,d\,1{}\mathrm {i}+c\,d^2-d^3\,1{}\mathrm {i}}{{\left (c-d\,1{}\mathrm {i}\right )}^2\,\left (d+c\,1{}\mathrm {i}\right )}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,c^8\,d^2+8\,c^6\,d^4+12\,c^4\,d^6+8\,c^2\,d^8+2\,d^{10}\right )\,1{}\mathrm {i}}{{\left (c-d\,1{}\mathrm {i}\right )}^2\,\left (d+c\,1{}\mathrm {i}\right )\,\left (-c^6\,d\,1{}\mathrm {i}+2\,c^5\,d^2-c^4\,d^3\,1{}\mathrm {i}+4\,c^3\,d^4+c^2\,d^5\,1{}\mathrm {i}+2\,c\,d^6+d^7\,1{}\mathrm {i}\right )}\right )\,8{}\mathrm {i}}{f\,{\left (c-d\,1{}\mathrm {i}\right )}^2\,\left (d+c\,1{}\mathrm {i}\right )} \] Input:

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

Output:

(a^3*atan((c*d^2 - c^2*d*1i + c^3 - d^3*1i)/((c - d*1i)^2*(c*1i + d)) - (t 
an(e + f*x)*(2*d^10 + 8*c^2*d^8 + 12*c^4*d^6 + 8*c^6*d^4 + 2*c^8*d^2)*1i)/ 
((c - d*1i)^2*(c*1i + d)*(2*c*d^6 - c^6*d*1i + d^7*1i + c^2*d^5*1i + 4*c^3 
*d^4 - c^4*d^3*1i + 2*c^5*d^2)))*8i)/(f*(c - d*1i)^2*(c*1i + d)) - ((a^3*( 
c*d^2*5i + 5*c^2*d + c^3*1i + d^3))/(2*d^4*(c*d*2i - c^2 + d^2)) + (a^3*ta 
n(e + f*x)*(c^2 - c*d*2i + 3*d^2)*1i)/(d^3*(c*d*2i - c^2 + d^2)))/(f*(tan( 
e + f*x)^2 + c^2/d^2 + (2*c*tan(e + f*x))/d))
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 1041, normalized size of antiderivative = 7.77 \[ \int \frac {(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx =\text {Too large to display} \] Input:

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

Output:

(a**3*(4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*c**4*d**3*i - 12*log(tan 
(e + f*x)**2 + 1)*tan(e + f*x)**2*c**3*d**4 - 12*log(tan(e + f*x)**2 + 1)* 
tan(e + f*x)**2*c**2*d**5*i + 4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*c 
*d**6 + 8*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*c**5*d**2*i - 24*log(tan(e 
 + f*x)**2 + 1)*tan(e + f*x)*c**4*d**3 - 24*log(tan(e + f*x)**2 + 1)*tan(e 
 + f*x)*c**3*d**4*i + 8*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*c**2*d**5 + 
4*log(tan(e + f*x)**2 + 1)*c**6*d*i - 12*log(tan(e + f*x)**2 + 1)*c**5*d** 
2 - 12*log(tan(e + f*x)**2 + 1)*c**4*d**3*i + 4*log(tan(e + f*x)**2 + 1)*c 
**3*d**4 - 8*log(tan(e + f*x)*d + c)*tan(e + f*x)**2*c**4*d**3*i + 24*log( 
tan(e + f*x)*d + c)*tan(e + f*x)**2*c**3*d**4 + 24*log(tan(e + f*x)*d + c) 
*tan(e + f*x)**2*c**2*d**5*i - 8*log(tan(e + f*x)*d + c)*tan(e + f*x)**2*c 
*d**6 - 16*log(tan(e + f*x)*d + c)*tan(e + f*x)*c**5*d**2*i + 48*log(tan(e 
 + f*x)*d + c)*tan(e + f*x)*c**4*d**3 + 48*log(tan(e + f*x)*d + c)*tan(e + 
 f*x)*c**3*d**4*i - 16*log(tan(e + f*x)*d + c)*tan(e + f*x)*c**2*d**5 - 8* 
log(tan(e + f*x)*d + c)*c**6*d*i + 24*log(tan(e + f*x)*d + c)*c**5*d**2 + 
24*log(tan(e + f*x)*d + c)*c**4*d**3*i - 8*log(tan(e + f*x)*d + c)*c**3*d* 
*4 - tan(e + f*x)**2*c**6*d*i + 8*tan(e + f*x)**2*c**4*d**3*f*x - 7*tan(e 
+ f*x)**2*c**4*d**3*i + 24*tan(e + f*x)**2*c**3*d**4*f*i*x + 8*tan(e + f*x 
)**2*c**3*d**4 - 24*tan(e + f*x)**2*c**2*d**5*f*x - 3*tan(e + f*x)**2*c**2 
*d**5*i - 8*tan(e + f*x)**2*c*d**6*f*i*x + 8*tan(e + f*x)**2*c*d**6 + 3...