\(\int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx\) [717]

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

Optimal result

Integrand size = 41, antiderivative size = 158 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=\frac {6 (A+3 i B) c^4 x}{a^2}+\frac {6 (i A-3 B) c^4 \log (\cos (e+f x))}{a^2 f}-\frac {4 (i A-B) c^4}{a^2 f (i-\tan (e+f x))^2}+\frac {4 (3 A+5 i B) c^4}{a^2 f (i-\tan (e+f x))}-\frac {(A+6 i B) c^4 \tan (e+f x)}{a^2 f}-\frac {B c^4 \tan ^2(e+f x)}{2 a^2 f} \] Output:

6*(A+3*I*B)*c^4*x/a^2+6*(I*A-3*B)*c^4*ln(cos(f*x+e))/a^2/f-4*(I*A-B)*c^4/a 
^2/f/(I-tan(f*x+e))^2+4*(3*A+5*I*B)*c^4/a^2/f/(I-tan(f*x+e))-(A+6*I*B)*c^4 
*tan(f*x+e)/a^2/f-1/2*B*c^4*tan(f*x+e)^2/a^2/f
 

Mathematica [A] (verified)

Time = 5.64 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.82 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=\frac {c^4 \left (\frac {2 (A+3 i B) (i+\tan (e+f x))^3}{(a+i a \tan (e+f x))^2}+\frac {B (i+\tan (e+f x))^4}{(a+i a \tan (e+f x))^2}+\frac {12 (-i A+3 B) \left (\log (i-\tan (e+f x))+\frac {-2-4 i \tan (e+f x)}{(-i+\tan (e+f x))^2}\right )}{a^2}\right )}{2 f} \] Input:

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4)/(a + I*a*Tan[e + 
 f*x])^2,x]
 

Output:

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

Rubi [A] (verified)

Time = 0.62 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.72, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3042, 4071, 27, 86, 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 \frac {(c-i c \tan (e+f x))^4 (A+B \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4071

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 86

\(\displaystyle \frac {c^4 \int \left (\frac {8 i (A+i B)}{(\tan (e+f x)-i)^3}-A \left (\frac {6 i B}{A}+1\right )-B \tan (e+f x)-\frac {6 i (A+3 i B)}{\tan (e+f x)-i}+\frac {4 (3 A+5 i B)}{(\tan (e+f x)-i)^2}\right )d\tan (e+f x)}{a^2 f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {c^4 \left (-(A+6 i B) \tan (e+f x)+\frac {4 (3 A+5 i B)}{-\tan (e+f x)+i}-\frac {4 (-B+i A)}{(-\tan (e+f x)+i)^2}-6 (-3 B+i A) \log (-\tan (e+f x)+i)-\frac {1}{2} B \tan ^2(e+f x)\right )}{a^2 f}\)

Input:

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4)/(a + I*a*Tan[e + f*x]) 
^2,x]
 

Output:

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

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 86
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ 
.), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 
] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p 
+ 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
 

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

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

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

Time = 0.48 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.51

method result size
derivativedivides \(-\frac {B \,c^{4} \tan \left (f x +e \right )^{2}}{2 a^{2} f}-\frac {c^{4} A \tan \left (f x +e \right )}{f \,a^{2}}-\frac {6 i c^{4} B \tan \left (f x +e \right )}{f \,a^{2}}+\frac {6 c^{4} A \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{2}}-\frac {3 i c^{4} A \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f \,a^{2}}+\frac {18 i c^{4} B \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{2}}+\frac {9 c^{4} B \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f \,a^{2}}-\frac {20 i c^{4} B}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {12 c^{4} A}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {4 i c^{4} A}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {4 c^{4} B}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}\) \(239\)
default \(-\frac {B \,c^{4} \tan \left (f x +e \right )^{2}}{2 a^{2} f}-\frac {c^{4} A \tan \left (f x +e \right )}{f \,a^{2}}-\frac {6 i c^{4} B \tan \left (f x +e \right )}{f \,a^{2}}+\frac {6 c^{4} A \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{2}}-\frac {3 i c^{4} A \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f \,a^{2}}+\frac {18 i c^{4} B \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{2}}+\frac {9 c^{4} B \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f \,a^{2}}-\frac {20 i c^{4} B}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {12 c^{4} A}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {4 i c^{4} A}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {4 c^{4} B}{f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}\) \(239\)
risch \(\frac {8 c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a^{2} f}-\frac {4 i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a^{2} f}-\frac {c^{4} {\mathrm e}^{-4 i \left (f x +e \right )} B}{a^{2} f}+\frac {i c^{4} {\mathrm e}^{-4 i \left (f x +e \right )} A}{a^{2} f}+\frac {36 i c^{4} B x}{a^{2}}+\frac {12 c^{4} A x}{a^{2}}+\frac {36 i c^{4} B e}{f \,a^{2}}+\frac {12 c^{4} A e}{f \,a^{2}}+\frac {2 c^{4} \left (-i A \,{\mathrm e}^{2 i \left (f x +e \right )}+5 B \,{\mathrm e}^{2 i \left (f x +e \right )}-i A +6 B \right )}{f \,a^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}-\frac {18 c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f \,a^{2}}+\frac {6 i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f \,a^{2}}\) \(242\)
norman \(\frac {\frac {-8 i c^{4} A +17 B \,c^{4}}{a f}+\frac {6 \left (3 i c^{4} B +A \,c^{4}\right ) x}{a}-\frac {\left (6 i c^{4} B +A \,c^{4}\right ) \tan \left (f x +e \right )^{5}}{a f}+\frac {\left (-32 i c^{4} A +51 B \,c^{4}\right ) \tan \left (f x +e \right )^{2}}{2 a f}+\frac {12 \left (3 i c^{4} B +A \,c^{4}\right ) x \tan \left (f x +e \right )^{2}}{a}+\frac {6 \left (3 i c^{4} B +A \,c^{4}\right ) x \tan \left (f x +e \right )^{4}}{a}-\frac {\left (18 i c^{4} B +5 A \,c^{4}\right ) \tan \left (f x +e \right )}{a f}-\frac {2 \left (16 i c^{4} B +7 A \,c^{4}\right ) \tan \left (f x +e \right )^{3}}{a f}-\frac {B \,c^{4} \tan \left (f x +e \right )^{6}}{2 a f}}{a \left (1+\tan \left (f x +e \right )^{2}\right )^{2}}+\frac {3 \left (-i c^{4} A +3 B \,c^{4}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{a^{2} f}\) \(283\)

Input:

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^2,x,method=_R 
ETURNVERBOSE)
 

Output:

-1/2*B*c^4*tan(f*x+e)^2/a^2/f-1/f*c^4/a^2*A*tan(f*x+e)-6*I/f*c^4/a^2*B*tan 
(f*x+e)+6/f*c^4/a^2*A*arctan(tan(f*x+e))-3*I/f*c^4/a^2*A*ln(1+tan(f*x+e)^2 
)+18*I/f*c^4/a^2*B*arctan(tan(f*x+e))+9/f*c^4/a^2*B*ln(1+tan(f*x+e)^2)-20* 
I/f*c^4/a^2/(-I+tan(f*x+e))*B-12/f*c^4/a^2/(-I+tan(f*x+e))*A-4*I/f*c^4/a^2 
/(-I+tan(f*x+e))^2*A+4/f*c^4/a^2/(-I+tan(f*x+e))^2*B
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 249, normalized size of antiderivative = 1.58 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=\frac {12 \, {\left (A + 3 i \, B\right )} c^{4} f x e^{\left (8 i \, f x + 8 i \, e\right )} - 2 \, {\left (i \, A - 3 \, B\right )} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, A - B\right )} c^{4} + 6 \, {\left (4 \, {\left (A + 3 i \, B\right )} c^{4} f x - {\left (i \, A - 3 \, B\right )} c^{4}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (4 \, {\left (A + 3 i \, B\right )} c^{4} f x - 3 \, {\left (i \, A - 3 \, B\right )} c^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 6 \, {\left ({\left (-i \, A + 3 \, B\right )} c^{4} e^{\left (8 i \, f x + 8 i \, e\right )} + 2 \, {\left (-i \, A + 3 \, B\right )} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-i \, A + 3 \, B\right )} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{a^{2} f e^{\left (8 i \, f x + 8 i \, e\right )} + 2 \, a^{2} f e^{\left (6 i \, f x + 6 i \, e\right )} + a^{2} f e^{\left (4 i \, f x + 4 i \, e\right )}} \] Input:

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^2,x, al 
gorithm="fricas")
 

Output:

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

Sympy [A] (verification not implemented)

Time = 0.60 (sec) , antiderivative size = 377, normalized size of antiderivative = 2.39 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=\frac {- 2 i A c^{4} + 12 B c^{4} + \left (- 2 i A c^{4} e^{2 i e} + 10 B c^{4} e^{2 i e}\right ) e^{2 i f x}}{a^{2} f e^{4 i e} e^{4 i f x} + 2 a^{2} f e^{2 i e} e^{2 i f x} + a^{2} f} + \begin {cases} \frac {\left (\left (i A a^{2} c^{4} f e^{2 i e} - B a^{2} c^{4} f e^{2 i e}\right ) e^{- 4 i f x} + \left (- 4 i A a^{2} c^{4} f e^{4 i e} + 8 B a^{2} c^{4} f e^{4 i e}\right ) e^{- 2 i f x}\right ) e^{- 6 i e}}{a^{4} f^{2}} & \text {for}\: a^{4} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac {12 A c^{4} + 36 i B c^{4}}{a^{2}} + \frac {\left (12 A c^{4} e^{4 i e} - 8 A c^{4} e^{2 i e} + 4 A c^{4} + 36 i B c^{4} e^{4 i e} - 16 i B c^{4} e^{2 i e} + 4 i B c^{4}\right ) e^{- 4 i e}}{a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {6 i c^{4} \left (A + 3 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{2} f} + \frac {x \left (12 A c^{4} + 36 i B c^{4}\right )}{a^{2}} \] Input:

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**4/(a+I*a*tan(f*x+e))**2,x)
 

Output:

(-2*I*A*c**4 + 12*B*c**4 + (-2*I*A*c**4*exp(2*I*e) + 10*B*c**4*exp(2*I*e)) 
*exp(2*I*f*x))/(a**2*f*exp(4*I*e)*exp(4*I*f*x) + 2*a**2*f*exp(2*I*e)*exp(2 
*I*f*x) + a**2*f) + Piecewise((((I*A*a**2*c**4*f*exp(2*I*e) - B*a**2*c**4* 
f*exp(2*I*e))*exp(-4*I*f*x) + (-4*I*A*a**2*c**4*f*exp(4*I*e) + 8*B*a**2*c* 
*4*f*exp(4*I*e))*exp(-2*I*f*x))*exp(-6*I*e)/(a**4*f**2), Ne(a**4*f**2*exp( 
6*I*e), 0)), (x*(-(12*A*c**4 + 36*I*B*c**4)/a**2 + (12*A*c**4*exp(4*I*e) - 
 8*A*c**4*exp(2*I*e) + 4*A*c**4 + 36*I*B*c**4*exp(4*I*e) - 16*I*B*c**4*exp 
(2*I*e) + 4*I*B*c**4)*exp(-4*I*e)/a**2), True)) + 6*I*c**4*(A + 3*I*B)*log 
(exp(2*I*f*x) + exp(-2*I*e))/(a**2*f) + x*(12*A*c**4 + 36*I*B*c**4)/a**2
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^2,x, al 
gorithm="maxima")
 

Output:

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati 
ve exponent.
 

Giac [A] (verification not implemented)

Time = 0.61 (sec) , antiderivative size = 140, normalized size of antiderivative = 0.89 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=-\frac {6 \, {\left (i \, A c^{4} - 3 \, B c^{4}\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2} f} - \frac {4 \, {\left (-2 i \, A c^{4} + 4 \, B c^{4} + {\left (3 \, A c^{4} + 5 i \, B c^{4}\right )} \tan \left (f x + e\right )\right )}}{a^{2} f {\left (\tan \left (f x + e\right ) - i\right )}^{2}} - \frac {B a^{2} c^{4} f \tan \left (f x + e\right )^{2} + 2 \, A a^{2} c^{4} f \tan \left (f x + e\right ) + 12 i \, B a^{2} c^{4} f \tan \left (f x + e\right )}{2 \, a^{4} f^{2}} \] Input:

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^2,x, al 
gorithm="giac")
 

Output:

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

Mupad [B] (verification not implemented)

Time = 5.20 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.31 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {18\,B\,c^4}{a^2}+\frac {A\,c^4\,6{}\mathrm {i}}{a^2}\right )}{f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {c^4\,\left (A+B\,3{}\mathrm {i}\right )}{a^2}+\frac {B\,c^4\,3{}\mathrm {i}}{a^2}\right )}{f}-\frac {\frac {\left (-6\,B\,c^4+A\,c^4\,2{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a^2}-\frac {\left (-18\,B\,c^4+A\,c^4\,6{}\mathrm {i}\right )\,3{}\mathrm {i}}{2\,a^2}+\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {2\,\left (-18\,B\,c^4+A\,c^4\,6{}\mathrm {i}\right )}{a^2}+\frac {16\,B\,c^4}{a^2}\right )-\frac {B\,c^4\,8{}\mathrm {i}}{a^2}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}+2\,\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}-\frac {B\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,a^2\,f} \] Input:

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i)^4)/(a + a*tan(e + f*x)*1 
i)^2,x)
 

Output:

- (log(tan(e + f*x) - 1i)*((A*c^4*6i)/a^2 - (18*B*c^4)/a^2))/f - (tan(e + 
f*x)*((c^4*(A + B*3i))/a^2 + (B*c^4*3i)/a^2))/f - (((A*c^4*2i - 6*B*c^4)*1 
i)/(2*a^2) - ((A*c^4*6i - 18*B*c^4)*3i)/(2*a^2) + tan(e + f*x)*((2*(A*c^4* 
6i - 18*B*c^4))/a^2 + (16*B*c^4)/a^2) - (B*c^4*8i)/a^2)/(f*(2*tan(e + f*x) 
 + tan(e + f*x)^2*1i - 1i)) - (B*c^4*tan(e + f*x)^2)/(2*a^2*f)
 

Reduce [F]

\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^2} \, dx=\frac {c^{4} \left (-\left (\int \frac {\tan \left (f x +e \right )^{5}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b -\left (\int \frac {\tan \left (f x +e \right )^{4}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a -4 \left (\int \frac {\tan \left (f x +e \right )^{4}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b i -4 \left (\int \frac {\tan \left (f x +e \right )^{3}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a i +6 \left (\int \frac {\tan \left (f x +e \right )^{3}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b +6 \left (\int \frac {\tan \left (f x +e \right )^{2}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a +4 \left (\int \frac {\tan \left (f x +e \right )^{2}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b i +4 \left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a i -\left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b -\left (\int \frac {1}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a \right )}{a^{2}} \] Input:

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^2,x)
 

Output:

(c**4*( - int(tan(e + f*x)**5/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)* 
b - int(tan(e + f*x)**4/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*a - 4* 
int(tan(e + f*x)**4/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*b*i - 4*in 
t(tan(e + f*x)**3/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*a*i + 6*int( 
tan(e + f*x)**3/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*b + 6*int(tan( 
e + f*x)**2/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*a + 4*int(tan(e + 
f*x)**2/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*b*i + 4*int(tan(e + f* 
x)/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*a*i - int(tan(e + f*x)/(tan 
(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*b - int(1/(tan(e + f*x)**2 - 2*tan 
(e + f*x)*i - 1),x)*a))/a**2