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

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 = 189 \[ \int \frac {(c+d x)^3}{a+i a \cot (e+f x)} \, dx=-\frac {3 i d^3 x}{8 a f^3}-\frac {3 d (c+d x)^2}{8 a f^2}+\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \cot (e+f x))}+\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \cot (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \cot (e+f x))}-\frac {i (c+d x)^3}{2 f (a+i a \cot (e+f x))} \] Output:

-3/8*I*d^3*x/a/f^3-3/8*d*(d*x+c)^2/a/f^2+1/4*I*(d*x+c)^3/a/f+1/8*(d*x+c)^4 
/a/d-3/8*d^3/f^4/(a+I*a*cot(f*x+e))+3/4*I*d^2*(d*x+c)/f^3/(a+I*a*cot(f*x+e 
))+3/4*d*(d*x+c)^2/f^2/(a+I*a*cot(f*x+e))-1/2*I*(d*x+c)^3/f/(a+I*a*cot(f*x 
+e))
 

Mathematica [A] (verified)

Time = 0.55 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.30 \[ \int \frac {(c+d x)^3}{a+i a \cot (e+f x)} \, dx=\frac {2 f^4 x \left (4 c^3+6 c^2 d x+4 c d^2 x^2+d^3 x^3\right )+i \left (4 c^3 f^3+6 c^2 d f^2 (i+2 f x)+6 c d^2 f \left (-1+2 i f x+2 f^2 x^2\right )+d^3 \left (-3 i-6 f x+6 i f^2 x^2+4 f^3 x^3\right )\right ) \cos (2 f x) (\cos (2 e)+i \sin (2 e))-\left (4 c^3 f^3+6 c^2 d f^2 (i+2 f x)+6 c d^2 f \left (-1+2 i f x+2 f^2 x^2\right )+d^3 \left (-3 i-6 f x+6 i f^2 x^2+4 f^3 x^3\right )\right ) (\cos (2 e)+i \sin (2 e)) \sin (2 f x)}{16 a f^4} \] Input:

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

Output:

(2*f^4*x*(4*c^3 + 6*c^2*d*x + 4*c*d^2*x^2 + d^3*x^3) + I*(4*c^3*f^3 + 6*c^ 
2*d*f^2*(I + 2*f*x) + 6*c*d^2*f*(-1 + (2*I)*f*x + 2*f^2*x^2) + d^3*(-3*I - 
 6*f*x + (6*I)*f^2*x^2 + 4*f^3*x^3))*Cos[2*f*x]*(Cos[2*e] + I*Sin[2*e]) - 
(4*c^3*f^3 + 6*c^2*d*f^2*(I + 2*f*x) + 6*c*d^2*f*(-1 + (2*I)*f*x + 2*f^2*x 
^2) + d^3*(-3*I - 6*f*x + (6*I)*f^2*x^2 + 4*f^3*x^3))*(Cos[2*e] + I*Sin[2* 
e])*Sin[2*f*x])/(16*a*f^4)
 

Rubi [A] (verified)

Time = 0.70 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.09, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {3042, 4206, 3042, 4206, 3042, 4206, 3042, 3960, 24}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4206

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4206

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4206

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3960

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

\(\Big \downarrow \) 24

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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

rule 3960
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + 
b*Tan[c + d*x])^n/(2*b*d*n)), x] + Simp[1/(2*a)   Int[(a + b*Tan[c + d*x])^ 
(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n, 0]
 

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

Time = 0.88 (sec) , antiderivative size = 170, normalized size of antiderivative = 0.90

method result size
risch \(\frac {d^{3} x^{4}}{8 a}+\frac {d^{2} c \,x^{3}}{2 a}+\frac {3 d \,c^{2} x^{2}}{4 a}+\frac {c^{3} x}{2 a}+\frac {c^{4}}{8 a d}+\frac {i \left (4 d^{3} x^{3} f^{3}+12 c \,d^{2} f^{3} x^{2}+6 i d^{3} f^{2} x^{2}+12 c^{2} d \,f^{3} x +12 i c \,d^{2} f^{2} x +4 c^{3} f^{3}+6 i c^{2} d \,f^{2}-6 d^{3} f x -6 c \,d^{2} f -3 i d^{3}\right ) {\mathrm e}^{2 i \left (f x +e \right )}}{16 f^{4} a}\) \(170\)
parallelrisch \(\frac {-6 \left (\left (-\frac {1}{6} d^{3} x^{3}-\frac {2}{3} c \,d^{2} x^{2}-c^{2} d x -\frac {2}{3} c^{3}\right ) f^{3}+i d \left (\frac {1}{3} d^{2} x^{2}+c d x +c^{2}\right ) f^{2}+\left (-\frac {1}{2} d^{3} x -c \,d^{2}\right ) f -\frac {i d^{3}}{2}\right ) f x \tan \left (f x +e \right )+4 i \left (\frac {d x}{2}+c \right ) \left (\frac {1}{2} d^{2} x^{2}+c d x +c^{2}\right ) x \,f^{4}+\left (-2 d^{3} x^{3}-6 c \,d^{2} x^{2}-6 c^{2} d x -4 c^{3}\right ) f^{3}-6 i d \left (\frac {1}{2} d^{2} x^{2}+c d x +c^{2}\right ) f^{2}+\left (3 d^{3} x +6 c \,d^{2}\right ) f +3 i d^{3}}{8 f^{4} a \left (i+\tan \left (f x +e \right )\right )}\) \(217\)

Input:

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

Output:

1/8/a*d^3*x^4+1/2/a*d^2*c*x^3+3/4/a*d*c^2*x^2+1/2/a*c^3*x+1/8/a/d*c^4+1/16 
*I*(4*d^3*x^3*f^3+6*I*d^3*f^2*x^2+12*c*d^2*f^3*x^2+12*I*c*d^2*f^2*x+12*c^2 
*d*f^3*x+6*I*c^2*d*f^2+4*c^3*f^3-6*d^3*f*x-3*I*d^3-6*c*d^2*f)/f^4/a*exp(2* 
I*(f*x+e))
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.81 \[ \int \frac {(c+d x)^3}{a+i a \cot (e+f x)} \, dx=\frac {2 \, d^{3} f^{4} x^{4} + 8 \, c d^{2} f^{4} x^{3} + 12 \, c^{2} d f^{4} x^{2} + 8 \, c^{3} f^{4} x + {\left (4 i \, d^{3} f^{3} x^{3} + 4 i \, c^{3} f^{3} - 6 \, c^{2} d f^{2} - 6 i \, c d^{2} f + 3 \, d^{3} - 6 \, {\left (-2 i \, c d^{2} f^{3} + d^{3} f^{2}\right )} x^{2} - 6 \, {\left (-2 i \, c^{2} d f^{3} + 2 \, c d^{2} f^{2} + i \, d^{3} f\right )} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}}{16 \, a f^{4}} \] Input:

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

Output:

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

Sympy [A] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.66 \[ \int \frac {(c+d x)^3}{a+i a \cot (e+f x)} \, dx=\begin {cases} \frac {\left (4 i c^{3} f^{3} e^{2 i e} + 12 i c^{2} d f^{3} x e^{2 i e} - 6 c^{2} d f^{2} e^{2 i e} + 12 i c d^{2} f^{3} x^{2} e^{2 i e} - 12 c d^{2} f^{2} x e^{2 i e} - 6 i c d^{2} f e^{2 i e} + 4 i d^{3} f^{3} x^{3} e^{2 i e} - 6 d^{3} f^{2} x^{2} e^{2 i e} - 6 i d^{3} f x e^{2 i e} + 3 d^{3} e^{2 i e}\right ) e^{2 i f x}}{16 a f^{4}} & \text {for}\: a f^{4} \neq 0 \\- \frac {c^{3} x e^{2 i e}}{2 a} - \frac {3 c^{2} d x^{2} e^{2 i e}}{4 a} - \frac {c d^{2} x^{3} e^{2 i e}}{2 a} - \frac {d^{3} x^{4} e^{2 i e}}{8 a} & \text {otherwise} \end {cases} + \frac {c^{3} x}{2 a} + \frac {3 c^{2} d x^{2}}{4 a} + \frac {c d^{2} x^{3}}{2 a} + \frac {d^{3} x^{4}}{8 a} \] Input:

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

Output:

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

Maxima [F(-2)]

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 233, normalized size of antiderivative = 1.23 \[ \int \frac {(c+d x)^3}{a+i a \cot (e+f x)} \, dx=\frac {2 \, d^{3} f^{4} x^{4} + 8 \, c d^{2} f^{4} x^{3} + 4 i \, d^{3} f^{3} x^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c^{2} d f^{4} x^{2} + 12 i \, c d^{2} f^{3} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 8 \, c^{3} f^{4} x + 12 i \, c^{2} d f^{3} x e^{\left (2 i \, f x + 2 i \, e\right )} - 6 \, d^{3} f^{2} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, c^{3} f^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 12 \, c d^{2} f^{2} x e^{\left (2 i \, f x + 2 i \, e\right )} - 6 \, c^{2} d f^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 6 i \, d^{3} f x e^{\left (2 i \, f x + 2 i \, e\right )} - 6 i \, c d^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + 3 \, d^{3} e^{\left (2 i \, f x + 2 i \, e\right )}}{16 \, a f^{4}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 11.00 (sec) , antiderivative size = 423, normalized size of antiderivative = 2.24 \[ \int \frac {(c+d x)^3}{a+i a \cot (e+f x)} \, dx=\frac {3\,d^3\,\cos \left (2\,e+2\,f\,x\right )+8\,c^3\,f^4\,x-4\,c^3\,f^3\,\sin \left (2\,e+2\,f\,x\right )+2\,d^3\,f^4\,x^4-6\,c^2\,d\,f^2\,\cos \left (2\,e+2\,f\,x\right )+12\,c^2\,d\,f^4\,x^2+8\,c\,d^2\,f^4\,x^3-6\,d^3\,f^2\,x^2\,\cos \left (2\,e+2\,f\,x\right )-4\,d^3\,f^3\,x^3\,\sin \left (2\,e+2\,f\,x\right )+6\,c\,d^2\,f\,\sin \left (2\,e+2\,f\,x\right )+6\,d^3\,f\,x\,\sin \left (2\,e+2\,f\,x\right )-12\,c\,d^2\,f^2\,x\,\cos \left (2\,e+2\,f\,x\right )-12\,c^2\,d\,f^3\,x\,\sin \left (2\,e+2\,f\,x\right )-12\,c\,d^2\,f^3\,x^2\,\sin \left (2\,e+2\,f\,x\right )+d^3\,\sin \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+c^3\,f^3\,\cos \left (2\,e+2\,f\,x\right )\,4{}\mathrm {i}-c^2\,d\,f^2\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+d^3\,f^3\,x^3\,\cos \left (2\,e+2\,f\,x\right )\,4{}\mathrm {i}-d^3\,f^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-c\,d^2\,f\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-d^3\,f\,x\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+c^2\,d\,f^3\,x\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}-c\,d^2\,f^2\,x\,\sin \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}+c\,d^2\,f^3\,x^2\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}}{16\,a\,f^4} \] Input:

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

Output:

(3*d^3*cos(2*e + 2*f*x) + d^3*sin(2*e + 2*f*x)*3i + 8*c^3*f^4*x + c^3*f^3* 
cos(2*e + 2*f*x)*4i - 4*c^3*f^3*sin(2*e + 2*f*x) + 2*d^3*f^4*x^4 - 6*c^2*d 
*f^2*cos(2*e + 2*f*x) - c^2*d*f^2*sin(2*e + 2*f*x)*6i + 12*c^2*d*f^4*x^2 + 
 8*c*d^2*f^4*x^3 - 6*d^3*f^2*x^2*cos(2*e + 2*f*x) + d^3*f^3*x^3*cos(2*e + 
2*f*x)*4i - d^3*f^2*x^2*sin(2*e + 2*f*x)*6i - 4*d^3*f^3*x^3*sin(2*e + 2*f* 
x) - c*d^2*f*cos(2*e + 2*f*x)*6i + 6*c*d^2*f*sin(2*e + 2*f*x) - d^3*f*x*co 
s(2*e + 2*f*x)*6i + 6*d^3*f*x*sin(2*e + 2*f*x) - 12*c*d^2*f^2*x*cos(2*e + 
2*f*x) + c^2*d*f^3*x*cos(2*e + 2*f*x)*12i - c*d^2*f^2*x*sin(2*e + 2*f*x)*1 
2i - 12*c^2*d*f^3*x*sin(2*e + 2*f*x) + c*d^2*f^3*x^2*cos(2*e + 2*f*x)*12i 
- 12*c*d^2*f^3*x^2*sin(2*e + 2*f*x))/(16*a*f^4)
 

Reduce [F]

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

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

Output:

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