Optimal. Leaf size=21 \[ \cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.033836, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3, Rules used = {4612, 4610, 3475} \[ \cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4612
Rule 4610
Rule 3475
Rubi steps
\begin{align*} \int -\tan (a-x) \tan (x) \, dx &=-x+\cos (a) \int \sec (a-x) \sec (x) \, dx\\ &=-x+\cot (a) \int \tan (a-x) \, dx+\cot (a) \int \tan (x) \, dx\\ &=-x+\cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))\\ \end{align*}
Mathematica [A] time = 0.0772765, size = 21, normalized size = 1. \[ \cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.036, size = 18, normalized size = 0.9 \begin{align*}{\frac{\ln \left ( 1+\tan \left ( x \right ) \tan \left ( a \right ) \right ) }{\tan \left ( a \right ) }}-x \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.47707, size = 251, normalized size = 11.95 \begin{align*} -\frac{{\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2} - 2 \, \cos \left (2 \, a\right ) + 1\right )} x +{\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2} - 1\right )} \arctan \left (\sin \left (2 \, a\right ) + \sin \left (2 \, x\right ), \cos \left (2 \, a\right ) + \cos \left (2 \, x\right )\right ) -{\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2} - 1\right )} \arctan \left (\sin \left (2 \, x\right ), \cos \left (2 \, x\right ) + 1\right ) - \log \left (\cos \left (2 \, a\right )^{2} + 2 \, \cos \left (2 \, a\right ) \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + \sin \left (2 \, a\right )^{2} + 2 \, \sin \left (2 \, a\right ) \sin \left (2 \, x\right ) + \sin \left (2 \, x\right )^{2}\right ) \sin \left (2 \, a\right ) + \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) \sin \left (2 \, a\right )}{\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2} - 2 \, \cos \left (2 \, a\right ) + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.09668, size = 261, normalized size = 12.43 \begin{align*} \frac{{\left (\cos \left (2 \, a\right ) + 1\right )} \log \left (-\frac{{\left (\cos \left (2 \, a\right ) - 1\right )} \tan \left (x\right )^{2} - 2 \, \sin \left (2 \, a\right ) \tan \left (x\right ) - \cos \left (2 \, a\right ) - 1}{{\left (\cos \left (2 \, a\right ) + 1\right )} \tan \left (x\right )^{2} + \cos \left (2 \, a\right ) + 1}\right ) -{\left (\cos \left (2 \, a\right ) + 1\right )} \log \left (\frac{1}{\tan \left (x\right )^{2} + 1}\right ) - 2 \, x \sin \left (2 \, a\right )}{2 \, \sin \left (2 \, a\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 1.31194, size = 138, normalized size = 6.57 \begin{align*} - \left (\begin{cases} \frac{2 x \tan{\left (a \right )}}{2 \tan ^{2}{\left (a \right )} + 2} - \frac{2 \log{\left (\tan{\left (x \right )} + \frac{1}{\tan{\left (a \right )}} \right )}}{2 \tan ^{2}{\left (a \right )} + 2} + \frac{\log{\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{2 \tan ^{2}{\left (a \right )} + 2} & \text{for}\: a \neq 0 \\\frac{\log{\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{2} & \text{otherwise} \end{cases}\right ) \tan{\left (a \right )} + \begin{cases} - \frac{2 x \tan{\left (a \right )}}{2 \tan ^{3}{\left (a \right )} + 2 \tan{\left (a \right )}} + \frac{2 \log{\left (\tan{\left (x \right )} + \frac{1}{\tan{\left (a \right )}} \right )}}{2 \tan ^{3}{\left (a \right )} + 2 \tan{\left (a \right )}} + \frac{\log{\left (\tan ^{2}{\left (x \right )} + 1 \right )} \tan ^{2}{\left (a \right )}}{2 \tan ^{3}{\left (a \right )} + 2 \tan{\left (a \right )}} & \text{for}\: a \neq 0 \\- x + \tan{\left (x \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.0918, size = 24, normalized size = 1.14 \begin{align*} -x + \frac{\log \left ({\left | \tan \left (a\right ) \tan \left (x\right ) + 1 \right |}\right )}{\tan \left (a\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]