3.2.41 \(\int \cot (a+b x) \cot (c+b x) \, dx\) [141]

3.2.41.1 Optimal result
3.2.41.2 Mathematica [A] (verified)
3.2.41.3 Rubi [A] (verified)
3.2.41.4 Maple [C] (verified)
3.2.41.5 Fricas [B] (verification not implemented)
3.2.41.6 Sympy [B] (verification not implemented)
3.2.41.7 Maxima [B] (verification not implemented)
3.2.41.8 Giac [B] (verification not implemented)
3.2.41.9 Mupad [B] (verification not implemented)

3.2.41.1 Optimal result

Integrand size = 13, antiderivative size = 39 \[ \int \cot (a+b x) \cot (c+b x) \, dx=-x-\frac {\cot (a-c) \log (\sin (a+b x))}{b}+\frac {\cot (a-c) \log (\sin (c+b x))}{b} \]

output
-x-cot(a-c)*ln(sin(b*x+a))/b+cot(a-c)*ln(sin(b*x+c))/b
 
3.2.41.2 Mathematica [A] (verified)

Time = 0.39 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.79 \[ \int \cot (a+b x) \cot (c+b x) \, dx=-x+\frac {\cot (a-c) (-\log (\sin (a+b x))+\log (\sin (c+b x)))}{b} \]

input
Integrate[Cot[a + b*x]*Cot[c + b*x],x]
 
output
-x + (Cot[a - c]*(-Log[Sin[a + b*x]] + Log[Sin[c + b*x]]))/b
 
3.2.41.3 Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.31, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5124, 5122, 3042, 25, 3956}

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 \cot (a+b x) \cot (b x+c) \, dx\)

\(\Big \downarrow \) 5124

\(\displaystyle \cos (a-c) \int \csc (a+b x) \csc (c+b x)dx-x\)

\(\Big \downarrow \) 5122

\(\displaystyle \cos (a-c) (\csc (a-c) \int \cot (c+b x)dx-\csc (a-c) \int \cot (a+b x)dx)-x\)

\(\Big \downarrow \) 3042

\(\displaystyle \cos (a-c) \left (\csc (a-c) \int -\tan \left (c+b x+\frac {\pi }{2}\right )dx-\csc (a-c) \int -\tan \left (a+b x+\frac {\pi }{2}\right )dx\right )-x\)

\(\Big \downarrow \) 25

\(\displaystyle \cos (a-c) \left (\csc (a-c) \int \tan \left (\frac {1}{2} (2 a+\pi )+b x\right )dx-\csc (a-c) \int \tan \left (\frac {1}{2} (2 c+\pi )+b x\right )dx\right )-x\)

\(\Big \downarrow \) 3956

\(\displaystyle \cos (a-c) \left (\frac {\csc (a-c) \log (-\sin (b x+c))}{b}-\frac {\csc (a-c) \log (-\sin (a+b x))}{b}\right )-x\)

input
Int[Cot[a + b*x]*Cot[c + b*x],x]
 
output
-x + Cos[a - c]*(-((Csc[a - c]*Log[-Sin[a + b*x]])/b) + (Csc[a - c]*Log[-S 
in[c + b*x]])/b)
 

3.2.41.3.1 Defintions of rubi rules used

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

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

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 5122
Int[Csc[(a_.) + (b_.)*(x_)]*Csc[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[Csc[( 
b*c - a*d)/b]   Int[Cot[a + b*x], x], x] - Simp[Csc[(b*c - a*d)/d]   Int[Co 
t[c + d*x], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && NeQ[b* 
c - a*d, 0]
 

rule 5124
Int[Cot[(a_.) + (b_.)*(x_)]*Cot[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[(-b)* 
(x/d), x] + Simp[Cos[(b*c - a*d)/d]   Int[Csc[a + b*x]*Csc[c + d*x], x], x] 
 /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && NeQ[b*c - a*d, 0]
 
3.2.41.4 Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.37 (sec) , antiderivative size = 177, normalized size of antiderivative = 4.54

method result size
risch \(-x -\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right ) {\mathrm e}^{2 i a}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}-\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right ) {\mathrm e}^{2 i c}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}+\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-{\mathrm e}^{2 i \left (a -c \right )}\right ) {\mathrm e}^{2 i a}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}+\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-{\mathrm e}^{2 i \left (a -c \right )}\right ) {\mathrm e}^{2 i c}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}\) \(177\)

input
int(cot(b*x+a)*cot(b*x+c),x,method=_RETURNVERBOSE)
 
output
-x-I/b/(exp(2*I*a)-exp(2*I*c))*ln(exp(2*I*(b*x+a))-1)*exp(2*I*a)-I/b/(exp( 
2*I*a)-exp(2*I*c))*ln(exp(2*I*(b*x+a))-1)*exp(2*I*c)+I/b/(exp(2*I*a)-exp(2 
*I*c))*ln(exp(2*I*(b*x+a))-exp(2*I*(a-c)))*exp(2*I*a)+I/b/(exp(2*I*a)-exp( 
2*I*c))*ln(exp(2*I*(b*x+a))-exp(2*I*(a-c)))*exp(2*I*c)
 
3.2.41.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 118 vs. \(2 (39) = 78\).

Time = 0.26 (sec) , antiderivative size = 118, normalized size of antiderivative = 3.03 \[ \int \cot (a+b x) \cot (c+b x) \, dx=-\frac {2 \, b x \sin \left (-2 \, a + 2 \, c\right ) - {\left (\cos \left (-2 \, a + 2 \, c\right ) + 1\right )} \log \left (-\frac {\cos \left (2 \, b x + 2 \, c\right ) \cos \left (-2 \, a + 2 \, c\right ) + \sin \left (2 \, b x + 2 \, c\right ) \sin \left (-2 \, a + 2 \, c\right ) - 1}{\cos \left (-2 \, a + 2 \, c\right ) + 1}\right ) + {\left (\cos \left (-2 \, a + 2 \, c\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (2 \, b x + 2 \, c\right ) + \frac {1}{2}\right )}{2 \, b \sin \left (-2 \, a + 2 \, c\right )} \]

input
integrate(cot(b*x+a)*cot(b*x+c),x, algorithm="fricas")
 
output
-1/2*(2*b*x*sin(-2*a + 2*c) - (cos(-2*a + 2*c) + 1)*log(-(cos(2*b*x + 2*c) 
*cos(-2*a + 2*c) + sin(2*b*x + 2*c)*sin(-2*a + 2*c) - 1)/(cos(-2*a + 2*c) 
+ 1)) + (cos(-2*a + 2*c) + 1)*log(-1/2*cos(2*b*x + 2*c) + 1/2))/(b*sin(-2* 
a + 2*c))
 
3.2.41.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1982 vs. \(2 (31) = 62\).

Time = 11.46 (sec) , antiderivative size = 7404, normalized size of antiderivative = 189.85 \[ \int \cot (a+b x) \cot (c+b x) \, dx=\text {Too large to display} \]

input
integrate(cot(b*x+a)*cot(b*x+c),x)
 
output
Piecewise((x/(zoo*cot(c) + zoo + cot(c)/tan(c) + zoo/tan(c)), Eq(b, 0) & E 
q(a, atan(tan(c)) + pi*floor((c - pi/2)/pi))), (-b*x*tan(c)**5/(b*tan(c)** 
5 + b*tan(c)**4*tan(b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan( 
c) + b*tan(b*x)) - b*x*tan(c)**4*tan(b*x)/(b*tan(c)**5 + b*tan(c)**4*tan(b 
*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan(c) + b*tan(b*x)) + b* 
x*tan(c)**3/(b*tan(c)**5 + b*tan(c)**4*tan(b*x) + 2*b*tan(c)**3 + 2*b*tan( 
c)**2*tan(b*x) + b*tan(c) + b*tan(b*x)) + b*x*tan(c)**2*tan(b*x)/(b*tan(c) 
**5 + b*tan(c)**4*tan(b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*ta 
n(c) + b*tan(b*x)) - 2*log(tan(c) + tan(b*x))*tan(c)**4/(b*tan(c)**5 + b*t 
an(c)**4*tan(b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan(c) + b* 
tan(b*x)) - 2*log(tan(c) + tan(b*x))*tan(c)**3*tan(b*x)/(b*tan(c)**5 + b*t 
an(c)**4*tan(b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan(c) + b* 
tan(b*x)) + log(tan(b*x)**2 + 1)*tan(c)**4/(b*tan(c)**5 + b*tan(c)**4*tan( 
b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan(c) + b*tan(b*x)) + l 
og(tan(b*x)**2 + 1)*tan(c)**3*tan(b*x)/(b*tan(c)**5 + b*tan(c)**4*tan(b*x) 
 + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan(c) + b*tan(b*x)) - tan(c 
)**6/(b*tan(c)**5 + b*tan(c)**4*tan(b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*t 
an(b*x) + b*tan(c) + b*tan(b*x)) - tan(c)**4/(b*tan(c)**5 + b*tan(c)**4*ta 
n(b*x) + 2*b*tan(c)**3 + 2*b*tan(c)**2*tan(b*x) + b*tan(c) + b*tan(b*x)), 
Eq(a, atan(tan(c)) + pi*floor((c - pi/2)/pi))), (x/(cot(a)*cot(c) + zoo...
 
3.2.41.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 549 vs. \(2 (39) = 78\).

Time = 0.25 (sec) , antiderivative size = 549, normalized size of antiderivative = 14.08 \[ \int \cot (a+b x) \cot (c+b x) \, dx=-\frac {{\left (2 \, b \cos \left (2 \, a\right ) \cos \left (2 \, c\right ) - b \cos \left (2 \, c\right )^{2} + 2 \, b \sin \left (2 \, a\right ) \sin \left (2 \, c\right ) - b \sin \left (2 \, c\right )^{2} - {\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2}\right )} b\right )} x + {\left (\cos \left (2 \, a\right )^{2} - \cos \left (2 \, c\right )^{2} + \sin \left (2 \, a\right )^{2} - \sin \left (2 \, c\right )^{2}\right )} \arctan \left (\sin \left (b x\right ) + \sin \left (a\right ), \cos \left (b x\right ) - \cos \left (a\right )\right ) + {\left (\cos \left (2 \, a\right )^{2} - \cos \left (2 \, c\right )^{2} + \sin \left (2 \, a\right )^{2} - \sin \left (2 \, c\right )^{2}\right )} \arctan \left (\sin \left (b x\right ) - \sin \left (a\right ), \cos \left (b x\right ) + \cos \left (a\right )\right ) - {\left (\cos \left (2 \, a\right )^{2} - \cos \left (2 \, c\right )^{2} + \sin \left (2 \, a\right )^{2} - \sin \left (2 \, c\right )^{2}\right )} \arctan \left (\sin \left (b x\right ) + \sin \left (c\right ), \cos \left (b x\right ) - \cos \left (c\right )\right ) - {\left (\cos \left (2 \, a\right )^{2} - \cos \left (2 \, c\right )^{2} + \sin \left (2 \, a\right )^{2} - \sin \left (2 \, c\right )^{2}\right )} \arctan \left (\sin \left (b x\right ) - \sin \left (c\right ), \cos \left (b x\right ) + \cos \left (c\right )\right ) - {\left (\cos \left (2 \, c\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \sin \left (2 \, c\right )\right )} \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) - {\left (\cos \left (2 \, c\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \sin \left (2 \, c\right )\right )} \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) + {\left (\cos \left (2 \, c\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \sin \left (2 \, c\right )\right )} \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (c\right ) + \cos \left (c\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right ) + {\left (\cos \left (2 \, c\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \sin \left (2 \, c\right )\right )} \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (c\right ) + \cos \left (c\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right )}{2 \, b \cos \left (2 \, a\right ) \cos \left (2 \, c\right ) - b \cos \left (2 \, c\right )^{2} + 2 \, b \sin \left (2 \, a\right ) \sin \left (2 \, c\right ) - b \sin \left (2 \, c\right )^{2} - {\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2}\right )} b} \]

input
integrate(cot(b*x+a)*cot(b*x+c),x, algorithm="maxima")
 
output
-((2*b*cos(2*a)*cos(2*c) - b*cos(2*c)^2 + 2*b*sin(2*a)*sin(2*c) - b*sin(2* 
c)^2 - (cos(2*a)^2 + sin(2*a)^2)*b)*x + (cos(2*a)^2 - cos(2*c)^2 + sin(2*a 
)^2 - sin(2*c)^2)*arctan2(sin(b*x) + sin(a), cos(b*x) - cos(a)) + (cos(2*a 
)^2 - cos(2*c)^2 + sin(2*a)^2 - sin(2*c)^2)*arctan2(sin(b*x) - sin(a), cos 
(b*x) + cos(a)) - (cos(2*a)^2 - cos(2*c)^2 + sin(2*a)^2 - sin(2*c)^2)*arct 
an2(sin(b*x) + sin(c), cos(b*x) - cos(c)) - (cos(2*a)^2 - cos(2*c)^2 + sin 
(2*a)^2 - sin(2*c)^2)*arctan2(sin(b*x) - sin(c), cos(b*x) + cos(c)) - (cos 
(2*c)*sin(2*a) - cos(2*a)*sin(2*c))*log(cos(b*x)^2 + 2*cos(b*x)*cos(a) + c 
os(a)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(a) + sin(a)^2) - (cos(2*c)*sin(2*a) 
- cos(2*a)*sin(2*c))*log(cos(b*x)^2 - 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b 
*x)^2 + 2*sin(b*x)*sin(a) + sin(a)^2) + (cos(2*c)*sin(2*a) - cos(2*a)*sin( 
2*c))*log(cos(b*x)^2 + 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 - 2*sin(b 
*x)*sin(c) + sin(c)^2) + (cos(2*c)*sin(2*a) - cos(2*a)*sin(2*c))*log(cos(b 
*x)^2 - 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(c) + si 
n(c)^2))/(2*b*cos(2*a)*cos(2*c) - b*cos(2*c)^2 + 2*b*sin(2*a)*sin(2*c) - b 
*sin(2*c)^2 - (cos(2*a)^2 + sin(2*a)^2)*b)
 
3.2.41.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 348 vs. \(2 (39) = 78\).

Time = 0.30 (sec) , antiderivative size = 348, normalized size of antiderivative = 8.92 \[ \int \cot (a+b x) \cot (c+b x) \, dx=-\frac {2 \, b x + \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right )^{4} + 4 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right ) - 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} - 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) + \tan \left (\frac {1}{2} \, c\right )^{2} - 1\right )} \log \left ({\left | \tan \left (b x\right ) \tan \left (\frac {1}{2} \, a\right )^{2} - \tan \left (b x\right ) - 2 \, \tan \left (\frac {1}{2} \, a\right ) \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{3} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) + \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right ) + \tan \left (\frac {1}{2} \, c\right )} - \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{4} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, c\right )^{4} + \tan \left (\frac {1}{2} \, a\right )^{2} - 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) + 2 \, \tan \left (\frac {1}{2} \, c\right )^{2} - 1\right )} \log \left ({\left | \tan \left (b x\right ) \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (b x\right ) - 2 \, \tan \left (\frac {1}{2} \, c\right ) \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{4} - \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) + 2 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, a\right ) + \tan \left (\frac {1}{2} \, c\right )}}{2 \, b} \]

input
integrate(cot(b*x+a)*cot(b*x+c),x, algorithm="giac")
 
output
-1/2*(2*b*x + (tan(1/2*a)^4*tan(1/2*c)^2 - tan(1/2*a)^4 + 4*tan(1/2*a)^3*t 
an(1/2*c) - 2*tan(1/2*a)^2*tan(1/2*c)^2 + 2*tan(1/2*a)^2 - 4*tan(1/2*a)*ta 
n(1/2*c) + tan(1/2*c)^2 - 1)*log(abs(tan(b*x)*tan(1/2*a)^2 - tan(b*x) - 2* 
tan(1/2*a)))/(tan(1/2*a)^4*tan(1/2*c) - tan(1/2*a)^3*tan(1/2*c)^2 + tan(1/ 
2*a)^3 - 2*tan(1/2*a)^2*tan(1/2*c) + tan(1/2*a)*tan(1/2*c)^2 - tan(1/2*a) 
+ tan(1/2*c)) - (tan(1/2*a)^2*tan(1/2*c)^4 - 2*tan(1/2*a)^2*tan(1/2*c)^2 + 
 4*tan(1/2*a)*tan(1/2*c)^3 - tan(1/2*c)^4 + tan(1/2*a)^2 - 4*tan(1/2*a)*ta 
n(1/2*c) + 2*tan(1/2*c)^2 - 1)*log(abs(tan(b*x)*tan(1/2*c)^2 - tan(b*x) - 
2*tan(1/2*c)))/(tan(1/2*a)^2*tan(1/2*c)^3 - tan(1/2*a)*tan(1/2*c)^4 - tan( 
1/2*a)^2*tan(1/2*c) + 2*tan(1/2*a)*tan(1/2*c)^2 - tan(1/2*c)^3 - tan(1/2*a 
) + tan(1/2*c)))/b
 
3.2.41.9 Mupad [B] (verification not implemented)

Time = 31.69 (sec) , antiderivative size = 207, normalized size of antiderivative = 5.31 \[ \int \cot (a+b x) \cot (c+b x) \, dx=-\frac {\frac {x}{2}+x\,\left ({\sin \left (a-c\right )}^2-\frac {1}{2}\right )}{{\sin \left (a-c\right )}^2}-\frac {\frac {\sin \left (2\,a-2\,c\right )\,\ln \left ({\sin \left (2\,a-2\,c\right )}^2\,2{}\mathrm {i}+{\sin \left (a+b\,x\right )}^2\,2{}\mathrm {i}-{\sin \left (3\,a-2\,c+b\,x\right )}^2\,2{}\mathrm {i}+\sin \left (4\,a-4\,c\right )-\sin \left (6\,a-4\,c+2\,b\,x\right )+\sin \left (2\,a+2\,b\,x\right )\right )}{2}-\frac {\sin \left (2\,a-2\,c\right )\,\ln \left ({\sin \left (2\,a-2\,c\right )}^2\,2{}\mathrm {i}+{\sin \left (c+b\,x\right )}^2\,2{}\mathrm {i}-{\sin \left (2\,a-c+b\,x\right )}^2\,2{}\mathrm {i}+\sin \left (4\,a-4\,c\right )-\sin \left (4\,a-2\,c+2\,b\,x\right )+\sin \left (2\,c+2\,b\,x\right )\right )}{2}}{b\,{\sin \left (a-c\right )}^2} \]

input
int(cot(a + b*x)*cot(c + b*x),x)
 
output
- (x/2 + x*(sin(a - c)^2 - 1/2))/sin(a - c)^2 - ((sin(2*a - 2*c)*log(sin(4 
*a - 4*c) - sin(6*a - 4*c + 2*b*x) + sin(2*a + 2*b*x) + sin(2*a - 2*c)^2*2 
i + sin(a + b*x)^2*2i - sin(3*a - 2*c + b*x)^2*2i))/2 - (sin(2*a - 2*c)*lo 
g(sin(4*a - 4*c) - sin(4*a - 2*c + 2*b*x) + sin(2*c + 2*b*x) + sin(2*a - 2 
*c)^2*2i + sin(c + b*x)^2*2i - sin(2*a - c + b*x)^2*2i))/2)/(b*sin(a - c)^ 
2)