Integrand size = 10, antiderivative size = 21 \[ \int -\tan (a-x) \tan (x) \, dx=-x+\cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x)) \]
[Out]
Time = 0.04 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {4708, 4706, 3556} \[ \int -\tan (a-x) \tan (x) \, dx=\cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x))-x \]
[In]
[Out]
Rule 3556
Rule 4706
Rule 4708
Rubi steps \begin{align*} \text {integral}& = -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*}
Time = 0.09 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int -\tan (a-x) \tan (x) \, dx=-x+\cot (a) \log (\cos (a-x))-\cot (a) \log (\cos (x)) \]
[In]
[Out]
Time = 0.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95
method | result | size |
derivativedivides | \(\frac {\ln \left (1+\tan \left (a \right ) \tan \left (x \right )\right )}{\tan \left (a \right )}-\arctan \left (\tan \left (x \right )\right )\) | \(20\) |
default | \(\frac {\ln \left (1+\tan \left (a \right ) \tan \left (x \right )\right )}{\tan \left (a \right )}-\arctan \left (\tan \left (x \right )\right )\) | \(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 ({\mathrm e}^{2 i x}+1\right ) {\mathrm e}^{2 i a}}{{\mathrm e}^{2 i a}-1}-\frac {i \ln \left ({\mathrm e}^{2 i x}+1\right )}{{\mathrm e}^{2 i a}-1}\) | \(103\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (21) = 42\).
Time = 0.27 (sec) , antiderivative size = 89, normalized size of antiderivative = 4.24 \[ \int -\tan (a-x) \tan (x) \, dx=\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 )} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (19) = 38\).
Time = 0.56 (sec) , antiderivative size = 138, normalized size of antiderivative = 6.57 \[ \int -\tan (a-x) \tan (x) \, dx=- \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} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (21) = 42\).
Time = 0.30 (sec) , antiderivative size = 186, normalized size of antiderivative = 8.86 \[ \int -\tan (a-x) \tan (x) \, dx=-\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} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86 \[ \int -\tan (a-x) \tan (x) \, dx=-x + \frac {\log \left ({\left | \tan \left (a\right ) \tan \left (x\right ) + 1 \right |}\right )}{\tan \left (a\right )} \]
[In]
[Out]
Time = 1.43 (sec) , antiderivative size = 118, normalized size of antiderivative = 5.62 \[ \int -\tan (a-x) \tan (x) \, dx=-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 \left (x\right )}^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 \left (a\right )}^2-1\right )-{\sin \left (2\,a\right )}^2\,1{}\mathrm {i}+\sin \left (2\,a\right )\,\left (2\,{\sin \left (x\right )}^2-1\right )-\sin \left (2\,a\right )\,\sin \left (2\,x\right )\,1{}\mathrm {i}\right )}{2}}{{\sin \left (a\right )}^2} \]
[In]
[Out]