Optimal. Leaf size=21 \[ \cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {4612, 4610, 3475} \[ \cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 4610
Rule 4612
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.08, size = 21, normalized size = 1.00 \[ \cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int -\tan (a-x) \tan (x) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.12, size = 89, normalized size = 4.24 \[ \frac {{\left (\cos \left (2 \, a\right ) + 1\right )} \log \left (-\frac {{\left (\cos \left (2 \, a\right ) - 1\right )} \tan \relax (x)^{2} - 2 \, \sin \left (2 \, a\right ) \tan \relax (x) - \cos \left (2 \, a\right ) - 1}{{\left (\cos \left (2 \, a\right ) + 1\right )} \tan \relax (x)^{2} + \cos \left (2 \, a\right ) + 1}\right ) - {\left (\cos \left (2 \, a\right ) + 1\right )} \log \left (\frac {1}{\tan \relax (x)^{2} + 1}\right ) - 2 \, x \sin \left (2 \, a\right )}{2 \, \sin \left (2 \, a\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.95, size = 18, normalized size = 0.86 \[ -x + \frac {\log \left ({\left | \tan \relax (a) \tan \relax (x) + 1 \right |}\right )}{\tan \relax (a)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 20, normalized size = 0.95
method | result | size |
derivativedivides | \(-\arctan \left (\tan \relax (x )\right )+\frac {\ln \left (1+\tan \relax (x ) \tan \relax (a )\right )}{\tan \relax (a )}\) | \(20\) |
default | \(-\arctan \left (\tan \relax (x )\right )+\frac {\ln \left (1+\tan \relax (x ) \tan \relax (a )\right )}{\tan \relax (a )}\) | \(20\) |
risch | \(-x +\frac {i \ln \left ({\mathrm e}^{2 i a}+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{2 i a}}{{\mathrm e}^{2 i a}-1}+\frac {i \ln \left ({\mathrm e}^{2 i a}+{\mathrm e}^{2 i x}\right )}{{\mathrm e}^{2 i a}-1}-\frac {i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{2 i a}}{{\mathrm e}^{2 i a}-1}-\frac {i \ln \left (1+{\mathrm e}^{2 i x}\right )}{{\mathrm e}^{2 i a}-1}\) | \(103\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.03, size = 186, normalized size = 8.86 \[ -\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} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.33, size = 118, normalized size = 5.62 \[ -x-\frac {\frac {\sin \left (2\,a\right )\,\ln \left ({\sin \left (2\,a+x\right )}^2\,2{}\mathrm {i}+{\sin \left (2\,a\right )}^2\,2{}\mathrm {i}-{\sin \relax (x)}^2\,2{}\mathrm {i}+\sin \left (4\,a\right )-\sin \left (2\,x\right )+\sin \left (4\,a+2\,x\right )\right )}{2}-\frac {\sin \left (2\,a\right )\,\ln \left (\sin \left (2\,a\right )\,\left (2\,{\sin \relax (a)}^2-1\right )-{\sin \left (2\,a\right )}^2\,1{}\mathrm {i}+\sin \left (2\,a\right )\,\left (2\,{\sin \relax (x)}^2-1\right )-\sin \left (2\,a\right )\,\sin \left (2\,x\right )\,1{}\mathrm {i}\right )}{2}}{{\sin \relax (a)}^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 1.54, size = 138, normalized size = 6.57 \[ - \left (\begin {cases} \frac {2 x \tan {\relax (a )}}{2 \tan ^{2}{\relax (a )} + 2} - \frac {2 \log {\left (\tan {\relax (x )} + \frac {1}{\tan {\relax (a )}} \right )}}{2 \tan ^{2}{\relax (a )} + 2} + \frac {\log {\left (\tan ^{2}{\relax (x )} + 1 \right )}}{2 \tan ^{2}{\relax (a )} + 2} & \text {for}\: a \neq 0 \\\frac {\log {\left (\tan ^{2}{\relax (x )} + 1 \right )}}{2} & \text {otherwise} \end {cases}\right ) \tan {\relax (a )} + \begin {cases} - \frac {2 x \tan {\relax (a )}}{2 \tan ^{3}{\relax (a )} + 2 \tan {\relax (a )}} + \frac {2 \log {\left (\tan {\relax (x )} + \frac {1}{\tan {\relax (a )}} \right )}}{2 \tan ^{3}{\relax (a )} + 2 \tan {\relax (a )}} + \frac {\log {\left (\tan ^{2}{\relax (x )} + 1 \right )} \tan ^{2}{\relax (a )}}{2 \tan ^{3}{\relax (a )} + 2 \tan {\relax (a )}} & \text {for}\: a \neq 0 \\- x + \tan {\relax (x )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________