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.0302323, antiderivative size = 35, normalized size of antiderivative = 1., 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 4574
Rule 2638
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.0491642, 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]
________________________________________________________________________________________
Maple [A] time = 0.008, size = 28, normalized size = 0.8 \begin{align*} -{\frac{\cos \left ( \left ( m-1 \right ) x \right ) }{2\,m-2}}-{\frac{\cos \left ( \left ( 1+m \right ) x \right ) }{2+2\,m}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.977066, size = 36, normalized size = 1.03 \begin{align*} -\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 )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.52271, size = 68, normalized size = 1.94 \begin{align*} -\frac{m \cos \left (m x\right ) \cos \left (x\right ) + \sin \left (m x\right ) \sin \left (x\right )}{m^{2} - 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.24566, size = 44, normalized size = 1.26 \begin{align*} \begin{cases} \frac{\cos ^{2}{\left (x \right )}}{2} & \text{for}\: m = -1 \\- \frac{\cos ^{2}{\left (x \right )}}{2} & \text{for}\: m = 1 \\- \frac{m \cos{\left (x \right )} \cos{\left (m x \right )}}{m^{2} - 1} - \frac{\sin{\left (x \right )} \sin{\left (m x \right )}}{m^{2} - 1} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.10258, size = 39, normalized size = 1.11 \begin{align*} -\frac{\cos \left (m x + x\right )}{2 \,{\left (m + 1\right )}} - \frac{\cos \left (m x - x\right )}{2 \,{\left (m - 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]