Optimal. Leaf size=35 \[ \frac{\sin ((1-m) x)}{2 (1-m)}+\frac{\sin ((m+1) x)}{2 (m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0288736, 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 = {4570, 2637} \[ \frac{\sin ((1-m) x)}{2 (1-m)}+\frac{\sin ((m+1) x)}{2 (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4570
Rule 2637
Rubi steps
\begin{align*} \int \cos (x) \cos (m x) \, dx &=\int \left (\frac{1}{2} \cos ((1-m) x)+\frac{1}{2} \cos ((1+m) x)\right ) \, dx\\ &=\frac{1}{2} \int \cos ((1-m) x) \, dx+\frac{1}{2} \int \cos ((1+m) x) \, dx\\ &=\frac{\sin ((1-m) x)}{2 (1-m)}+\frac{\sin ((1+m) x)}{2 (1+m)}\\ \end{align*}
Mathematica [A] time = 0.0394965, size = 25, normalized size = 0.71 \[ \frac{m \cos (x) \sin (m x)-\sin (x) \cos (m x)}{m^2-1} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.012, size = 28, normalized size = 0.8 \begin{align*}{\frac{\sin \left ( \left ( m-1 \right ) x \right ) }{2\,m-2}}+{\frac{\sin \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 = 1.01591, size = 38, normalized size = 1.09 \begin{align*} \frac{\sin \left ({\left (m + 1\right )} x\right )}{2 \,{\left (m + 1\right )}} - \frac{\sin \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.42915, size = 66, normalized size = 1.89 \begin{align*} \frac{m \cos \left (x\right ) \sin \left (m x\right ) - \cos \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 = 4.91142, size = 56, normalized size = 1.6 \begin{align*} \begin{cases} \frac{x \sin ^{2}{\left (x \right )}}{2} + \frac{x \cos ^{2}{\left (x \right )}}{2} + \frac{\sin{\left (x \right )} \cos{\left (x \right )}}{2} & \text{for}\: m = -1 \vee m = 1 \\\frac{m \sin{\left (m x \right )} \cos{\left (x \right )}}{m^{2} - 1} - \frac{\sin{\left (x \right )} \cos{\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.11229, size = 39, normalized size = 1.11 \begin{align*} \frac{\sin \left (m x + x\right )}{2 \,{\left (m + 1\right )}} + \frac{\sin \left (m x - x\right )}{2 \,{\left (m - 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]