\(\int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx\) [59]

Optimal result
Mathematica [B] (warning: unable to verify)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [B] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 18, antiderivative size = 213 \[ \int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx=-\frac {(c+d x)^2}{2 \left (a^2+b^2\right ) d}+\frac {(b d-2 a c f-2 a d f x)^2}{4 a (a-i b)^2 (a+i b) d f^2}+\frac {b (c+d x)}{\left (a^2+b^2\right ) f (a+b \cot (e+f x))}+\frac {b (b d-2 a c f-2 a d f x) \log \left (1-\frac {(a+i b) e^{2 i (e+f x)}}{a-i b}\right )}{\left (a^2+b^2\right )^2 f^2}+\frac {i a b d \operatorname {PolyLog}\left (2,\frac {(a+i b) e^{2 i (e+f x)}}{a-i b}\right )}{\left (a^2+b^2\right )^2 f^2} \] Output:

-1/2*(d*x+c)^2/(a^2+b^2)/d+1/4*(-2*a*d*f*x-2*a*c*f+b*d)^2/a/(a-I*b)^2/(a+I 
*b)/d/f^2+b*(d*x+c)/(a^2+b^2)/f/(a+b*cot(f*x+e))+b*(-2*a*d*f*x-2*a*c*f+b*d 
)*ln(1-(a+I*b)*exp(2*I*(f*x+e))/(a-I*b))/(a^2+b^2)^2/f^2+I*a*b*d*polylog(2 
,(a+I*b)*exp(2*I*(f*x+e))/(a-I*b))/(a^2+b^2)^2/f^2
 

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(454\) vs. \(2(213)=426\).

Time = 7.17 (sec) , antiderivative size = 454, normalized size of antiderivative = 2.13 \[ \int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx=\frac {\csc ^2(e+f x) (b \cos (e+f x)+a \sin (e+f x)) \left (2 b \left (a^2+b^2\right ) f (c+d x) \sin (e+f x)+\left (a^2+b^2\right ) (e+f x) (-2 c f+d (e-f x)) (b \cos (e+f x)+a \sin (e+f x))-2 b d (a (e+f x)-b \log (b \cos (e+f x)+a \sin (e+f x))) (b \cos (e+f x)+a \sin (e+f x))-4 a d e (a (e+f x)-b \log (b \cos (e+f x)+a \sin (e+f x))) (b \cos (e+f x)+a \sin (e+f x))+4 a c f (a (e+f x)-b \log (b \cos (e+f x)+a \sin (e+f x))) (b \cos (e+f x)+a \sin (e+f x))+2 a d \left (a \sqrt {1+\frac {b^2}{a^2}} e^{i \arctan \left (\frac {b}{a}\right )} (e+f x)^2+b \left (-i (e+f x) \left (\pi -2 \arctan \left (\frac {b}{a}\right )\right )-\pi \log \left (1+e^{-2 i (e+f x)}\right )-2 \left (e+f x+\arctan \left (\frac {b}{a}\right )\right ) \log \left (1-e^{2 i \left (e+f x+\arctan \left (\frac {b}{a}\right )\right )}\right )+\pi \log (\cos (e+f x))+2 \arctan \left (\frac {b}{a}\right ) \log \left (\sin \left (e+f x+\arctan \left (\frac {b}{a}\right )\right )\right )+i \operatorname {PolyLog}\left (2,e^{2 i \left (e+f x+\arctan \left (\frac {b}{a}\right )\right )}\right )\right )\right ) (b \cos (e+f x)+a \sin (e+f x))\right )}{2 \left (a^2+b^2\right )^2 f^2 (a+b \cot (e+f x))^2} \] Input:

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

Output:

(Csc[e + f*x]^2*(b*Cos[e + f*x] + a*Sin[e + f*x])*(2*b*(a^2 + b^2)*f*(c + 
d*x)*Sin[e + f*x] + (a^2 + b^2)*(e + f*x)*(-2*c*f + d*(e - f*x))*(b*Cos[e 
+ f*x] + a*Sin[e + f*x]) - 2*b*d*(a*(e + f*x) - b*Log[b*Cos[e + f*x] + a*S 
in[e + f*x]])*(b*Cos[e + f*x] + a*Sin[e + f*x]) - 4*a*d*e*(a*(e + f*x) - b 
*Log[b*Cos[e + f*x] + a*Sin[e + f*x]])*(b*Cos[e + f*x] + a*Sin[e + f*x]) + 
 4*a*c*f*(a*(e + f*x) - b*Log[b*Cos[e + f*x] + a*Sin[e + f*x]])*(b*Cos[e + 
 f*x] + a*Sin[e + f*x]) + 2*a*d*(a*Sqrt[1 + b^2/a^2]*E^(I*ArcTan[b/a])*(e 
+ f*x)^2 + b*((-I)*(e + f*x)*(Pi - 2*ArcTan[b/a]) - Pi*Log[1 + E^((-2*I)*( 
e + f*x))] - 2*(e + f*x + ArcTan[b/a])*Log[1 - E^((2*I)*(e + f*x + ArcTan[ 
b/a]))] + Pi*Log[Cos[e + f*x]] + 2*ArcTan[b/a]*Log[Sin[e + f*x + ArcTan[b/ 
a]]] + I*PolyLog[2, E^((2*I)*(e + f*x + ArcTan[b/a]))]))*(b*Cos[e + f*x] + 
 a*Sin[e + f*x])))/(2*(a^2 + b^2)^2*f^2*(a + b*Cot[e + f*x])^2)
 

Rubi [A] (verified)

Time = 0.79 (sec) , antiderivative size = 228, normalized size of antiderivative = 1.07, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 4216, 25, 3042, 4214, 25, 2620, 2715, 2838}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4216

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4214

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

\(\displaystyle -\frac {2 i b \left (\frac {a d \int e^{-2 i (e+f x)} \log \left (1-\frac {(a+i b) e^{2 i (e+f x)}}{a-i b}\right )de^{2 i (e+f x)}}{2 f \left (a^2+b^2\right )}+\frac {i (-2 a c f-2 a d f x+b d) \log \left (1-\frac {(a+i b) e^{2 i (e+f x)}}{a-i b}\right )}{2 f \left (a^2+b^2\right )}\right )-\frac {(-2 a c f-2 a d f x+b d)^2}{4 a d f (a-i b)}}{f \left (a^2+b^2\right )}+\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \cot (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 2838

\(\displaystyle -\frac {2 i b \left (\frac {i (-2 a c f-2 a d f x+b d) \log \left (1-\frac {(a+i b) e^{2 i (e+f x)}}{a-i b}\right )}{2 f \left (a^2+b^2\right )}-\frac {a d \operatorname {PolyLog}\left (2,\frac {(a+i b) e^{2 i (e+f x)}}{a-i b}\right )}{2 f \left (a^2+b^2\right )}\right )-\frac {(-2 a c f-2 a d f x+b d)^2}{4 a d f (a-i b)}}{f \left (a^2+b^2\right )}+\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \cot (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

Input:

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

Output:

-1/2*(c + d*x)^2/((a^2 + b^2)*d) + (b*(c + d*x))/((a^2 + b^2)*f*(a + b*Cot 
[e + f*x])) - (-1/4*(b*d - 2*a*c*f - 2*a*d*f*x)^2/(a*(a - I*b)*d*f) + (2*I 
)*b*(((I/2)*(b*d - 2*a*c*f - 2*a*d*f*x)*Log[1 - ((a + I*b)*E^((2*I)*(e + f 
*x)))/(a - I*b)])/((a^2 + b^2)*f) - (a*d*PolyLog[2, ((a + I*b)*E^((2*I)*(e 
 + f*x)))/(a - I*b)])/(2*(a^2 + b^2)*f)))/((a^2 + b^2)*f)
 

Defintions of rubi rules used

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

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

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

rule 4214
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + Pi*(k_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(d*(m + 1)*(a + I*b)), x] + Simp 
[2*I*b   Int[(c + d*x)^m*E^(2*I*k*Pi)*(E^Simp[2*I*(e + f*x), x]/((a + I*b)^ 
2 + (a^2 + b^2)*E^(2*I*k*Pi)*E^Simp[2*I*(e + f*x), x])), x], x] /; FreeQ[{a 
, b, c, d, e, f}, x] && IntegerQ[4*k] && NeQ[a^2 + b^2, 0] && IGtQ[m, 0]
 

rule 4216
Int[((c_.) + (d_.)*(x_))/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol 
] :> Simp[-(c + d*x)^2/(2*d*(a^2 + b^2)), x] + (Simp[1/(f*(a^2 + b^2))   In 
t[(b*d + 2*a*c*f + 2*a*d*f*x)/(a + b*Tan[e + f*x]), x], x] - Simp[b*((c + d 
*x)/(f*(a^2 + b^2)*(a + b*Tan[e + f*x]))), x]) /; FreeQ[{a, b, c, d, e, f}, 
 x] && 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. 1996 vs. \(2 (198 ) = 396\).

Time = 0.81 (sec) , antiderivative size = 1997, normalized size of antiderivative = 9.38

method result size
risch \(\text {Expression too large to display}\) \(1997\)

Input:

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

Output:

1/(b-I*a)^2/f^2/(I*a+b)*b/(a-I*b)*a*d*polylog(2,(a+I*b)*exp(2*I*(f*x+e))/( 
a-I*b))-2*I/(b-I*a)^2/f^2/(I*a+b)*b^2*d/(I*b-a)*ln(exp(I*(f*x+e)))+2/(b-I* 
a)^2/f^2/(I*a+b)*b/(a-I*b)*a*d*e^2-1/2/(b-I*a)^2/f^2/(I*a+b)*b^3*d/(I*b-a) 
/(a+I*b)*ln(a^2*exp(4*I*(f*x+e))+exp(4*I*(f*x+e))*b^2-2*a^2*exp(2*I*(f*x+e 
))+2*b^2*exp(2*I*(f*x+e))+a^2+b^2)+2/(b-I*a)^2/f^2/(I*a+b)*b*e*a^2*d/(I*b- 
a)/(a+I*b)*arctan(1/2/a*b*exp(2*I*(f*x+e))+1/2/a*b+1/2/b*a*exp(2*I*(f*x+e) 
)-1/2/b*a)+2/(b-I*a)^2/f^2/(I*a+b)*b*e*a^2*d/(a+I*b)/(I*b-a)*arctan(1/b*a) 
-1/(b-I*a)^2/f^2/(I*a+b)*b^2*e*a*d/(I*b-a)/(a+I*b)*ln(a^2*exp(4*I*(f*x+e)) 
+exp(4*I*(f*x+e))*b^2-2*a^2*exp(2*I*(f*x+e))+2*b^2*exp(2*I*(f*x+e))+a^2+b^ 
2)-I/(b-I*a)^2/f/(I*a+b)*b*a^2*c/(I*b-a)/(a+I*b)*ln(a^2*exp(4*I*(f*x+e))+e 
xp(4*I*(f*x+e))*b^2-2*a^2*exp(2*I*(f*x+e))+2*b^2*exp(2*I*(f*x+e))+a^2+b^2) 
+2*I/(b-I*a)^2/f^2/(I*a+b)*b/(a-I*b)*a*d*ln(1-(a+I*b)*exp(2*I*(f*x+e))/(a- 
I*b))*e-4*I/(b-I*a)^2/f^2/(I*a+b)*b*e*a*d/(I*b-a)*ln(exp(I*(f*x+e)))-2*I/( 
b-I*a)^2/f/(I*a+b)*b^2*a*c/(a+I*b)/(I*b-a)*arctan(1/b*a)+2*I/(b-I*a)^2/f/( 
I*a+b)*b/(a-I*b)*a*d*ln(1-(a+I*b)*exp(2*I*(f*x+e))/(a-I*b))*x+1/2*I/(b-I*a 
)^2/f^2/(I*a+b)*b^2*d/(I*b-a)/(a+I*b)*ln(a^2*exp(4*I*(f*x+e))+exp(4*I*(f*x 
+e))*b^2-2*a^2*exp(2*I*(f*x+e))+2*b^2*exp(2*I*(f*x+e))+a^2+b^2)*a-2*I/(b-I 
*a)^2/f/(I*a+b)*b^2*a*c/(I*b-a)/(a+I*b)*arctan(1/2/a*b*exp(2*I*(f*x+e))+1/ 
2/a*b+1/2/b*a*exp(2*I*(f*x+e))-1/2/b*a)+2/(b-I*a)^2/(I*a+b)*b/(a-I*b)*a*d* 
x^2+1/2/(2*I*a*b+a^2-b^2)*d*x^2+1/(2*I*a*b+a^2-b^2)*c*x+2*I*b^2*(d*x+c)...
 

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. 1053 vs. \(2 (193) = 386\).

Time = 0.12 (sec) , antiderivative size = 1053, normalized size of antiderivative = 4.94 \[ \int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx=\text {Too large to display} \] Input:

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

Output:

1/2*((a^2*b - b^3)*d*f^2*x^2 - 2*a*b^2*c*f - 2*(a*b^2*d*f - (a^2*b - b^3)* 
c*f^2)*x + ((a^2*b - b^3)*d*f^2*x^2 - 2*a*b^2*c*f - 2*(a*b^2*d*f - (a^2*b 
- b^3)*c*f^2)*x)*cos(2*f*x + 2*e) + (I*a*b^2*d*cos(2*f*x + 2*e) + I*a^2*b* 
d*sin(2*f*x + 2*e) + I*a*b^2*d)*dilog(-(a^2 + b^2 - (a^2 + 2*I*a*b - b^2)* 
cos(2*f*x + 2*e) + (-I*a^2 + 2*a*b + I*b^2)*sin(2*f*x + 2*e))/(a^2 + b^2) 
+ 1) + (-I*a*b^2*d*cos(2*f*x + 2*e) - I*a^2*b*d*sin(2*f*x + 2*e) - I*a*b^2 
*d)*dilog(-(a^2 + b^2 - (a^2 - 2*I*a*b - b^2)*cos(2*f*x + 2*e) + (I*a^2 + 
2*a*b - I*b^2)*sin(2*f*x + 2*e))/(a^2 + b^2) + 1) + (2*a*b^2*d*e - 2*a*b^2 
*c*f + b^3*d + (2*a*b^2*d*e - 2*a*b^2*c*f + b^3*d)*cos(2*f*x + 2*e) + (2*a 
^2*b*d*e - 2*a^2*b*c*f + a*b^2*d)*sin(2*f*x + 2*e))*log(1/2*a^2 + I*a*b - 
1/2*b^2 - 1/2*(a^2 + b^2)*cos(2*f*x + 2*e) + 1/2*(I*a^2 + I*b^2)*sin(2*f*x 
 + 2*e)) + (2*a*b^2*d*e - 2*a*b^2*c*f + b^3*d + (2*a*b^2*d*e - 2*a*b^2*c*f 
 + b^3*d)*cos(2*f*x + 2*e) + (2*a^2*b*d*e - 2*a^2*b*c*f + a*b^2*d)*sin(2*f 
*x + 2*e))*log(-1/2*a^2 + I*a*b + 1/2*b^2 + 1/2*(a^2 + b^2)*cos(2*f*x + 2* 
e) + 1/2*(I*a^2 + I*b^2)*sin(2*f*x + 2*e)) - 2*(a*b^2*d*f*x + a*b^2*d*e + 
(a*b^2*d*f*x + a*b^2*d*e)*cos(2*f*x + 2*e) + (a^2*b*d*f*x + a^2*b*d*e)*sin 
(2*f*x + 2*e))*log((a^2 + b^2 - (a^2 + 2*I*a*b - b^2)*cos(2*f*x + 2*e) + ( 
-I*a^2 + 2*a*b + I*b^2)*sin(2*f*x + 2*e))/(a^2 + b^2)) - 2*(a*b^2*d*f*x + 
a*b^2*d*e + (a*b^2*d*f*x + a*b^2*d*e)*cos(2*f*x + 2*e) + (a^2*b*d*f*x + a^ 
2*b*d*e)*sin(2*f*x + 2*e))*log((a^2 + b^2 - (a^2 - 2*I*a*b - b^2)*cos(2...
 

Sympy [F]

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

integrate((d*x+c)/(a+b*cot(f*x+e))**2,x)
 

Output:

Integral((c + d*x)/(a + b*cot(e + f*x))**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. 1171 vs. \(2 (193) = 386\).

Time = 0.44 (sec) , antiderivative size = 1171, normalized size of antiderivative = 5.50 \[ \int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx=\text {Too large to display} \] Input:

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

Output:

-1/2*((a^3 + I*a^2*b + a*b^2 + I*b^3)*d*f^2*x^2 + 2*(a^3 + I*a^2*b + a*b^2 
 + I*b^3)*c*f^2*x + 4*(I*a*b^2 + b^3)*c*f + 2*(2*(-I*a^2*b - a*b^2)*c*f + 
(I*a*b^2 + b^3)*d + (2*(I*a^2*b - a*b^2)*c*f + (-I*a*b^2 + b^3)*d)*cos(2*f 
*x + 2*e) - (2*(a^2*b + I*a*b^2)*c*f - (a*b^2 + I*b^3)*d)*sin(2*f*x + 2*e) 
)*arctan2(b*cos(2*f*x + 2*e) + a*sin(2*f*x + 2*e) + b, a*cos(2*f*x + 2*e) 
- b*sin(2*f*x + 2*e) - a) + 4*((I*a^2*b - a*b^2)*d*f*x*cos(2*f*x + 2*e) - 
(a^2*b + I*a*b^2)*d*f*x*sin(2*f*x + 2*e) + (-I*a^2*b - a*b^2)*d*f*x)*arcta 
n2(-(2*a*b*cos(2*f*x + 2*e) + (a^2 - b^2)*sin(2*f*x + 2*e))/(a^2 + b^2), ( 
2*a*b*sin(2*f*x + 2*e) + a^2 + b^2 - (a^2 - b^2)*cos(2*f*x + 2*e))/(a^2 + 
b^2)) - ((a^3 + 3*I*a^2*b - 3*a*b^2 - I*b^3)*d*f^2*x^2 + 2*((a^3 + 3*I*a^2 
*b - 3*a*b^2 - I*b^3)*c*f^2 - 2*(I*a*b^2 - b^3)*d*f)*x)*cos(2*f*x + 2*e) + 
 2*((-I*a^2*b + a*b^2)*d*cos(2*f*x + 2*e) + (a^2*b + I*a*b^2)*d*sin(2*f*x 
+ 2*e) + (I*a^2*b + a*b^2)*d)*dilog((I*a - b)*e^(2*I*f*x + 2*I*e)/(I*a + b 
)) - (2*(a^2*b - I*a*b^2)*c*f - (a*b^2 - I*b^3)*d - (2*(a^2*b + I*a*b^2)*c 
*f - (a*b^2 + I*b^3)*d)*cos(2*f*x + 2*e) - (2*(I*a^2*b - a*b^2)*c*f - (I*a 
*b^2 - b^3)*d)*sin(2*f*x + 2*e))*log((a^2 + b^2)*cos(2*f*x + 2*e)^2 + 4*a* 
b*sin(2*f*x + 2*e) + (a^2 + b^2)*sin(2*f*x + 2*e)^2 + a^2 + b^2 - 2*(a^2 - 
 b^2)*cos(2*f*x + 2*e)) + 2*((a^2*b + I*a*b^2)*d*f*x*cos(2*f*x + 2*e) + (I 
*a^2*b - a*b^2)*d*f*x*sin(2*f*x + 2*e) - (a^2*b - I*a*b^2)*d*f*x)*log(((a^ 
2 + b^2)*cos(2*f*x + 2*e)^2 + 4*a*b*sin(2*f*x + 2*e) + (a^2 + b^2)*sin(...
 

Giac [F]

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

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

Output:

integrate((d*x + c)/(b*cot(f*x + e) + a)^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx=\int \frac {c+d\,x}{{\left (a+b\,\mathrm {cot}\left (e+f\,x\right )\right )}^2} \,d x \] Input:

int((c + d*x)/(a + b*cot(e + f*x))^2,x)
 

Output:

int((c + d*x)/(a + b*cot(e + f*x))^2, x)
 

Reduce [F]

\[ \int \frac {c+d x}{(a+b \cot (e+f x))^2} \, dx=\text {too large to display} \] Input:

int((d*x+c)/(a+b*cot(f*x+e))^2,x)
 

Output:

( - 8*sqrt(a**2 + b**2)*atan((tan((e + f*x)/2)*b*i - a*i)/sqrt(a**2 + b**2 
))*cos(e + f*x)*a**4*b*d*i - 8*sqrt(a**2 + b**2)*atan((tan((e + f*x)/2)*b* 
i - a*i)/sqrt(a**2 + b**2))*cos(e + f*x)*a**2*b**3*d*i - 8*sqrt(a**2 + b** 
2)*atan((tan((e + f*x)/2)*b*i - a*i)/sqrt(a**2 + b**2))*sin(e + f*x)*a**5* 
d*i - 8*sqrt(a**2 + b**2)*atan((tan((e + f*x)/2)*b*i - a*i)/sqrt(a**2 + b* 
*2))*sin(e + f*x)*a**3*b**2*d*i + 16*cos(e + f*x)*int((tan((e + f*x)/2)*x) 
/(tan((e + f*x)/2)**4*b**2 - 4*tan((e + f*x)/2)**3*a*b + 4*tan((e + f*x)/2 
)**2*a**2 - 2*tan((e + f*x)/2)**2*b**2 + 4*tan((e + f*x)/2)*a*b + b**2),x) 
*a**6*b**2*d*f**2 + 32*cos(e + f*x)*int((tan((e + f*x)/2)*x)/(tan((e + f*x 
)/2)**4*b**2 - 4*tan((e + f*x)/2)**3*a*b + 4*tan((e + f*x)/2)**2*a**2 - 2* 
tan((e + f*x)/2)**2*b**2 + 4*tan((e + f*x)/2)*a*b + b**2),x)*a**4*b**4*d*f 
**2 + 16*cos(e + f*x)*int((tan((e + f*x)/2)*x)/(tan((e + f*x)/2)**4*b**2 - 
 4*tan((e + f*x)/2)**3*a*b + 4*tan((e + f*x)/2)**2*a**2 - 2*tan((e + f*x)/ 
2)**2*b**2 + 4*tan((e + f*x)/2)*a*b + b**2),x)*a**2*b**6*d*f**2 - 8*cos(e 
+ f*x)*int(x/(tan((e + f*x)/2)**4*b**2 - 4*tan((e + f*x)/2)**3*a*b + 4*tan 
((e + f*x)/2)**2*a**2 - 2*tan((e + f*x)/2)**2*b**2 + 4*tan((e + f*x)/2)*a* 
b + b**2),x)*a**7*b*d*f**2 - 16*cos(e + f*x)*int(x/(tan((e + f*x)/2)**4*b* 
*2 - 4*tan((e + f*x)/2)**3*a*b + 4*tan((e + f*x)/2)**2*a**2 - 2*tan((e + f 
*x)/2)**2*b**2 + 4*tan((e + f*x)/2)*a*b + b**2),x)*a**5*b**3*d*f**2 - 8*co 
s(e + f*x)*int(x/(tan((e + f*x)/2)**4*b**2 - 4*tan((e + f*x)/2)**3*a*b ...