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

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 = 23, antiderivative size = 294 \[ \int \frac {(c+d x)^2}{(a+i a \tan (e+f x))^3} \, dx=-\frac {3 i d^2 e^{-2 i e-2 i f x}}{32 a^3 f^3}-\frac {3 i d^2 e^{-4 i e-4 i f x}}{256 a^3 f^3}-\frac {i d^2 e^{-6 i e-6 i f x}}{864 a^3 f^3}+\frac {3 d e^{-2 i e-2 i f x} (c+d x)}{16 a^3 f^2}+\frac {3 d e^{-4 i e-4 i f x} (c+d x)}{64 a^3 f^2}+\frac {d e^{-6 i e-6 i f x} (c+d x)}{144 a^3 f^2}+\frac {3 i e^{-2 i e-2 i f x} (c+d x)^2}{16 a^3 f}+\frac {3 i e^{-4 i e-4 i f x} (c+d x)^2}{32 a^3 f}+\frac {i e^{-6 i e-6 i f x} (c+d x)^2}{48 a^3 f}+\frac {(c+d x)^3}{24 a^3 d} \] Output:

-3/32*I*d^2*exp(-2*I*e-2*I*f*x)/a^3/f^3-3/256*I*d^2*exp(-4*I*e-4*I*f*x)/a^ 
3/f^3-1/864*I*d^2*exp(-6*I*e-6*I*f*x)/a^3/f^3+3/16*d*exp(-2*I*e-2*I*f*x)*( 
d*x+c)/a^3/f^2+3/64*d*exp(-4*I*e-4*I*f*x)*(d*x+c)/a^3/f^2+1/144*d*exp(-6*I 
*e-6*I*f*x)*(d*x+c)/a^3/f^2+3/16*I*exp(-2*I*e-2*I*f*x)*(d*x+c)^2/a^3/f+3/3 
2*I*exp(-4*I*e-4*I*f*x)*(d*x+c)^2/a^3/f+1/48*I*exp(-6*I*e-6*I*f*x)*(d*x+c) 
^2/a^3/f+1/24*(d*x+c)^3/a^3/d
 

Mathematica [A] (verified)

Time = 2.23 (sec) , antiderivative size = 405, normalized size of antiderivative = 1.38 \[ \int \frac {(c+d x)^2}{(a+i a \tan (e+f x))^3} \, dx=\frac {i \sec ^3(e+f x) \left (81 \left (24 i c^2 f^2+4 c d f (5+12 i f x)+d^2 \left (-9 i+20 f x+24 i f^2 x^2\right )\right ) \cos (e+f x)+8 \left (18 c^2 f^2 (i+6 f x)+6 c d f \left (1+6 i f x+18 f^2 x^2\right )+d^2 \left (-i+6 f x+18 i f^2 x^2+36 f^3 x^3\right )\right ) \cos (3 (e+f x))+567 d^2 \sin (e+f x)+972 i c d f \sin (e+f x)-648 c^2 f^2 \sin (e+f x)+972 i d^2 f x \sin (e+f x)-1296 c d f^2 x \sin (e+f x)-648 d^2 f^2 x^2 \sin (e+f x)-8 d^2 \sin (3 (e+f x))-48 i c d f \sin (3 (e+f x))+144 c^2 f^2 \sin (3 (e+f x))-48 i d^2 f x \sin (3 (e+f x))+288 c d f^2 x \sin (3 (e+f x))+864 i c^2 f^3 x \sin (3 (e+f x))+144 d^2 f^2 x^2 \sin (3 (e+f x))+864 i c d f^3 x^2 \sin (3 (e+f x))+288 i d^2 f^3 x^3 \sin (3 (e+f x))\right )}{6912 a^3 f^3 (-i+\tan (e+f x))^3} \] Input:

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

Output:

((I/6912)*Sec[e + f*x]^3*(81*((24*I)*c^2*f^2 + 4*c*d*f*(5 + (12*I)*f*x) + 
d^2*(-9*I + 20*f*x + (24*I)*f^2*x^2))*Cos[e + f*x] + 8*(18*c^2*f^2*(I + 6* 
f*x) + 6*c*d*f*(1 + (6*I)*f*x + 18*f^2*x^2) + d^2*(-I + 6*f*x + (18*I)*f^2 
*x^2 + 36*f^3*x^3))*Cos[3*(e + f*x)] + 567*d^2*Sin[e + f*x] + (972*I)*c*d* 
f*Sin[e + f*x] - 648*c^2*f^2*Sin[e + f*x] + (972*I)*d^2*f*x*Sin[e + f*x] - 
 1296*c*d*f^2*x*Sin[e + f*x] - 648*d^2*f^2*x^2*Sin[e + f*x] - 8*d^2*Sin[3* 
(e + f*x)] - (48*I)*c*d*f*Sin[3*(e + f*x)] + 144*c^2*f^2*Sin[3*(e + f*x)] 
- (48*I)*d^2*f*x*Sin[3*(e + f*x)] + 288*c*d*f^2*x*Sin[3*(e + f*x)] + (864* 
I)*c^2*f^3*x*Sin[3*(e + f*x)] + 144*d^2*f^2*x^2*Sin[3*(e + f*x)] + (864*I) 
*c*d*f^3*x^2*Sin[3*(e + f*x)] + (288*I)*d^2*f^3*x^3*Sin[3*(e + f*x)]))/(a^ 
3*f^3*(-I + Tan[e + f*x])^3)
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 294, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3042, 4212, 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+d x)^2}{(a+i a \tan (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4212

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {3 d (c+d x) e^{-2 i e-2 i f x}}{16 a^3 f^2}+\frac {3 d (c+d x) e^{-4 i e-4 i f x}}{64 a^3 f^2}+\frac {d (c+d x) e^{-6 i e-6 i f x}}{144 a^3 f^2}+\frac {3 i (c+d x)^2 e^{-2 i e-2 i f x}}{16 a^3 f}+\frac {3 i (c+d x)^2 e^{-4 i e-4 i f x}}{32 a^3 f}+\frac {i (c+d x)^2 e^{-6 i e-6 i f x}}{48 a^3 f}+\frac {(c+d x)^3}{24 a^3 d}-\frac {3 i d^2 e^{-2 i e-2 i f x}}{32 a^3 f^3}-\frac {3 i d^2 e^{-4 i e-4 i f x}}{256 a^3 f^3}-\frac {i d^2 e^{-6 i e-6 i f x}}{864 a^3 f^3}\)

Input:

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

Output:

(((-3*I)/32)*d^2*E^((-2*I)*e - (2*I)*f*x))/(a^3*f^3) - (((3*I)/256)*d^2*E^ 
((-4*I)*e - (4*I)*f*x))/(a^3*f^3) - ((I/864)*d^2*E^((-6*I)*e - (6*I)*f*x)) 
/(a^3*f^3) + (3*d*E^((-2*I)*e - (2*I)*f*x)*(c + d*x))/(16*a^3*f^2) + (3*d* 
E^((-4*I)*e - (4*I)*f*x)*(c + d*x))/(64*a^3*f^2) + (d*E^((-6*I)*e - (6*I)* 
f*x)*(c + d*x))/(144*a^3*f^2) + (((3*I)/16)*E^((-2*I)*e - (2*I)*f*x)*(c + 
d*x)^2)/(a^3*f) + (((3*I)/32)*E^((-4*I)*e - (4*I)*f*x)*(c + d*x)^2)/(a^3*f 
) + ((I/48)*E^((-6*I)*e - (6*I)*f*x)*(c + d*x)^2)/(a^3*f) + (c + d*x)^3/(2 
4*a^3*d)
 

Defintions of rubi rules used

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 4212
Int[((c_.) + (d_.)*(x_))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), 
x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (1/(2*a) + E^(2*(a/b)*(e + f* 
x))/(2*a))^(-n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 + b^2 
, 0] && ILtQ[n, 0]
 
Maple [A] (verified)

Time = 1.07 (sec) , antiderivative size = 238, normalized size of antiderivative = 0.81

method result size
risch \(\frac {d^{2} x^{3}}{24 a^{3}}+\frac {d c \,x^{2}}{8 a^{3}}+\frac {c^{2} x}{8 a^{3}}+\frac {c^{3}}{24 a^{3} d}+\frac {3 i \left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x -2 i d^{2} f x +2 c^{2} f^{2}-2 i c d f -d^{2}\right ) {\mathrm e}^{-2 i \left (f x +e \right )}}{32 f^{3} a^{3}}+\frac {3 i \left (8 d^{2} x^{2} f^{2}+16 c d \,f^{2} x -4 i d^{2} f x +8 c^{2} f^{2}-4 i c d f -d^{2}\right ) {\mathrm e}^{-4 i \left (f x +e \right )}}{256 f^{3} a^{3}}+\frac {i \left (18 d^{2} x^{2} f^{2}+36 c d \,f^{2} x -6 i d^{2} f x +18 c^{2} f^{2}-6 i c d f -d^{2}\right ) {\mathrm e}^{-6 i \left (f x +e \right )}}{864 f^{3} a^{3}}\) \(238\)

Input:

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

Output:

1/24/a^3*d^2*x^3+1/8/a^3*d*c*x^2+1/8/a^3*c^2*x+1/24/a^3/d*c^3+3/32*I*(2*d^ 
2*x^2*f^2-2*I*d^2*f*x+4*c*d*f^2*x-2*I*c*d*f+2*c^2*f^2-d^2)/f^3/a^3*exp(-2* 
I*(f*x+e))+3/256*I*(8*d^2*x^2*f^2-4*I*d^2*f*x+16*c*d*f^2*x-4*I*c*d*f+8*c^2 
*f^2-d^2)/f^3/a^3*exp(-4*I*(f*x+e))+1/864*I*(18*d^2*x^2*f^2-6*I*d^2*f*x+36 
*c*d*f^2*x-6*I*c*d*f+18*c^2*f^2-d^2)/f^3/a^3*exp(-6*I*(f*x+e))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 221, normalized size of antiderivative = 0.75 \[ \int \frac {(c+d x)^2}{(a+i a \tan (e+f x))^3} \, dx=\frac {{\left (144 i \, d^{2} f^{2} x^{2} + 144 i \, c^{2} f^{2} + 48 \, c d f - 8 i \, d^{2} - 48 \, {\left (-6 i \, c d f^{2} - d^{2} f\right )} x + 288 \, {\left (d^{2} f^{3} x^{3} + 3 \, c d f^{3} x^{2} + 3 \, c^{2} f^{3} x\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - 648 \, {\left (-2 i \, d^{2} f^{2} x^{2} - 2 i \, c^{2} f^{2} - 2 \, c d f + i \, d^{2} + 2 \, {\left (-2 i \, c d f^{2} - d^{2} f\right )} x\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 81 \, {\left (-8 i \, d^{2} f^{2} x^{2} - 8 i \, c^{2} f^{2} - 4 \, c d f + i \, d^{2} + 4 \, {\left (-4 i \, c d f^{2} - d^{2} f\right )} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6912 \, a^{3} f^{3}} \] Input:

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

Output:

1/6912*(144*I*d^2*f^2*x^2 + 144*I*c^2*f^2 + 48*c*d*f - 8*I*d^2 - 48*(-6*I* 
c*d*f^2 - d^2*f)*x + 288*(d^2*f^3*x^3 + 3*c*d*f^3*x^2 + 3*c^2*f^3*x)*e^(6* 
I*f*x + 6*I*e) - 648*(-2*I*d^2*f^2*x^2 - 2*I*c^2*f^2 - 2*c*d*f + I*d^2 + 2 
*(-2*I*c*d*f^2 - d^2*f)*x)*e^(4*I*f*x + 4*I*e) - 81*(-8*I*d^2*f^2*x^2 - 8* 
I*c^2*f^2 - 4*c*d*f + I*d^2 + 4*(-4*I*c*d*f^2 - d^2*f)*x)*e^(2*I*f*x + 2*I 
*e))*e^(-6*I*f*x - 6*I*e)/(a^3*f^3)
 

Sympy [A] (verification not implemented)

Time = 0.40 (sec) , antiderivative size = 588, normalized size of antiderivative = 2.00 \[ \int \frac {(c+d x)^2}{(a+i a \tan (e+f x))^3} \, dx=\begin {cases} \frac {\left (\left (147456 i a^{6} c^{2} f^{8} e^{6 i e} + 294912 i a^{6} c d f^{8} x e^{6 i e} + 49152 a^{6} c d f^{7} e^{6 i e} + 147456 i a^{6} d^{2} f^{8} x^{2} e^{6 i e} + 49152 a^{6} d^{2} f^{7} x e^{6 i e} - 8192 i a^{6} d^{2} f^{6} e^{6 i e}\right ) e^{- 6 i f x} + \left (663552 i a^{6} c^{2} f^{8} e^{8 i e} + 1327104 i a^{6} c d f^{8} x e^{8 i e} + 331776 a^{6} c d f^{7} e^{8 i e} + 663552 i a^{6} d^{2} f^{8} x^{2} e^{8 i e} + 331776 a^{6} d^{2} f^{7} x e^{8 i e} - 82944 i a^{6} d^{2} f^{6} e^{8 i e}\right ) e^{- 4 i f x} + \left (1327104 i a^{6} c^{2} f^{8} e^{10 i e} + 2654208 i a^{6} c d f^{8} x e^{10 i e} + 1327104 a^{6} c d f^{7} e^{10 i e} + 1327104 i a^{6} d^{2} f^{8} x^{2} e^{10 i e} + 1327104 a^{6} d^{2} f^{7} x e^{10 i e} - 663552 i a^{6} d^{2} f^{6} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{7077888 a^{9} f^{9}} & \text {for}\: a^{9} f^{9} e^{12 i e} \neq 0 \\\frac {x^{3} \cdot \left (3 d^{2} e^{4 i e} + 3 d^{2} e^{2 i e} + d^{2}\right ) e^{- 6 i e}}{24 a^{3}} + \frac {x^{2} \cdot \left (3 c d e^{4 i e} + 3 c d e^{2 i e} + c d\right ) e^{- 6 i e}}{8 a^{3}} + \frac {x \left (3 c^{2} e^{4 i e} + 3 c^{2} e^{2 i e} + c^{2}\right ) e^{- 6 i e}}{8 a^{3}} & \text {otherwise} \end {cases} + \frac {c^{2} x}{8 a^{3}} + \frac {c d x^{2}}{8 a^{3}} + \frac {d^{2} x^{3}}{24 a^{3}} \] Input:

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

Output:

Piecewise((((147456*I*a**6*c**2*f**8*exp(6*I*e) + 294912*I*a**6*c*d*f**8*x 
*exp(6*I*e) + 49152*a**6*c*d*f**7*exp(6*I*e) + 147456*I*a**6*d**2*f**8*x** 
2*exp(6*I*e) + 49152*a**6*d**2*f**7*x*exp(6*I*e) - 8192*I*a**6*d**2*f**6*e 
xp(6*I*e))*exp(-6*I*f*x) + (663552*I*a**6*c**2*f**8*exp(8*I*e) + 1327104*I 
*a**6*c*d*f**8*x*exp(8*I*e) + 331776*a**6*c*d*f**7*exp(8*I*e) + 663552*I*a 
**6*d**2*f**8*x**2*exp(8*I*e) + 331776*a**6*d**2*f**7*x*exp(8*I*e) - 82944 
*I*a**6*d**2*f**6*exp(8*I*e))*exp(-4*I*f*x) + (1327104*I*a**6*c**2*f**8*ex 
p(10*I*e) + 2654208*I*a**6*c*d*f**8*x*exp(10*I*e) + 1327104*a**6*c*d*f**7* 
exp(10*I*e) + 1327104*I*a**6*d**2*f**8*x**2*exp(10*I*e) + 1327104*a**6*d** 
2*f**7*x*exp(10*I*e) - 663552*I*a**6*d**2*f**6*exp(10*I*e))*exp(-2*I*f*x)) 
*exp(-12*I*e)/(7077888*a**9*f**9), Ne(a**9*f**9*exp(12*I*e), 0)), (x**3*(3 
*d**2*exp(4*I*e) + 3*d**2*exp(2*I*e) + d**2)*exp(-6*I*e)/(24*a**3) + x**2* 
(3*c*d*exp(4*I*e) + 3*c*d*exp(2*I*e) + c*d)*exp(-6*I*e)/(8*a**3) + x*(3*c* 
*2*exp(4*I*e) + 3*c**2*exp(2*I*e) + c**2)*exp(-6*I*e)/(8*a**3), True)) + c 
**2*x/(8*a**3) + c*d*x**2/(8*a**3) + d**2*x**3/(24*a**3)
 

Maxima [F(-2)]

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.07 \[ \int \frac {(c+d x)^2}{(a+i a \tan (e+f x))^3} \, dx=\frac {{\left (288 \, d^{2} f^{3} x^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 864 \, c d f^{3} x^{2} e^{\left (6 i \, f x + 6 i \, e\right )} + 864 \, c^{2} f^{3} x e^{\left (6 i \, f x + 6 i \, e\right )} + 1296 i \, d^{2} f^{2} x^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 648 i \, d^{2} f^{2} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 144 i \, d^{2} f^{2} x^{2} + 2592 i \, c d f^{2} x e^{\left (4 i \, f x + 4 i \, e\right )} + 1296 i \, c d f^{2} x e^{\left (2 i \, f x + 2 i \, e\right )} + 288 i \, c d f^{2} x + 1296 i \, c^{2} f^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 1296 \, d^{2} f x e^{\left (4 i \, f x + 4 i \, e\right )} + 648 i \, c^{2} f^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 324 \, d^{2} f x e^{\left (2 i \, f x + 2 i \, e\right )} + 144 i \, c^{2} f^{2} + 48 \, d^{2} f x + 1296 \, c d f e^{\left (4 i \, f x + 4 i \, e\right )} + 324 \, c d f e^{\left (2 i \, f x + 2 i \, e\right )} + 48 \, c d f - 648 i \, d^{2} e^{\left (4 i \, f x + 4 i \, e\right )} - 81 i \, d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 8 i \, d^{2}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6912 \, a^{3} f^{3}} \] Input:

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

Output:

1/6912*(288*d^2*f^3*x^3*e^(6*I*f*x + 6*I*e) + 864*c*d*f^3*x^2*e^(6*I*f*x + 
 6*I*e) + 864*c^2*f^3*x*e^(6*I*f*x + 6*I*e) + 1296*I*d^2*f^2*x^2*e^(4*I*f* 
x + 4*I*e) + 648*I*d^2*f^2*x^2*e^(2*I*f*x + 2*I*e) + 144*I*d^2*f^2*x^2 + 2 
592*I*c*d*f^2*x*e^(4*I*f*x + 4*I*e) + 1296*I*c*d*f^2*x*e^(2*I*f*x + 2*I*e) 
 + 288*I*c*d*f^2*x + 1296*I*c^2*f^2*e^(4*I*f*x + 4*I*e) + 1296*d^2*f*x*e^( 
4*I*f*x + 4*I*e) + 648*I*c^2*f^2*e^(2*I*f*x + 2*I*e) + 324*d^2*f*x*e^(2*I* 
f*x + 2*I*e) + 144*I*c^2*f^2 + 48*d^2*f*x + 1296*c*d*f*e^(4*I*f*x + 4*I*e) 
 + 324*c*d*f*e^(2*I*f*x + 2*I*e) + 48*c*d*f - 648*I*d^2*e^(4*I*f*x + 4*I*e 
) - 81*I*d^2*e^(2*I*f*x + 2*I*e) - 8*I*d^2)*e^(-6*I*f*x - 6*I*e)/(a^3*f^3)
 

Mupad [B] (verification not implemented)

Time = 8.96 (sec) , antiderivative size = 263, normalized size of antiderivative = 0.89 \[ \int \frac {(c+d x)^2}{(a+i a \tan (e+f x))^3} \, dx=\frac {c^2\,x}{8\,a^3}-{\mathrm {e}}^{-e\,2{}\mathrm {i}-f\,x\,2{}\mathrm {i}}\,\left (\frac {\left (-6\,c^2\,f^2+c\,d\,f\,6{}\mathrm {i}+3\,d^2\right )\,1{}\mathrm {i}}{32\,a^3\,f^3}-\frac {d^2\,x^2\,3{}\mathrm {i}}{16\,a^3\,f}+\frac {d\,x\,\left (-2\,c\,f+d\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{16\,a^3\,f^2}\right )-{\mathrm {e}}^{-e\,4{}\mathrm {i}-f\,x\,4{}\mathrm {i}}\,\left (\frac {\left (-24\,c^2\,f^2+c\,d\,f\,12{}\mathrm {i}+3\,d^2\right )\,1{}\mathrm {i}}{256\,a^3\,f^3}-\frac {d^2\,x^2\,3{}\mathrm {i}}{32\,a^3\,f}+\frac {d\,x\,\left (-4\,c\,f+d\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{64\,a^3\,f^2}\right )-{\mathrm {e}}^{-e\,6{}\mathrm {i}-f\,x\,6{}\mathrm {i}}\,\left (\frac {\left (-18\,c^2\,f^2+c\,d\,f\,6{}\mathrm {i}+d^2\right )\,1{}\mathrm {i}}{864\,a^3\,f^3}-\frac {d^2\,x^2\,1{}\mathrm {i}}{48\,a^3\,f}+\frac {d\,x\,\left (-6\,c\,f+d\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{144\,a^3\,f^2}\right )+\frac {d^2\,x^3}{24\,a^3}+\frac {c\,d\,x^2}{8\,a^3} \] Input:

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

Output:

(c^2*x)/(8*a^3) - exp(- e*2i - f*x*2i)*(((3*d^2 - 6*c^2*f^2 + c*d*f*6i)*1i 
)/(32*a^3*f^3) - (d^2*x^2*3i)/(16*a^3*f) + (d*x*(d*1i - 2*c*f)*3i)/(16*a^3 
*f^2)) - exp(- e*4i - f*x*4i)*(((3*d^2 - 24*c^2*f^2 + c*d*f*12i)*1i)/(256* 
a^3*f^3) - (d^2*x^2*3i)/(32*a^3*f) + (d*x*(d*1i - 4*c*f)*3i)/(64*a^3*f^2)) 
 - exp(- e*6i - f*x*6i)*(((d^2 - 18*c^2*f^2 + c*d*f*6i)*1i)/(864*a^3*f^3) 
- (d^2*x^2*1i)/(48*a^3*f) + (d*x*(d*1i - 6*c*f)*1i)/(144*a^3*f^2)) + (d^2* 
x^3)/(24*a^3) + (c*d*x^2)/(8*a^3)
 

Reduce [F]

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

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

Output:

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