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.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 = {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 2637
Rule 4570
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.04, 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]
________________________________________________________________________________________
fricas [A] time = 2.47, size = 25, normalized size = 0.71 \[ \frac {m \cos \relax (x) \sin \left (m x\right ) - \cos \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 {\sin \left (m x + x\right )}{2 \, {\left (m + 1\right )}} + \frac {\sin \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.03, size = 28, normalized size = 0.80 \[ \frac {\sin \left (\left (-1+m \right ) x \right )}{-2+2 m}+\frac {\sin \left (\left (1+m \right ) x \right )}{2+2 m} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 28, normalized size = 0.80 \[ \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 )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.12, size = 39, normalized size = 1.11 \[ \left \{\begin {array}{cl} \frac {x}{2}+\frac {\sin \left (2\,x\right )}{4} & \text {\ if\ \ }m=-1\vee m=1\\ \frac {\sin \left (x\,\left (m-1\right )\right )}{2\,m-2}+\frac {\sin \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.94, size = 56, normalized size = 1.60 \[ \begin {cases} \frac {x \sin ^{2}{\relax (x )}}{2} + \frac {x \cos ^{2}{\relax (x )}}{2} + \frac {\sin {\relax (x )} \cos {\relax (x )}}{2} & \text {for}\: m = -1 \vee m = 1 \\\frac {m \sin {\left (m x \right )} \cos {\relax (x )}}{m^{2} - 1} - \frac {\sin {\relax (x )} \cos {\left (m x \right )}}{m^{2} - 1} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________