3.365 \(\int (\frac{1}{2}-3 \cot (x)) (3-2 \cot (x))^3 \, dx\)

Optimal. Leaf size=33 \[ -\frac{285 x}{2}+(3-2 \cot (x))^3+5 (3-2 \cot (x))^2-42 \cot (x)+4 \log (\sin (x)) \]

[Out]

(-285*x)/2 + 5*(3 - 2*Cot[x])^2 + (3 - 2*Cot[x])^3 - 42*Cot[x] + 4*Log[Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0624847, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.176, Rules used = {3528, 3525, 3475} \[ -\frac{285 x}{2}+(3-2 \cot (x))^3+5 (3-2 \cot (x))^2-42 \cot (x)+4 \log (\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[(1/2 - 3*Cot[x])*(3 - 2*Cot[x])^3,x]

[Out]

(-285*x)/2 + 5*(3 - 2*Cot[x])^2 + (3 - 2*Cot[x])^3 - 42*Cot[x] + 4*Log[Sin[x]]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 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 \left (\frac{1}{2}-3 \cot (x)\right ) (3-2 \cot (x))^3 \, dx &=(3-2 \cot (x))^3+\int \left (-\frac{9}{2}-10 \cot (x)\right ) (3-2 \cot (x))^2 \, dx\\ &=5 (3-2 \cot (x))^2+(3-2 \cot (x))^3+\int \left (-\frac{67}{2}-21 \cot (x)\right ) (3-2 \cot (x)) \, dx\\ &=-\frac{285 x}{2}+5 (3-2 \cot (x))^2+(3-2 \cot (x))^3-42 \cot (x)+4 \int \cot (x) \, dx\\ &=-\frac{285 x}{2}+5 (3-2 \cot (x))^2+(3-2 \cot (x))^3-42 \cot (x)+4 \log (\sin (x))\\ \end{align*}

Mathematica [A]  time = 0.023241, size = 29, normalized size = 0.88 \[ -\frac{285 x}{2}-148 \cot (x)+56 \csc ^2(x)+4 \log (\sin (x))-8 \cot (x) \csc ^2(x) \]

Antiderivative was successfully verified.

[In]

Integrate[(1/2 - 3*Cot[x])*(3 - 2*Cot[x])^3,x]

[Out]

(-285*x)/2 - 148*Cot[x] + 56*Csc[x]^2 - 8*Cot[x]*Csc[x]^2 + 4*Log[Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 33, normalized size = 1. \begin{align*} -8\, \left ( \cot \left ( x \right ) \right ) ^{3}+56\, \left ( \cot \left ( x \right ) \right ) ^{2}-156\,\cot \left ( x \right ) -2\,\ln \left ( \left ( \cot \left ( x \right ) \right ) ^{2}+1 \right ) +{\frac{285\,\pi }{4}}-{\frac{285\,x}{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/2-3*cot(x))*(3-2*cot(x))^3,x)

[Out]

-8*cot(x)^3+56*cot(x)^2-156*cot(x)-2*ln(cot(x)^2+1)+285/4*Pi-285/2*x

________________________________________________________________________________________

Maxima [A]  time = 1.41367, size = 49, normalized size = 1.48 \begin{align*} -\frac{285}{2} \, x - \frac{4 \,{\left (39 \, \tan \left (x\right )^{2} - 14 \, \tan \left (x\right ) + 2\right )}}{\tan \left (x\right )^{3}} - 2 \, \log \left (\tan \left (x\right )^{2} + 1\right ) + 4 \, \log \left (\tan \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1/2-3*cot(x))*(3-2*cot(x))^3,x, algorithm="maxima")

[Out]

-285/2*x - 4*(39*tan(x)^2 - 14*tan(x) + 2)/tan(x)^3 - 2*log(tan(x)^2 + 1) + 4*log(tan(x))

________________________________________________________________________________________

Fricas [B]  time = 2.1512, size = 220, normalized size = 6.67 \begin{align*} \frac{4 \,{\left (\cos \left (2 \, x\right ) - 1\right )} \log \left (-\frac{1}{2} \, \cos \left (2 \, x\right ) + \frac{1}{2}\right ) \sin \left (2 \, x\right ) - 296 \, \cos \left (2 \, x\right )^{2} -{\left (285 \, x \cos \left (2 \, x\right ) - 285 \, x + 224\right )} \sin \left (2 \, x\right ) + 32 \, \cos \left (2 \, x\right ) + 328}{2 \,{\left (\cos \left (2 \, x\right ) - 1\right )} \sin \left (2 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1/2-3*cot(x))*(3-2*cot(x))^3,x, algorithm="fricas")

[Out]

1/2*(4*(cos(2*x) - 1)*log(-1/2*cos(2*x) + 1/2)*sin(2*x) - 296*cos(2*x)^2 - (285*x*cos(2*x) - 285*x + 224)*sin(
2*x) + 32*cos(2*x) + 328)/((cos(2*x) - 1)*sin(2*x))

________________________________________________________________________________________

Sympy [A]  time = 0.612355, size = 39, normalized size = 1.18 \begin{align*} - \frac{285 x}{2} - 2 \log{\left (\tan ^{2}{\left (x \right )} + 1 \right )} + 4 \log{\left (\tan{\left (x \right )} \right )} - \frac{156}{\tan{\left (x \right )}} + \frac{56}{\tan ^{2}{\left (x \right )}} - \frac{8}{\tan ^{3}{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1/2-3*cot(x))*(3-2*cot(x))**3,x)

[Out]

-285*x/2 - 2*log(tan(x)**2 + 1) + 4*log(tan(x)) - 156/tan(x) + 56/tan(x)**2 - 8/tan(x)**3

________________________________________________________________________________________

Giac [B]  time = 1.14233, size = 101, normalized size = 3.06 \begin{align*} \tan \left (\frac{1}{2} \, x\right )^{3} + 14 \, \tan \left (\frac{1}{2} \, x\right )^{2} - \frac{285}{2} \, x - \frac{22 \, \tan \left (\frac{1}{2} \, x\right )^{3} + 225 \, \tan \left (\frac{1}{2} \, x\right )^{2} - 42 \, \tan \left (\frac{1}{2} \, x\right ) + 3}{3 \, \tan \left (\frac{1}{2} \, x\right )^{3}} - 4 \, \log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right ) + 4 \, \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right ) + 75 \, \tan \left (\frac{1}{2} \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1/2-3*cot(x))*(3-2*cot(x))^3,x, algorithm="giac")

[Out]

tan(1/2*x)^3 + 14*tan(1/2*x)^2 - 285/2*x - 1/3*(22*tan(1/2*x)^3 + 225*tan(1/2*x)^2 - 42*tan(1/2*x) + 3)/tan(1/
2*x)^3 - 4*log(tan(1/2*x)^2 + 1) + 4*log(abs(tan(1/2*x))) + 75*tan(1/2*x)