3.142 \(\int \cot (c-b x) \cot (a+b x) \, dx\)

Optimal. Leaf size=34 \[ -\frac{\cot (a+c) \log (\sin (c-b x))}{b}+\frac{\cot (a+c) \log (\sin (a+b x))}{b}+x \]

[Out]

x - (Cot[a + c]*Log[Sin[c - b*x]])/b + (Cot[a + c]*Log[Sin[a + b*x]])/b

________________________________________________________________________________________

Rubi [A]  time = 0.034246, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {4613, 4611, 3475} \[ -\frac{\cot (a+c) \log (\sin (c-b x))}{b}+\frac{\cot (a+c) \log (\sin (a+b x))}{b}+x \]

Antiderivative was successfully verified.

[In]

Int[Cot[c - b*x]*Cot[a + b*x],x]

[Out]

x - (Cot[a + c]*Log[Sin[c - b*x]])/b + (Cot[a + c]*Log[Sin[a + b*x]])/b

Rule 4613

Int[Cot[(a_.) + (b_.)*(x_)]*Cot[(c_) + (d_.)*(x_)], x_Symbol] :> -Simp[(b*x)/d, x] + Dist[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]

Rule 4611

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

Rule 3475

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

Rubi steps

\begin{align*} \int \cot (c-b x) \cot (a+b x) \, dx &=x+\cos (a+c) \int \csc (c-b x) \csc (a+b x) \, dx\\ &=x+\cot (a+c) \int \cot (c-b x) \, dx+\cot (a+c) \int \cot (a+b x) \, dx\\ &=x-\frac{\cot (a+c) \log (\sin (c-b x))}{b}+\frac{\cot (a+c) \log (\sin (a+b x))}{b}\\ \end{align*}

Mathematica [A]  time = 0.488814, size = 30, normalized size = 0.88 \[ \frac{\cot (a+c) (\log (-\sin (a+b x))-\log (\sin (c-b x)))}{b}+x \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c - b*x]*Cot[a + b*x],x]

[Out]

x + (Cot[a + c]*(-Log[Sin[c - b*x]] + Log[-Sin[a + b*x]]))/b

________________________________________________________________________________________

Maple [C]  time = 0.08, size = 149, normalized size = 4.4 \begin{align*} x+{\frac{i\ln \left ({{\rm e}^{2\,i \left ( bx+a \right ) }}-1 \right ){{\rm e}^{2\,i \left ( a+c \right ) }}}{b \left ({{\rm e}^{2\,i \left ( a+c \right ) }}-1 \right ) }}+{\frac{i\ln \left ({{\rm e}^{2\,i \left ( bx+a \right ) }}-1 \right ) }{b \left ({{\rm e}^{2\,i \left ( a+c \right ) }}-1 \right ) }}-{\frac{i\ln \left ( -{{\rm e}^{2\,i \left ( a+c \right ) }}+{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ){{\rm e}^{2\,i \left ( a+c \right ) }}}{b \left ({{\rm e}^{2\,i \left ( a+c \right ) }}-1 \right ) }}-{\frac{i\ln \left ( -{{\rm e}^{2\,i \left ( a+c \right ) }}+{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) }{b \left ({{\rm e}^{2\,i \left ( a+c \right ) }}-1 \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-cot(b*x-c)*cot(b*x+a),x)

[Out]

x+I/b/(exp(2*I*(a+c))-1)*ln(exp(2*I*(b*x+a))-1)*exp(2*I*(a+c))+I/b/(exp(2*I*(a+c))-1)*ln(exp(2*I*(b*x+a))-1)-I
/b/(exp(2*I*(a+c))-1)*ln(-exp(2*I*(a+c))+exp(2*I*(b*x+a)))*exp(2*I*(a+c))-I/b/(exp(2*I*(a+c))-1)*ln(-exp(2*I*(
a+c))+exp(2*I*(b*x+a)))

________________________________________________________________________________________

Maxima [B]  time = 1.1565, size = 583, normalized size = 17.15 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-cot(b*x-c)*cot(b*x+a),x, algorithm="maxima")

[Out]

((b*cos(2*a + 2*c)^2 + b*sin(2*a + 2*c)^2 - 2*b*cos(2*a + 2*c) + b)*x - (cos(2*a + 2*c)^2 + sin(2*a + 2*c)^2 -
 1)*arctan2(sin(b*x) + sin(a), cos(b*x) - cos(a)) - (cos(2*a + 2*c)^2 + sin(2*a + 2*c)^2 - 1)*arctan2(sin(b*x)
 - sin(a), cos(b*x) + cos(a)) + (cos(2*a + 2*c)^2 + sin(2*a + 2*c)^2 - 1)*arctan2(sin(b*x) + sin(c), cos(b*x)
+ cos(c)) + (cos(2*a + 2*c)^2 + sin(2*a + 2*c)^2 - 1)*arctan2(sin(b*x) - sin(c), cos(b*x) - cos(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)*sin(2*a + 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)*sin(2*a + 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)*sin(2*a + 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)*sin(2*a + 2*c))/(b*cos(2*a + 2*c)
^2 + b*sin(2*a + 2*c)^2 - 2*b*cos(2*a + 2*c) + b)

________________________________________________________________________________________

Fricas [B]  time = 2.53066, size = 304, normalized size = 8.94 \begin{align*} \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 \, a\right ) \cos \left (2 \, a + 2 \, c\right ) + \sin \left (2 \, b x + 2 \, a\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 \, a\right ) + \frac{1}{2}\right )}{2 \, b \sin \left (2 \, a + 2 \, c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-cot(b*x-c)*cot(b*x+a),x, algorithm="fricas")

[Out]

1/2*(2*b*x*sin(2*a + 2*c) - (cos(2*a + 2*c) + 1)*log(-(cos(2*b*x + 2*a)*cos(2*a + 2*c) + sin(2*b*x + 2*a)*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*a) + 1/2))/(b*sin(2*a + 2*
c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-cot(b*x-c)*cot(b*x+a),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.20349, size = 466, normalized size = 13.71 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-cot(b*x-c)*cot(b*x+a),x, algorithm="giac")

[Out]

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*tan(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)*tan(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)*tan(1/2*c) + 2*tan(1/2*c)^2 - 1)*lo
g(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