Optimal. Leaf size=28 \[ -\tanh ^{-1}(\cos (x))-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {4486, 2727,
2746, 46, 213} \begin {gather*} -\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}-\tanh ^{-1}(\cos (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 213
Rule 2727
Rule 2746
Rule 4486
Rubi steps
\begin {align*} \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx &=\int \left (-\frac {3}{-1+\cos (x)}-\frac {2 \csc (x)}{-1+\cos (x)}\right ) \, dx\\ &=-\left (2 \int \frac {\csc (x)}{-1+\cos (x)} \, dx\right )-3 \int \frac {1}{-1+\cos (x)} \, dx\\ &=-\frac {3 \sin (x)}{1-\cos (x)}+2 \text {Subst}\left (\int \frac {1}{(-1-x) (-1+x)^2} \, dx,x,\cos (x)\right )\\ &=-\frac {3 \sin (x)}{1-\cos (x)}+2 \text {Subst}\left (\int \left (-\frac {1}{2 (-1+x)^2}+\frac {1}{2 \left (-1+x^2\right )}\right ) \, dx,x,\cos (x)\right )\\ &=-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}+\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\cos (x)\right )\\ &=-\tanh ^{-1}(\cos (x))-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 54, normalized size = 1.93 \begin {gather*} \frac {1}{2} \csc ^2\left (\frac {x}{2}\right ) \left (-1-\log \left (\cos \left (\frac {x}{2}\right )\right )+\cos (x) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )-3 \sin (x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 23, normalized size = 0.82
method | result | size |
default | \(-\frac {1}{2 \tan \left (\frac {x}{2}\right )^{2}}-\frac {3}{\tan \left (\frac {x}{2}\right )}+\ln \left (\tan \left (\frac {x}{2}\right )\right )\) | \(23\) |
risch | \(\frac {\left (\frac {1}{5}-\frac {3 i}{5}\right ) \left (10 \,{\mathrm e}^{i x}-9+3 i\right )}{\left ({\mathrm e}^{i x}-1\right )^{2}}-\ln \left (1+{\mathrm e}^{i x}\right )+\ln \left ({\mathrm e}^{i x}-1\right )\) | \(44\) |
norman | \(\frac {-\frac {1}{2}-\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-3 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )-3 \tan \left (\frac {x}{2}\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {x}{2}\right )^{2}}+\ln \left (\tan \left (\frac {x}{2}\right )\right )\) | \(48\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 3.47, size = 33, normalized size = 1.18 \begin {gather*} -\frac {{\left (\cos \left (x\right ) + 1\right )}^{2}}{2 \, \sin \left (x\right )^{2}} - \frac {3 \, {\left (\cos \left (x\right ) + 1\right )}}{\sin \left (x\right )} + \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.89, size = 39, normalized size = 1.39 \begin {gather*} -\frac {{\left (\cos \left (x\right ) - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right ) - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 6 \, \sin \left (x\right ) - 2}{2 \, {\left (\cos \left (x\right ) - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.30, size = 22, normalized size = 0.79 \begin {gather*} \log {\left (\tan {\left (\frac {x}{2} \right )} \right )} - \frac {3}{\tan {\left (\frac {x}{2} \right )}} - \frac {1}{2 \tan ^{2}{\left (\frac {x}{2} \right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.98, size = 31, normalized size = 1.11 \begin {gather*} -\frac {3 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 6 \, \tan \left (\frac {1}{2} \, x\right ) + 1}{2 \, \tan \left (\frac {1}{2} \, x\right )^{2}} + \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.28, size = 22, normalized size = 0.79 \begin {gather*} \ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-\frac {3\,\mathrm {tan}\left (\frac {x}{2}\right )+\frac {1}{2}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________