Optimal. Leaf size=35 \[ \frac {\cos ((1-m) x)}{2 (1-m)}-\frac {\cos ((m+1) x)}{2 (m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4574, 2638} \[ \frac {\cos ((1-m) x)}{2 (1-m)}-\frac {\cos ((m+1) x)}{2 (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2638
Rule 4574
Rubi steps
\begin {align*} \int \cos (x) \sin (m x) \, dx &=\int \left (-\frac {1}{2} \sin ((1-m) x)+\frac {1}{2} \sin ((1+m) x)\right ) \, dx\\ &=-\left (\frac {1}{2} \int \sin ((1-m) x) \, dx\right )+\frac {1}{2} \int \sin ((1+m) x) \, dx\\ &=\frac {\cos ((1-m) x)}{2 (1-m)}-\frac {\cos ((1+m) x)}{2 (1+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 26, normalized size = 0.74 \[ \frac {\sin (x) \sin (m x)+m \cos (x) \cos (m x)}{1-m^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.43, size = 25, normalized size = 0.71 \[ -\frac {m \cos \left (m x\right ) \cos \relax (x) + \sin \left (m x\right ) \sin \relax (x)}{m^{2} - 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 29, normalized size = 0.83 \[ -\frac {\cos \left (m x + x\right )}{2 \, {\left (m + 1\right )}} - \frac {\cos \left (m x - x\right )}{2 \, {\left (m - 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 28, normalized size = 0.80 \[ -\frac {\cos \left (\left (-1+m \right ) x \right )}{2 \left (-1+m \right )}-\frac {\cos \left (\left (1+m \right ) x \right )}{2 \left (1+m \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 27, normalized size = 0.77 \[ -\frac {\cos \left ({\left (m + 1\right )} x\right )}{2 \, {\left (m + 1\right )}} - \frac {\cos \left ({\left (m - 1\right )} x\right )}{2 \, {\left (m - 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.29, size = 57, normalized size = 1.63 \[ \left \{\begin {array}{cl} \frac {{\sin \relax (x)}^2}{2} & \text {\ if\ \ }m=1\\ \frac {{\cos \relax (x)}^2}{2} & \text {\ if\ \ }m=-1\\ -\frac {\cos \left (x\,\left (m-1\right )\right )}{2\,m-2}-\frac {\cos \left (x\,\left (m+1\right )\right )}{2\,m+2} & \text {\ if\ \ }m\neq -1\wedge m\neq 1 \end {array}\right . \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.78, size = 44, normalized size = 1.26 \[ \begin {cases} - \frac {\sin ^{2}{\relax (x )}}{2} & \text {for}\: m = -1 \\\frac {\sin ^{2}{\relax (x )}}{2} & \text {for}\: m = 1 \\- \frac {m \cos {\relax (x )} \cos {\left (m x \right )}}{m^{2} - 1} - \frac {\sin {\relax (x )} \sin {\left (m x \right )}}{m^{2} - 1} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________