3.1.98 \(\int \cot ^2(x) \, dx\) [98]

Optimal. Leaf size=8 \[ -x-\cot (x) \]

[Out]

-x-cot(x)

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 8, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3554, 8} \begin {gather*} -x-\cot (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[x]^2,x]

[Out]

-x - Cot[x]

Rule 8

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

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \cot ^2(x) \, dx &=-\cot (x)-\int 1 \, dx\\ &=-x-\cot (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 8, normalized size = 1.00 \begin {gather*} -x-\cot (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]^2,x]

[Out]

-x - Cot[x]

________________________________________________________________________________________

Mathics [A]
time = 1.79, size = 10, normalized size = 1.25 \begin {gather*} -x-\frac {1}{\text {Tan}\left [x\right ]} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[Cot[x]^2,x]')

[Out]

-x - 1 / Tan[x]

________________________________________________________________________________________

Maple [A]
time = 0.00, size = 14, normalized size = 1.75

method result size
norman \(\frac {-1-x \tan \left (x \right )}{\tan \left (x \right )}\) \(13\)
derivativedivides \(-\cot \left (x \right )+\frac {\pi }{2}-\mathrm {arccot}\left (\cot \left (x \right )\right )\) \(14\)
default \(-\cot \left (x \right )+\frac {\pi }{2}-\mathrm {arccot}\left (\cot \left (x \right )\right )\) \(14\)
risch \(-x -\frac {2 i}{{\mathrm e}^{2 i x}-1}\) \(17\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)^2,x,method=_RETURNVERBOSE)

[Out]

-cot(x)+1/2*Pi-arccot(cot(x))

________________________________________________________________________________________

Maxima [A]
time = 0.35, size = 10, normalized size = 1.25 \begin {gather*} -x - \frac {1}{\tan \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2,x, algorithm="maxima")

[Out]

-x - 1/tan(x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 20 vs. \(2 (8) = 16\).
time = 0.34, size = 20, normalized size = 2.50 \begin {gather*} -\frac {x \sin \left (2 \, x\right ) + \cos \left (2 \, x\right ) + 1}{\sin \left (2 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2,x, algorithm="fricas")

[Out]

-(x*sin(2*x) + cos(2*x) + 1)/sin(2*x)

________________________________________________________________________________________

Sympy [A]
time = 0.03, size = 8, normalized size = 1.00 \begin {gather*} - x - \frac {\cos {\left (x \right )}}{\sin {\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)**2,x)

[Out]

-x - cos(x)/sin(x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 18 vs. \(2 (8) = 16\).
time = 0.00, size = 25, normalized size = 3.12 \begin {gather*} 2 \left (\frac {\tan \left (\frac {x}{2}\right )}{4}-\frac 1{4 \tan \left (\frac {x}{2}\right )}-\frac {x}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2,x)

[Out]

-x - 1/2/tan(1/2*x) + 1/2*tan(1/2*x)

________________________________________________________________________________________

Mupad [B]
time = 0.02, size = 8, normalized size = 1.00 \begin {gather*} -x-\mathrm {cot}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)^2,x)

[Out]

- x - cot(x)

________________________________________________________________________________________