Optimal. Leaf size=28 \[ -x \left (1-4 e^x+x\right )^2 (x+x (x+\log (x)))+\log \left (4+x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(124\) vs. \(2(28)=56\).
time = 1.46, antiderivative size = 124, normalized size of antiderivative = 4.43, number of steps
used = 64, number of rules used = 15, integrand size = 180, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used
= {6820, 6857, 266, 327, 209, 272, 45, 308, 2341, 6874, 2227, 2207, 2225, 2634, 12}
\begin {gather*} -x^5+8 e^x x^4-3 x^4-x^4 \log (x)+16 e^x x^3-16 e^{2 x} x^3-3 x^3+8 e^x x^3 \log (x)-2 x^3 \log (x)+8 e^x x^2-16 e^{2 x} x^2-x^2+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-x^2 \log (x)+\log \left (x^2+4\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 45
Rule 209
Rule 266
Rule 272
Rule 308
Rule 327
Rule 2207
Rule 2225
Rule 2227
Rule 2341
Rule 2634
Rule 6820
Rule 6857
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {x \left (-10-44 x-55 x^2-31 x^3-13 x^4-5 x^5-16 e^{2 x} \left (12+20 x+11 x^2+5 x^3+2 x^4\right )+8 e^x \left (12+32 x+27 x^2+12 x^3+6 x^4+x^5\right )-2 \left (4+x^2\right ) \left (1+3 x+2 x^2+16 e^{2 x} (1+x)-4 e^x \left (2+4 x+x^2\right )\right ) \log (x)\right )}{4+x^2} \, dx\\ &=\int \left (-\frac {10 x}{4+x^2}-\frac {44 x^2}{4+x^2}-\frac {55 x^3}{4+x^2}-\frac {31 x^4}{4+x^2}-\frac {13 x^5}{4+x^2}-\frac {5 x^6}{4+x^2}-2 x \log (x)-6 x^2 \log (x)-4 x^3 \log (x)-16 e^{2 x} x (1+x) (3+2 x+2 \log (x))+8 e^x x \left (3+8 x+6 x^2+x^3+2 \log (x)+4 x \log (x)+x^2 \log (x)\right )\right ) \, dx\\ &=-(2 \int x \log (x) \, dx)-4 \int x^3 \log (x) \, dx-5 \int \frac {x^6}{4+x^2} \, dx-6 \int x^2 \log (x) \, dx+8 \int e^x x \left (3+8 x+6 x^2+x^3+2 \log (x)+4 x \log (x)+x^2 \log (x)\right ) \, dx-10 \int \frac {x}{4+x^2} \, dx-13 \int \frac {x^5}{4+x^2} \, dx-16 \int e^{2 x} x (1+x) (3+2 x+2 \log (x)) \, dx-31 \int \frac {x^4}{4+x^2} \, dx-44 \int \frac {x^2}{4+x^2} \, dx-55 \int \frac {x^3}{4+x^2} \, dx\\ &=-44 x+\frac {x^2}{2}+\frac {2 x^3}{3}+\frac {x^4}{4}-x^2 \log (x)-2 x^3 \log (x)-x^4 \log (x)-5 \log \left (4+x^2\right )-5 \int \left (16-4 x^2+x^4-\frac {64}{4+x^2}\right ) \, dx-\frac {13}{2} \text {Subst}\left (\int \frac {x^2}{4+x} \, dx,x,x^2\right )+8 \int \left (e^x x \left (3+8 x+6 x^2+x^3\right )+e^x x \left (2+4 x+x^2\right ) \log (x)\right ) \, dx-16 \int \left (e^{2 x} x \left (3+5 x+2 x^2\right )+2 e^{2 x} x (1+x) \log (x)\right ) \, dx-\frac {55}{2} \text {Subst}\left (\int \frac {x}{4+x} \, dx,x,x^2\right )-31 \int \left (-4+x^2+\frac {16}{4+x^2}\right ) \, dx+176 \int \frac {1}{4+x^2} \, dx\\ &=\frac {x^2}{2}-3 x^3+\frac {x^4}{4}-x^5+88 \tan ^{-1}\left (\frac {x}{2}\right )-x^2 \log (x)-2 x^3 \log (x)-x^4 \log (x)-5 \log \left (4+x^2\right )-\frac {13}{2} \text {Subst}\left (\int \left (-4+x+\frac {16}{4+x}\right ) \, dx,x,x^2\right )+8 \int e^x x \left (3+8 x+6 x^2+x^3\right ) \, dx+8 \int e^x x \left (2+4 x+x^2\right ) \log (x) \, dx-16 \int e^{2 x} x \left (3+5 x+2 x^2\right ) \, dx-\frac {55}{2} \text {Subst}\left (\int \left (1-\frac {4}{4+x}\right ) \, dx,x,x^2\right )-32 \int e^{2 x} x (1+x) \log (x) \, dx+320 \int \frac {1}{4+x^2} \, dx-496 \int \frac {1}{4+x^2} \, dx\\ &=-x^2-3 x^3-3 x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )-8 \int e^x x (1+x) \, dx+8 \int \left (3 e^x x+8 e^x x^2+6 e^x x^3+e^x x^4\right ) \, dx-16 \int \left (3 e^{2 x} x+5 e^{2 x} x^2+2 e^{2 x} x^3\right ) \, dx+32 \int \frac {1}{2} e^{2 x} x \, dx\\ &=-x^2-3 x^3-3 x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )+8 \int e^x x^4 \, dx-8 \int \left (e^x x+e^x x^2\right ) \, dx+16 \int e^{2 x} x \, dx+24 \int e^x x \, dx-32 \int e^{2 x} x^3 \, dx-48 \int e^{2 x} x \, dx+48 \int e^x x^3 \, dx+64 \int e^x x^2 \, dx-80 \int e^{2 x} x^2 \, dx\\ &=24 e^x x-16 e^{2 x} x-x^2+64 e^x x^2-40 e^{2 x} x^2-3 x^3+48 e^x x^3-16 e^{2 x} x^3-3 x^4+8 e^x x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )-8 \int e^{2 x} \, dx-8 \int e^x x \, dx-8 \int e^x x^2 \, dx-24 \int e^x \, dx+24 \int e^{2 x} \, dx-32 \int e^x x^3 \, dx+48 \int e^{2 x} x^2 \, dx+80 \int e^{2 x} x \, dx-128 \int e^x x \, dx-144 \int e^x x^2 \, dx\\ &=-24 e^x+8 e^{2 x}-112 e^x x+24 e^{2 x} x-x^2-88 e^x x^2-16 e^{2 x} x^2-3 x^3+16 e^x x^3-16 e^{2 x} x^3-3 x^4+8 e^x x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )+8 \int e^x \, dx+16 \int e^x x \, dx-40 \int e^{2 x} \, dx-48 \int e^{2 x} x \, dx+96 \int e^x x^2 \, dx+128 \int e^x \, dx+288 \int e^x x \, dx\\ &=112 e^x-12 e^{2 x}+192 e^x x-x^2+8 e^x x^2-16 e^{2 x} x^2-3 x^3+16 e^x x^3-16 e^{2 x} x^3-3 x^4+8 e^x x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )-16 \int e^x \, dx+24 \int e^{2 x} \, dx-192 \int e^x x \, dx-288 \int e^x \, dx\\ &=-192 e^x-x^2+8 e^x x^2-16 e^{2 x} x^2-3 x^3+16 e^x x^3-16 e^{2 x} x^3-3 x^4+8 e^x x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )+192 \int e^x \, dx\\ &=-x^2+8 e^x x^2-16 e^{2 x} x^2-3 x^3+16 e^x x^3-16 e^{2 x} x^3-3 x^4+8 e^x x^4-x^5-x^2 \log (x)+8 e^x x^2 \log (x)-16 e^{2 x} x^2 \log (x)-2 x^3 \log (x)+8 e^x x^3 \log (x)-x^4 \log (x)+\log \left (4+x^2\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 42, normalized size = 1.50 \begin {gather*} -x^2 (1+x) \left (1-4 e^x+x\right )^2-x^2 \left (1-4 e^x+x\right )^2 \log (x)+\log \left (4+x^2\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(116\) vs.
\(2(27)=54\).
time = 0.29, size = 117, normalized size = 4.18
method | result | size |
risch | \(\left (-x^{4}+8 \,{\mathrm e}^{x} x^{3}-16 \,{\mathrm e}^{2 x} x^{2}-2 x^{3}+8 \,{\mathrm e}^{x} x^{2}-x^{2}\right ) \ln \left (x \right )-x^{5}+8 \,{\mathrm e}^{x} x^{4}-16 \,{\mathrm e}^{2 x} x^{3}-3 x^{4}+16 \,{\mathrm e}^{x} x^{3}-16 \,{\mathrm e}^{2 x} x^{2}-3 x^{3}+8 \,{\mathrm e}^{x} x^{2}-x^{2}+\ln \left (x^{2}+4\right )\) | \(109\) |
default | \(-16 \,{\mathrm e}^{2 x} x^{3}-16 \,{\mathrm e}^{2 x} x^{2}-16 \ln \left (x \right ) {\mathrm e}^{2 x} x^{2}+8 \,{\mathrm e}^{x} x^{2}+16 \,{\mathrm e}^{x} x^{3}+8 \,{\mathrm e}^{x} x^{4}+8 x^{3} {\mathrm e}^{x} \ln \left (x \right )+8 x^{2} {\mathrm e}^{x} \ln \left (x \right )-x^{5}-3 x^{4}-3 x^{3}-x^{2}+\ln \left (x^{2}+4\right )-x^{4} \ln \left (x \right )-2 x^{3} \ln \left (x \right )-x^{2} \ln \left (x \right )\) | \(117\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 88 vs.
\(2 (27) = 54\).
time = 0.51, size = 88, normalized size = 3.14 \begin {gather*} -x^{5} - 3 \, x^{4} - 3 \, x^{3} - x^{2} - 16 \, {\left (x^{3} + x^{2} \log \left (x\right ) + x^{2}\right )} e^{\left (2 \, x\right )} + 8 \, {\left (x^{4} + 2 \, x^{3} + x^{2} + {\left (x^{3} + x^{2}\right )} \log \left (x\right )\right )} e^{x} - {\left (x^{4} + 2 \, x^{3} + x^{2}\right )} \log \left (x\right ) + \log \left (x^{2} + 4\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. 92 vs.
\(2 (27) = 54\).
time = 0.41, size = 92, normalized size = 3.29 \begin {gather*} -x^{5} - 3 \, x^{4} - 3 \, x^{3} - x^{2} - 16 \, {\left (x^{3} + x^{2}\right )} e^{\left (2 \, x\right )} + 8 \, {\left (x^{4} + 2 \, x^{3} + x^{2}\right )} e^{x} - {\left (x^{4} + 2 \, x^{3} + 16 \, x^{2} e^{\left (2 \, x\right )} + x^{2} - 8 \, {\left (x^{3} + x^{2}\right )} e^{x}\right )} \log \left (x\right ) + \log \left (x^{2} + 4\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. 100 vs.
\(2 (26) = 52\).
time = 0.25, size = 100, normalized size = 3.57 \begin {gather*} - x^{5} - 3 x^{4} - 3 x^{3} - x^{2} + \left (- 16 x^{3} - 16 x^{2} \log {\left (x \right )} - 16 x^{2}\right ) e^{2 x} + \left (- x^{4} - 2 x^{3} - x^{2}\right ) \log {\left (x \right )} + \left (8 x^{4} + 8 x^{3} \log {\left (x \right )} + 16 x^{3} + 8 x^{2} \log {\left (x \right )} + 8 x^{2}\right ) e^{x} + \log {\left (x^{2} + 4 \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 116 vs.
\(2 (27) = 54\).
time = 0.42, size = 116, normalized size = 4.14 \begin {gather*} -x^{5} + 8 \, x^{4} e^{x} - x^{4} \log \left (x\right ) + 8 \, x^{3} e^{x} \log \left (x\right ) - 3 \, x^{4} - 16 \, x^{3} e^{\left (2 \, x\right )} + 16 \, x^{3} e^{x} - 2 \, x^{3} \log \left (x\right ) - 16 \, x^{2} e^{\left (2 \, x\right )} \log \left (x\right ) + 8 \, x^{2} e^{x} \log \left (x\right ) - 3 \, x^{3} - 16 \, x^{2} e^{\left (2 \, x\right )} + 8 \, x^{2} e^{x} - x^{2} \log \left (x\right ) - x^{2} + \log \left (x^{2} + 4\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.72, size = 103, normalized size = 3.68 \begin {gather*} \ln \left (x^2+4\right )-\ln \left (x\right )\,\left (16\,x^2\,{\mathrm {e}}^{2\,x}-{\mathrm {e}}^x\,\left (8\,x^3+8\,x^2\right )+x^2+2\,x^3+x^4\right )+{\mathrm {e}}^x\,\left (8\,x^4+16\,x^3+8\,x^2\right )-{\mathrm {e}}^{2\,x}\,\left (16\,x^3+16\,x^2\right )-x^2-3\,x^3-3\,x^4-x^5 \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________