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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

-x - (Cot[a - c]*Log[Sin[a + b*x]])/b + (Cot[a - c]*Log[Sin[c + 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 (a+b x) \cot (c+b x) \, dx &=-x+\cos (a-c) \int \csc (a+b x) \csc (c+b x) \, dx\\ &=-x-\cot (a-c) \int \cot (a+b x) \, dx+\cot (a-c) \int \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}\\ \end{align*}

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x+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(e
xp(2*I*(b*x+a))-exp(2*I*(a-c)))*exp(2*I*c)-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)

________________________________________________________________________________________

Maxima [B]  time = 1.16627, size = 741, normalized size = 19. \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+a)*cot(b*x+c),x, algorithm="maxima")

[Out]

-((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 - co
s(2*c)^2 + sin(2*a)^2 - sin(2*c)^2)*arctan2(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) + 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(a) + cos(a)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(a) + si
n(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) + sin(c)^2))/(2*b*cos(2*a)*cos(2*c) - b*cos(2*c)^2 + 2*b*sin(2*a)*si
n(2*c) - b*sin(2*c)^2 - (cos(2*a)^2 + sin(2*a)^2)*b)

________________________________________________________________________________________

Fricas [B]  time = 2.52468, size = 315, normalized size = 8.08 \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 \, 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 )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

________________________________________________________________________________________

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

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.2426, size = 470, normalized size = 12.05 \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+a)*cot(b*x+c),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)*l
og(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