3.1.41 \(\int x \csc ^2(x) \, dx\) [41]

Optimal. Leaf size=9 \[ -x \cot (x)+\log (\sin (x)) \]

[Out]

-x*cot(x)+ln(sin(x))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4269, 3556} \begin {gather*} \log (\sin (x))-x \cot (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*Csc[x]^2,x]

[Out]

-(x*Cot[x]) + Log[Sin[x]]

Rule 3556

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

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int x \csc ^2(x) \, dx &=-x \cot (x)+\int \cot (x) \, dx\\ &=-x \cot (x)+\log (\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 9, normalized size = 1.00 \begin {gather*} -x \cot (x)+\log (\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*Csc[x]^2,x]

[Out]

-(x*Cot[x]) + Log[Sin[x]]

________________________________________________________________________________________

Mathics [B] Leaf count is larger than twice the leaf count of optimal. \(43\) vs. \(2(9)=18\).
time = 2.26, size = 35, normalized size = 3.89 \begin {gather*} -\frac {x}{2 \text {Tan}\left [\frac {x}{2}\right ]}+\frac {x \text {Tan}\left [\frac {x}{2}\right ]}{2}+\text {Log}\left [\text {Tan}\left [\frac {x}{2}\right ]\right ]-\text {Log}\left [2\right ]-\text {Log}\left [\frac {1}{1+\text {Cos}\left [x\right ]}\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[x*Csc[x]^2,x]')

[Out]

-x / (2 Tan[x / 2]) + x Tan[x / 2] / 2 + Log[Tan[x / 2]] - Log[2] - Log[1 / (1 + Cos[x])]

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 10, normalized size = 1.11

method result size
default \(-x \cot \left (x \right )+\ln \left (\sin \left (x \right )\right )\) \(10\)
risch \(-2 i x -\frac {2 i x}{{\mathrm e}^{2 i x}-1}+\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(27\)
norman \(\frac {-\frac {x}{2}+\frac {x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}}{\tan \left (\frac {x}{2}\right )}-\ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )+\ln \left (\tan \left (\frac {x}{2}\right )\right )\) \(38\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*csc(x)^2,x,method=_RETURNVERBOSE)

[Out]

-x*cot(x)+ln(sin(x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 104 vs. \(2 (9) = 18\).
time = 0.26, size = 104, normalized size = 11.56 \begin {gather*} \frac {{\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) - 4 \, x \sin \left (2 \, x\right )}{2 \, {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)^2,x, algorithm="maxima")

[Out]

1/2*((cos(2*x)^2 + sin(2*x)^2 - 2*cos(2*x) + 1)*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + (cos(2*x)^2 + sin(2*
x)^2 - 2*cos(2*x) + 1)*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) - 4*x*sin(2*x))/(cos(2*x)^2 + sin(2*x)^2 - 2*co
s(2*x) + 1)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \csc ^{2}{\left (x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)**2,x)

[Out]

Integral(x*csc(x)**2, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 52 vs. \(2 (9) = 18\).
time = 0.02, size = 56, normalized size = 6.22 \begin {gather*} \frac {x \tan ^{2}\left (\frac {x}{2}\right )-x+\ln \left (\frac {16 \tan ^{2}\left (\frac {x}{2}\right )}{\tan ^{4}\left (\frac {x}{2}\right )+2 \tan ^{2}\left (\frac {x}{2}\right )+1}\right ) \tan \left (\frac {x}{2}\right )}{2 \tan \left (\frac {x}{2}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)^2,x)

[Out]

1/2*(x*tan(1/2*x)^2 + log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x) - x)/tan(1/2*x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x/sin(x)^2,x)

[Out]

log(sin(x)) - x*cot(x)

________________________________________________________________________________________