\(\int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx\) [155]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [F]

Optimal result

Integrand size = 28, antiderivative size = 118 \[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=\frac {4 (-1)^{3/4} a^2 \arctan \left (\frac {(-1)^{3/4} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{d^{7/2} f}-\frac {2 a^2}{5 d f (d \tan (e+f x))^{5/2}}-\frac {4 i a^2}{3 d^2 f (d \tan (e+f x))^{3/2}}+\frac {4 a^2}{d^3 f \sqrt {d \tan (e+f x)}} \] Output:

4*(-1)^(3/4)*a^2*arctan((-1)^(3/4)*(d*tan(f*x+e))^(1/2)/d^(1/2))/d^(7/2)/f 
-2/5*a^2/d/f/(d*tan(f*x+e))^(5/2)-4/3*I*a^2/d^2/f/(d*tan(f*x+e))^(3/2)+4*a 
^2/d^3/f/(d*tan(f*x+e))^(1/2)
 

Mathematica [A] (verified)

Time = 1.28 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.77 \[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=-\frac {2 a^2 \left ((15+15 i) \sqrt {2} \sqrt {d} \text {arctanh}\left (\frac {(1+i) \sqrt {d \tan (e+f x)}}{\sqrt {2} \sqrt {d}}\right )+\frac {d \left (-30+10 i \cot (e+f x)+3 \cot ^2(e+f x)\right )}{\sqrt {d \tan (e+f x)}}\right )}{15 d^4 f} \] Input:

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

Output:

(-2*a^2*((15 + 15*I)*Sqrt[2]*Sqrt[d]*ArcTanh[((1 + I)*Sqrt[d*Tan[e + f*x]] 
)/(Sqrt[2]*Sqrt[d])] + (d*(-30 + (10*I)*Cot[e + f*x] + 3*Cot[e + f*x]^2))/ 
Sqrt[d*Tan[e + f*x]]))/(15*d^4*f)
 

Rubi [A] (verified)

Time = 0.64 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.06, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.393, Rules used = {3042, 4025, 27, 3042, 4012, 25, 3042, 4012, 3042, 4016, 218}

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))^2}{(d \tan (e+f x))^{7/2}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4025

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4012

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4012

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4016

\(\displaystyle -\frac {2 a^2}{5 d f (d \tan (e+f x))^{5/2}}+\frac {2 \left (-\frac {-\frac {2 a^2 d}{f \sqrt {d \tan (e+f x)}}-\frac {2 a^4 d^4 \int \frac {1}{i a^2 d^4+a^2 \tan (e+f x) d^4}d\sqrt {d \tan (e+f x)}}{f}}{d^2}-\frac {2 i a^2}{3 f (d \tan (e+f x))^{3/2}}\right )}{d^2}\)

\(\Big \downarrow \) 218

\(\displaystyle -\frac {2 a^2}{5 d f (d \tan (e+f x))^{5/2}}+\frac {2 \left (-\frac {-\frac {2 (-1)^{3/4} a^2 \sqrt {d} \arctan \left (\frac {(-1)^{3/4} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{f}-\frac {2 a^2 d}{f \sqrt {d \tan (e+f x)}}}{d^2}-\frac {2 i a^2}{3 f (d \tan (e+f x))^{3/2}}\right )}{d^2}\)

Input:

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

Output:

(-2*a^2)/(5*d*f*(d*Tan[e + f*x])^(5/2)) + (2*((((-2*I)/3)*a^2)/(f*(d*Tan[e 
 + f*x])^(3/2)) - ((-2*(-1)^(3/4)*a^2*Sqrt[d]*ArcTan[((-1)^(3/4)*Sqrt[d*Ta 
n[e + f*x]])/Sqrt[d]])/f - (2*a^2*d)/(f*Sqrt[d*Tan[e + f*x]]))/d^2))/d^2
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

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

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

rule 4016
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(b_.)*tan[(e_.) + (f_.)*(x_ 
)]], x_Symbol] :> Simp[2*(c^2/f)   Subst[Int[1/(b*c - d*x^2), x], x, Sqrt[b 
*Tan[e + f*x]]], x] /; FreeQ[{b, c, d, e, f}, x] && EqQ[c^2 + d^2, 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]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (97 ) = 194\).

Time = 1.49 (sec) , antiderivative size = 327, normalized size of antiderivative = 2.77

method result size
derivativedivides \(\frac {2 a^{2} \left (\frac {-\frac {i \left (d^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 d}+\frac {\sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (d^{2}\right )^{\frac {1}{4}}}}{d^{2}}-\frac {1}{5 \left (d \tan \left (f x +e \right )\right )^{\frac {5}{2}}}-\frac {2 i}{3 d \left (d \tan \left (f x +e \right )\right )^{\frac {3}{2}}}+\frac {2}{d^{2} \sqrt {d \tan \left (f x +e \right )}}\right )}{f d}\) \(327\)
default \(\frac {2 a^{2} \left (\frac {-\frac {i \left (d^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 d}+\frac {\sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (d^{2}\right )^{\frac {1}{4}}}}{d^{2}}-\frac {1}{5 \left (d \tan \left (f x +e \right )\right )^{\frac {5}{2}}}-\frac {2 i}{3 d \left (d \tan \left (f x +e \right )\right )^{\frac {3}{2}}}+\frac {2}{d^{2} \sqrt {d \tan \left (f x +e \right )}}\right )}{f d}\) \(327\)
parts \(\frac {2 a^{2} d \left (\frac {\sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 d^{4} \left (d^{2}\right )^{\frac {1}{4}}}-\frac {1}{5 d^{2} \left (d \tan \left (f x +e \right )\right )^{\frac {5}{2}}}+\frac {1}{d^{4} \sqrt {d \tan \left (f x +e \right )}}\right )}{f}+\frac {2 i a^{2} \left (-\frac {2}{3 d^{2} \left (d \tan \left (f x +e \right )\right )^{\frac {3}{2}}}-\frac {\left (d^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 d^{4}}\right )}{f}-\frac {2 a^{2} \left (-\frac {1}{d^{2} \sqrt {d \tan \left (f x +e \right )}}-\frac {\sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 d^{2} \left (d^{2}\right )^{\frac {1}{4}}}\right )}{f d}\) \(495\)

Input:

int((a+I*a*tan(f*x+e))^2/(d*tan(f*x+e))^(7/2),x,method=_RETURNVERBOSE)
 

Output:

2/f*a^2/d*(1/d^2*(-1/4*I/d*(d^2)^(1/4)*2^(1/2)*(ln((d*tan(f*x+e)+(d^2)^(1/ 
4)*(d*tan(f*x+e))^(1/2)*2^(1/2)+(d^2)^(1/2))/(d*tan(f*x+e)-(d^2)^(1/4)*(d* 
tan(f*x+e))^(1/2)*2^(1/2)+(d^2)^(1/2)))+2*arctan(2^(1/2)/(d^2)^(1/4)*(d*ta 
n(f*x+e))^(1/2)+1)-2*arctan(-2^(1/2)/(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)+1))+ 
1/4/(d^2)^(1/4)*2^(1/2)*(ln((d*tan(f*x+e)-(d^2)^(1/4)*(d*tan(f*x+e))^(1/2) 
*2^(1/2)+(d^2)^(1/2))/(d*tan(f*x+e)+(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)*2^(1/ 
2)+(d^2)^(1/2)))+2*arctan(2^(1/2)/(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)+1)-2*ar 
ctan(-2^(1/2)/(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)+1)))-1/5/(d*tan(f*x+e))^(5/ 
2)-2/3*I/d/(d*tan(f*x+e))^(3/2)+2/d^2/(d*tan(f*x+e))^(1/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. 468 vs. \(2 (96) = 192\).

Time = 0.11 (sec) , antiderivative size = 468, normalized size of antiderivative = 3.97 \[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=\frac {15 \, {\left (d^{4} f e^{\left (6 i \, f x + 6 i \, e\right )} - 3 \, d^{4} f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, d^{4} f e^{\left (2 i \, f x + 2 i \, e\right )} - d^{4} f\right )} \sqrt {\frac {16 i \, a^{4}}{d^{7} f^{2}}} \log \left (\frac {{\left (-4 i \, a^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, d^{4} f e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d^{4} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {16 i \, a^{4}}{d^{7} f^{2}}}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a^{2}}\right ) - 15 \, {\left (d^{4} f e^{\left (6 i \, f x + 6 i \, e\right )} - 3 \, d^{4} f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, d^{4} f e^{\left (2 i \, f x + 2 i \, e\right )} - d^{4} f\right )} \sqrt {\frac {16 i \, a^{4}}{d^{7} f^{2}}} \log \left (\frac {{\left (-4 i \, a^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, d^{4} f e^{\left (2 i \, f x + 2 i \, e\right )} - i \, d^{4} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {16 i \, a^{4}}{d^{7} f^{2}}}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a^{2}}\right ) - 8 \, {\left (-43 i \, a^{2} e^{\left (6 i \, f x + 6 i \, e\right )} + 11 i \, a^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 31 i \, a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 23 i \, a^{2}\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}}{60 \, {\left (d^{4} f e^{\left (6 i \, f x + 6 i \, e\right )} - 3 \, d^{4} f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, d^{4} f e^{\left (2 i \, f x + 2 i \, e\right )} - d^{4} f\right )}} \] Input:

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

Output:

1/60*(15*(d^4*f*e^(6*I*f*x + 6*I*e) - 3*d^4*f*e^(4*I*f*x + 4*I*e) + 3*d^4* 
f*e^(2*I*f*x + 2*I*e) - d^4*f)*sqrt(16*I*a^4/(d^7*f^2))*log(1/2*(-4*I*a^2* 
d*e^(2*I*f*x + 2*I*e) + (I*d^4*f*e^(2*I*f*x + 2*I*e) + I*d^4*f)*sqrt((-I*d 
*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(16*I*a^4/(d^7* 
f^2)))*e^(-2*I*f*x - 2*I*e)/a^2) - 15*(d^4*f*e^(6*I*f*x + 6*I*e) - 3*d^4*f 
*e^(4*I*f*x + 4*I*e) + 3*d^4*f*e^(2*I*f*x + 2*I*e) - d^4*f)*sqrt(16*I*a^4/ 
(d^7*f^2))*log(1/2*(-4*I*a^2*d*e^(2*I*f*x + 2*I*e) + (-I*d^4*f*e^(2*I*f*x 
+ 2*I*e) - I*d^4*f)*sqrt((-I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2* 
I*e) + 1))*sqrt(16*I*a^4/(d^7*f^2)))*e^(-2*I*f*x - 2*I*e)/a^2) - 8*(-43*I* 
a^2*e^(6*I*f*x + 6*I*e) + 11*I*a^2*e^(4*I*f*x + 4*I*e) + 31*I*a^2*e^(2*I*f 
*x + 2*I*e) - 23*I*a^2)*sqrt((-I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x 
+ 2*I*e) + 1)))/(d^4*f*e^(6*I*f*x + 6*I*e) - 3*d^4*f*e^(4*I*f*x + 4*I*e) + 
 3*d^4*f*e^(2*I*f*x + 2*I*e) - d^4*f)
 

Sympy [F]

\[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=- a^{2} \left (\int \left (- \frac {1}{\left (d \tan {\left (e + f x \right )}\right )^{\frac {7}{2}}}\right )\, dx + \int \frac {\tan ^{2}{\left (e + f x \right )}}{\left (d \tan {\left (e + f x \right )}\right )^{\frac {7}{2}}}\, dx + \int \left (- \frac {2 i \tan {\left (e + f x \right )}}{\left (d \tan {\left (e + f x \right )}\right )^{\frac {7}{2}}}\right )\, dx\right ) \] Input:

integrate((a+I*a*tan(f*x+e))**2/(d*tan(f*x+e))**(7/2),x)
 

Output:

-a**2*(Integral(-1/(d*tan(e + f*x))**(7/2), x) + Integral(tan(e + f*x)**2/ 
(d*tan(e + f*x))**(7/2), x) + Integral(-2*I*tan(e + f*x)/(d*tan(e + f*x))* 
*(7/2), 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. 219 vs. \(2 (96) = 192\).

Time = 0.16 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.86 \[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=\frac {\frac {15 \, a^{2} {\left (-\frac {\left (2 i - 2\right ) \, \sqrt {2} \arctan \left (\frac {\sqrt {2} {\left (\sqrt {2} \sqrt {d} + 2 \, \sqrt {d \tan \left (f x + e\right )}\right )}}{2 \, \sqrt {d}}\right )}{\sqrt {d}} - \frac {\left (2 i - 2\right ) \, \sqrt {2} \arctan \left (-\frac {\sqrt {2} {\left (\sqrt {2} \sqrt {d} - 2 \, \sqrt {d \tan \left (f x + e\right )}\right )}}{2 \, \sqrt {d}}\right )}{\sqrt {d}} - \frac {\left (i + 1\right ) \, \sqrt {2} \log \left (d \tan \left (f x + e\right ) + \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} + d\right )}{\sqrt {d}} + \frac {\left (i + 1\right ) \, \sqrt {2} \log \left (d \tan \left (f x + e\right ) - \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} + d\right )}{\sqrt {d}}\right )}}{d^{2}} + \frac {4 \, {\left (30 \, a^{2} d^{2} \tan \left (f x + e\right )^{2} - 10 i \, a^{2} d^{2} \tan \left (f x + e\right ) - 3 \, a^{2} d^{2}\right )}}{\left (d \tan \left (f x + e\right )\right )^{\frac {5}{2}} d^{2}}}{30 \, d f} \] Input:

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

Output:

1/30*(15*a^2*(-(2*I - 2)*sqrt(2)*arctan(1/2*sqrt(2)*(sqrt(2)*sqrt(d) + 2*s 
qrt(d*tan(f*x + e)))/sqrt(d))/sqrt(d) - (2*I - 2)*sqrt(2)*arctan(-1/2*sqrt 
(2)*(sqrt(2)*sqrt(d) - 2*sqrt(d*tan(f*x + e)))/sqrt(d))/sqrt(d) - (I + 1)* 
sqrt(2)*log(d*tan(f*x + e) + sqrt(2)*sqrt(d*tan(f*x + e))*sqrt(d) + d)/sqr 
t(d) + (I + 1)*sqrt(2)*log(d*tan(f*x + e) - sqrt(2)*sqrt(d*tan(f*x + e))*s 
qrt(d) + d)/sqrt(d))/d^2 + 4*(30*a^2*d^2*tan(f*x + e)^2 - 10*I*a^2*d^2*tan 
(f*x + e) - 3*a^2*d^2)/((d*tan(f*x + e))^(5/2)*d^2))/(d*f)
 

Giac [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.97 \[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=\frac {2 \, a^{2} {\left (\frac {30 \, \sqrt {2} \arctan \left (\frac {2 \, \sqrt {d \tan \left (f x + e\right )} {\left | d \right |}}{i \, \sqrt {2} d^{\frac {3}{2}} + \sqrt {2} \sqrt {d} {\left | d \right |}}\right )}{d^{\frac {7}{2}} {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}} + \frac {30 \, d^{2} \tan \left (f x + e\right )^{2} - 10 i \, d^{2} \tan \left (f x + e\right ) - 3 \, d^{2}}{\sqrt {d \tan \left (f x + e\right )} d^{5} \tan \left (f x + e\right )^{2}}\right )}}{15 \, f} \] Input:

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

Output:

2/15*a^2*(30*sqrt(2)*arctan(2*sqrt(d*tan(f*x + e))*abs(d)/(I*sqrt(2)*d^(3/ 
2) + sqrt(2)*sqrt(d)*abs(d)))/(d^(7/2)*(I*d/abs(d) + 1)) + (30*d^2*tan(f*x 
 + e)^2 - 10*I*d^2*tan(f*x + e) - 3*d^2)/(sqrt(d*tan(f*x + e))*d^5*tan(f*x 
 + e)^2))/f
 

Mupad [B] (verification not implemented)

Time = 1.51 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.81 \[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=-\frac {\frac {2\,a^2}{5\,d\,f}-\frac {4\,a^2\,{\mathrm {tan}\left (e+f\,x\right )}^2}{d\,f}+\frac {a^2\,\mathrm {tan}\left (e+f\,x\right )\,4{}\mathrm {i}}{3\,d\,f}}{{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^{5/2}}-\frac {2\,\sqrt {4{}\mathrm {i}}\,a^2\,\mathrm {atanh}\left (\frac {\sqrt {4{}\mathrm {i}}\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{2\,\sqrt {d}}\right )}{d^{7/2}\,f} \] Input:

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

Output:

- ((2*a^2)/(5*d*f) + (a^2*tan(e + f*x)*4i)/(3*d*f) - (4*a^2*tan(e + f*x)^2 
)/(d*f))/(d*tan(e + f*x))^(5/2) - (2*4i^(1/2)*a^2*atanh((4i^(1/2)*(d*tan(e 
 + f*x))^(1/2))/(2*d^(1/2))))/(d^(7/2)*f)
 

Reduce [F]

\[ \int \frac {(a+i a \tan (e+f x))^2}{(d \tan (e+f x))^{7/2}} \, dx=\frac {\sqrt {d}\, a^{2} \left (\int \frac {\sqrt {\tan \left (f x +e \right )}}{\tan \left (f x +e \right )^{4}}d x +2 \left (\int \frac {\sqrt {\tan \left (f x +e \right )}}{\tan \left (f x +e \right )^{3}}d x \right ) i -\left (\int \frac {\sqrt {\tan \left (f x +e \right )}}{\tan \left (f x +e \right )^{2}}d x \right )\right )}{d^{4}} \] Input:

int((a+I*a*tan(f*x+e))^2/(d*tan(f*x+e))^(7/2),x)
 

Output:

(sqrt(d)*a**2*(int(sqrt(tan(e + f*x))/tan(e + f*x)**4,x) + 2*int(sqrt(tan( 
e + f*x))/tan(e + f*x)**3,x)*i - int(sqrt(tan(e + f*x))/tan(e + f*x)**2,x) 
))/d**4