Optimal. Leaf size=21 \[ -2 \sin (x)+\log \left (\frac {1}{2} (1-\cos (2 x))\right ) \sin (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {2717, 2634, 12}
\begin {gather*} \sin (x) \log \left (\frac {1}{2} (1-\cos (2 x))\right )-2 \sin (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2634
Rule 2717
Rubi steps
\begin {align*} \int \cos (x) \log \left (\frac {1}{2} (1-\cos (2 x))\right ) \, dx &=\log \left (\frac {1}{2} (1-\cos (2 x))\right ) \sin (x)-\int 2 \cos (x) \, dx\\ &=\log \left (\frac {1}{2} (1-\cos (2 x))\right ) \sin (x)-2 \int \cos (x) \, dx\\ &=-2 \sin (x)+\log \left (\frac {1}{2} (1-\cos (2 x))\right ) \sin (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.00, size = 13, normalized size = 0.62 \begin {gather*} -2 \sin (x)+\log \left (\sin ^2(x)\right ) \sin (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains complex when optimal does not.
time = 0.21, size = 112, normalized size = 5.33
method | result | size |
default | \(-\frac {i \left ({\mathrm e}^{i x} \ln \left (\left (-{\mathrm e}^{4 i x}+2 \,{\mathrm e}^{2 i x}-1\right ) {\mathrm e}^{-2 i x}\right )-2 \,{\mathrm e}^{i x}-{\mathrm e}^{-i x} \ln \left (\left (-{\mathrm e}^{4 i x}+2 \,{\mathrm e}^{2 i x}-1\right ) {\mathrm e}^{-2 i x}\right )+2 \,{\mathrm e}^{-i x}-2 \ln \left (2\right ) {\mathrm e}^{i x}+2 \,{\mathrm e}^{-i x} \ln \left (2\right )\right )}{2}\) | \(112\) |
risch | \(-\frac {{\mathrm e}^{-i x} \pi \,\mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 i x}\right ) \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )}{4}+\frac {{\mathrm e}^{i x} \pi \,\mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 i x}\right ) \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )}{4}-\frac {{\mathrm e}^{-i x} \pi \mathrm {csgn}\left (i {\mathrm e}^{i x}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 i x}\right )}{4}+\frac {{\mathrm e}^{i x} \pi \,\mathrm {csgn}\left (i {\mathrm e}^{-2 i x}\right ) \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{2}}{4}+\frac {{\mathrm e}^{i x} \pi \mathrm {csgn}\left (i {\mathrm e}^{i x}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 i x}\right )}{4}+\frac {{\mathrm e}^{i x} \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i x}-i\right ) \mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right )^{2}}{2}-\frac {{\mathrm e}^{i x} \pi \,\mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right ) \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{2}}{4}+\frac {{\mathrm e}^{i x} \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i x}-i\right )^{2} \mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right )}{4}+\frac {{\mathrm e}^{-i x} \pi \,\mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right ) \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{2}}{4}-\frac {{\mathrm e}^{-i x} \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i x}-i\right )^{2} \mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right )}{4}-\frac {{\mathrm e}^{-i x} \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i x}-i\right ) \mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right )^{2}}{2}+\frac {{\mathrm e}^{-i x} \pi \,\mathrm {csgn}\left (i {\mathrm e}^{i x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 i x}\right )^{2}}{2}-\frac {{\mathrm e}^{i x} \pi \,\mathrm {csgn}\left (i {\mathrm e}^{i x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 i x}\right )^{2}}{2}-\frac {{\mathrm e}^{-i x} \pi \,\mathrm {csgn}\left (i {\mathrm e}^{-2 i x}\right ) \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{2}}{4}+i {\mathrm e}^{i x}-i {\mathrm e}^{i x} \ln \left ({\mathrm e}^{2 i x}-1\right )+i {\mathrm e}^{i x} \ln \left (2\right )-\frac {{\mathrm e}^{-i x} \mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right )^{3} \pi }{4}+\frac {{\mathrm e}^{-i x} \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{2} \pi }{2}-\frac {{\mathrm e}^{i x} \pi \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{2}}{2}+\frac {{\mathrm e}^{i x} \pi \mathrm {csgn}\left (-i {\mathrm e}^{4 i x}+2 i {\mathrm e}^{2 i x}-i\right )^{3}}{4}+i {\mathrm e}^{-i x} \ln \left ({\mathrm e}^{2 i x}-1\right )-\frac {{\mathrm e}^{-i x} \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{3} \pi }{4}+\frac {{\mathrm e}^{i x} \pi \mathrm {csgn}\left (-2 i+2 i \cos \left (2 x \right )\right )^{3}}{4}-\frac {{\mathrm e}^{-i x} \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i x}\right )^{3}}{4}+\frac {{\mathrm e}^{i x} \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i x}\right )^{3}}{4}-i {\mathrm e}^{-i x} \ln \left (2\right )-\frac {{\mathrm e}^{-i x} \pi }{2}-2 \ln \left ({\mathrm e}^{i x}\right ) \sin \left (x \right )+\frac {{\mathrm e}^{i x} \pi }{2}-i {\mathrm e}^{-i x}\) | \(796\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 17, normalized size = 0.81 \begin {gather*} \log \left (-\frac {1}{2} \, \cos \left (2 \, x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - 2 \, \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 17, normalized size = 0.81 \begin {gather*} \log \left (-\cos \left (x\right )^{2} + 1\right ) \sin \left (x\right ) - 2 \, \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \log {\left (\frac {1}{2} - \frac {\cos {\left (2 x \right )}}{2} \right )} \cos {\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.63, size = 13, normalized size = 0.62 \begin {gather*} \log \left (\sin \left (x\right )^{2}\right ) \sin \left (x\right ) - 2 \, \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.05 \begin {gather*} \int \ln \left (\frac {1}{2}-\frac {\cos \left (2\,x\right )}{2}\right )\,\cos \left (x\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________