Optimal. Leaf size=18 \[ -\frac {1}{4} \cos (a+2 x)-\frac {1}{2} x \sin (a) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4670, 2718}
\begin {gather*} -\frac {1}{2} x \sin (a)-\frac {1}{4} \cos (a+2 x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 4670
Rubi steps
\begin {align*} \int \cos (a+x) \sin (x) \, dx &=\int \left (-\frac {\sin (a)}{2}+\frac {1}{2} \sin (a+2 x)\right ) \, dx\\ &=-\frac {1}{2} x \sin (a)+\frac {1}{2} \int \sin (a+2 x) \, dx\\ &=-\frac {1}{4} \cos (a+2 x)-\frac {1}{2} x \sin (a)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 18, normalized size = 1.00 \begin {gather*} \frac {1}{4} (-\cos (a+2 x)-2 x \sin (a)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 15, normalized size = 0.83
method | result | size |
default | \(-\frac {\cos \left (a +2 x \right )}{4}-\frac {x \sin \left (a \right )}{2}\) | \(15\) |
risch | \(-\frac {\cos \left (a +2 x \right )}{4}-\frac {x \sin \left (a \right )}{2}\) | \(15\) |
meijerg | \(\frac {\cos \left (a \right ) \sqrt {\pi }\, \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (2 x \right )}{\sqrt {\pi }}\right )}{4}-\frac {\sin \left (a \right ) \sqrt {\pi }\, \left (\frac {2 x}{\sqrt {\pi }}-\frac {\sin \left (2 x \right )}{\sqrt {\pi }}\right )}{4}\) | \(45\) |
norman | \(\frac {x \tan \left (\frac {x}{2}\right )+x \left (\tan ^{2}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {a}{2}+\frac {x}{2}\right )+2 \tan \left (\frac {x}{2}\right ) \tan \left (\frac {a}{2}+\frac {x}{2}\right )-x \tan \left (\frac {a}{2}+\frac {x}{2}\right )-x \tan \left (\frac {x}{2}\right ) \left (\tan ^{2}\left (\frac {a}{2}+\frac {x}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {a}{2}+\frac {x}{2}\right )\right ) \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )}\) | \(91\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.22, size = 14, normalized size = 0.78 \begin {gather*} -\frac {1}{2} \, x \sin \left (a\right ) - \frac {1}{4} \, \cos \left (a + 2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.99, size = 28, normalized size = 1.56 \begin {gather*} -\frac {1}{2} \, \cos \left (a + x\right )^{2} \cos \left (a\right ) - \frac {1}{2} \, \cos \left (a + x\right ) \sin \left (a + x\right ) \sin \left (a\right ) - \frac {1}{2} \, x \sin \left (a\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 32 vs.
\(2 (15) = 30\).
time = 0.13, size = 32, normalized size = 1.78 \begin {gather*} \frac {x \sin {\left (x \right )} \cos {\left (a + x \right )}}{2} - \frac {x \sin {\left (a + x \right )} \cos {\left (x \right )}}{2} - \frac {\cos {\left (x \right )} \cos {\left (a + x \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 14, normalized size = 0.78 \begin {gather*} -\frac {1}{2} \, x \sin \left (a\right ) - \frac {1}{4} \, \cos \left (a + 2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.02, size = 14, normalized size = 0.78 \begin {gather*} -\frac {\cos \left (a+2\,x\right )}{4}-\frac {x\,\sin \left (a\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________