Optimal. Leaf size=28 \[ \frac {4 x}{25}-\frac {3}{25} \log (2 \cos (x)+\sin (x))+\frac {2}{5 (2+\tan (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {815, 649, 209,
266} \begin {gather*} \frac {4 x}{25}+\frac {2}{5 (\tan (x)+2)}-\frac {3}{25} \log (\sin (x)+2 \cos (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 815
Rubi steps
\begin {align*} \int \frac {1}{4+4 \cot (x)+\tan (x)} \, dx &=\text {Subst}\left (\int \frac {x}{(2+x)^2 \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\text {Subst}\left (\int \left (-\frac {2}{5 (2+x)^2}-\frac {3}{25 (2+x)}+\frac {4+3 x}{25 \left (1+x^2\right )}\right ) \, dx,x,\tan (x)\right )\\ &=-\frac {3}{25} \log (2+\tan (x))+\frac {2}{5 (2+\tan (x))}+\frac {1}{25} \text {Subst}\left (\int \frac {4+3 x}{1+x^2} \, dx,x,\tan (x)\right )\\ &=-\frac {3}{25} \log (2+\tan (x))+\frac {2}{5 (2+\tan (x))}+\frac {3}{25} \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\tan (x)\right )+\frac {4}{25} \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\frac {4 x}{25}-\frac {3}{25} \log (\cos (x))-\frac {3}{25} \log (2+\tan (x))+\frac {2}{5 (2+\tan (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 41, normalized size = 1.46 \begin {gather*} \frac {-5+4 x+\cot (x) (8 x-6 \log (2 \cos (x)+\sin (x)))-3 \log (2 \cos (x)+\sin (x))}{25+50 \cot (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 31, normalized size = 1.11
method | result | size |
default | \(\frac {2}{5 \left (2+\tan \left (x \right )\right )}-\frac {3 \ln \left (2+\tan \left (x \right )\right )}{25}+\frac {3 \ln \left (1+\tan ^{2}\left (x \right )\right )}{50}+\frac {4 \arctan \left (\tan \left (x \right )\right )}{25}\) | \(31\) |
norman | \(\frac {\frac {8 x}{25}+\frac {4 x \tan \left (x \right )}{25}+\frac {2}{5}}{2+\tan \left (x \right )}-\frac {3 \ln \left (2+\tan \left (x \right )\right )}{25}+\frac {3 \ln \left (1+\tan ^{2}\left (x \right )\right )}{50}\) | \(35\) |
risch | \(\frac {4 x}{25}+\frac {3 i x}{25}+\frac {16}{25 \left (5 \,{\mathrm e}^{2 i x}+3+4 i\right )}-\frac {12 i}{25 \left (5 \,{\mathrm e}^{2 i x}+3+4 i\right )}-\frac {3 \ln \left ({\mathrm e}^{2 i x}+\frac {3}{5}+\frac {4 i}{5}\right )}{25}\) | \(52\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.09, size = 28, normalized size = 1.00 \begin {gather*} \frac {4}{25} \, x + \frac {2}{5 \, {\left (\tan \left (x\right ) + 2\right )}} + \frac {3}{50} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {3}{25} \, \log \left (\tan \left (x\right ) + 2\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. 46 vs.
\(2 (22) = 44\).
time = 1.27, size = 46, normalized size = 1.64 \begin {gather*} -\frac {3 \, {\left (\tan \left (x\right ) + 2\right )} \log \left (\frac {\tan \left (x\right )^{2} + 4 \, \tan \left (x\right ) + 4}{\tan \left (x\right )^{2} + 1}\right ) - 8 \, {\left (x - 1\right )} \tan \left (x\right ) - 16 \, x - 4}{50 \, {\left (\tan \left (x\right ) + 2\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. 102 vs.
\(2 (26) = 52\).
time = 0.23, size = 102, normalized size = 3.64 \begin {gather*} \frac {8 x \tan {\left (x \right )}}{50 \tan {\left (x \right )} + 100} + \frac {16 x}{50 \tan {\left (x \right )} + 100} - \frac {6 \log {\left (\tan {\left (x \right )} + 2 \right )} \tan {\left (x \right )}}{50 \tan {\left (x \right )} + 100} - \frac {12 \log {\left (\tan {\left (x \right )} + 2 \right )}}{50 \tan {\left (x \right )} + 100} + \frac {3 \log {\left (\tan ^{2}{\left (x \right )} + 1 \right )} \tan {\left (x \right )}}{50 \tan {\left (x \right )} + 100} + \frac {6 \log {\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{50 \tan {\left (x \right )} + 100} + \frac {20}{50 \tan {\left (x \right )} + 100} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.62, size = 29, normalized size = 1.04 \begin {gather*} \frac {4}{25} \, x + \frac {2}{5 \, {\left (\tan \left (x\right ) + 2\right )}} + \frac {3}{50} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {3}{25} \, \log \left ({\left | \tan \left (x\right ) + 2 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.32, size = 38, normalized size = 1.36 \begin {gather*} \frac {2}{5\,\left (\mathrm {tan}\left (x\right )+2\right )}-\frac {3\,\ln \left (\mathrm {tan}\left (x\right )+2\right )}{25}+\ln \left (\mathrm {tan}\left (x\right )-\mathrm {i}\right )\,\left (\frac {3}{50}-\frac {2}{25}{}\mathrm {i}\right )+\ln \left (\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )\,\left (\frac {3}{50}+\frac {2}{25}{}\mathrm {i}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________