Optimal. Leaf size=21 \[ \frac {1}{2} \log (\cos (x)+\sin (x))-\frac {1}{2 (1+\tan (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3564, 3611}
\begin {gather*} \frac {1}{2} \log (\sin (x)+\cos (x))-\frac {1}{2 (\tan (x)+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3564
Rule 3611
Rubi steps
\begin {align*} \int \frac {1}{(1+\tan (x))^2} \, dx &=-\frac {1}{2 (1+\tan (x))}+\frac {1}{2} \int \frac {1-\tan (x)}{1+\tan (x)} \, dx\\ &=\frac {1}{2} \log (\cos (x)+\sin (x))-\frac {1}{2 (1+\tan (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 27, normalized size = 1.29 \begin {gather*} \frac {\log (\cos (x)+\sin (x))+\tan (x)+\log (\cos (x)+\sin (x)) \tan (x)}{2+2 \tan (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.03, size = 26, normalized size = 1.24
method | result | size |
derivativedivides | \(-\frac {1}{2 \left (\tan \left (x \right )+1\right )}+\frac {\ln \left (\tan \left (x \right )+1\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{4}\) | \(26\) |
default | \(-\frac {1}{2 \left (\tan \left (x \right )+1\right )}+\frac {\ln \left (\tan \left (x \right )+1\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{4}\) | \(26\) |
norman | \(-\frac {1}{2 \left (\tan \left (x \right )+1\right )}+\frac {\ln \left (\tan \left (x \right )+1\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{4}\) | \(26\) |
risch | \(-\frac {i x}{2}-\frac {1}{2 \left ({\mathrm e}^{2 i x}+i\right )}+\frac {\ln \left ({\mathrm e}^{2 i x}+i\right )}{2}\) | \(29\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.97, size = 25, normalized size = 1.19 \begin {gather*} -\frac {1}{2 \, {\left (\tan \left (x\right ) + 1\right )}} - \frac {1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \frac {1}{2} \, \log \left (\tan \left (x\right ) + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 37 vs.
\(2 (17) = 34\).
time = 1.01, size = 37, normalized size = 1.76 \begin {gather*} \frac {{\left (\tan \left (x\right ) + 1\right )} \log \left (\frac {\tan \left (x\right )^{2} + 2 \, \tan \left (x\right ) + 1}{\tan \left (x\right )^{2} + 1}\right ) + \tan \left (x\right ) - 1}{4 \, {\left (\tan \left (x\right ) + 1\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. 75 vs.
\(2 (17) = 34\).
time = 0.16, size = 75, normalized size = 3.57 \begin {gather*} \frac {2 \log {\left (\tan {\left (x \right )} + 1 \right )} \tan {\left (x \right )}}{4 \tan {\left (x \right )} + 4} + \frac {2 \log {\left (\tan {\left (x \right )} + 1 \right )}}{4 \tan {\left (x \right )} + 4} - \frac {\log {\left (\tan ^{2}{\left (x \right )} + 1 \right )} \tan {\left (x \right )}}{4 \tan {\left (x \right )} + 4} - \frac {\log {\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{4 \tan {\left (x \right )} + 4} - \frac {2}{4 \tan {\left (x \right )} + 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.64, size = 26, normalized size = 1.24 \begin {gather*} -\frac {1}{2 \, {\left (\tan \left (x\right ) + 1\right )}} - \frac {1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \frac {1}{2} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.25, size = 27, normalized size = 1.29 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (x\right )+1\right )}{2}-\frac {\ln \left ({\mathrm {tan}\left (x\right )}^2+1\right )}{4}-\frac {1}{2\,\left (\mathrm {tan}\left (x\right )+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________