Optimal. Leaf size=28 \[ -x \left (1-4 e^x+x\right )^2 (x+x (x+\log (x)))+\log \left (4+x^2\right ) \]
________________________________________________________________________________________
Rubi [B] time = 2.27, 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 = {6688, 6725, 260, 321, 203, 266, 43, 302, 2304, 6742, 2196, 2176, 2194, 2554, 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 43
Rule 203
Rule 260
Rule 266
Rule 302
Rule 321
Rule 2176
Rule 2194
Rule 2196
Rule 2304
Rule 2554
Rule 6688
Rule 6725
Rule 6742
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} \operatorname {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} \operatorname {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} \operatorname {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} \operatorname {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.13, 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]
________________________________________________________________________________________
fricas [B] time = 0.58, 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 \relax (x) + \log \left (x^{2} + 4\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.23, size = 116, normalized size = 4.14 \begin {gather*} -x^{5} + 8 \, x^{4} e^{x} - x^{4} \log \relax (x) + 8 \, x^{3} e^{x} \log \relax (x) - 3 \, x^{4} - 16 \, x^{3} e^{\left (2 \, x\right )} + 16 \, x^{3} e^{x} - 2 \, x^{3} \log \relax (x) - 16 \, x^{2} e^{\left (2 \, x\right )} \log \relax (x) + 8 \, x^{2} e^{x} \log \relax (x) - 3 \, x^{3} - 16 \, x^{2} e^{\left (2 \, x\right )} + 8 \, x^{2} e^{x} - x^{2} \log \relax (x) - x^{2} + \log \left (x^{2} + 4\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.47, size = 109, normalized size = 3.89
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 \relax (x )-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 \relax (x ) {\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^{2} {\mathrm e}^{x} \ln \relax (x )+8 x^{3} {\mathrm e}^{x} \ln \relax (x )-x^{5}-3 x^{4}-3 x^{3}-x^{2}+\ln \left (x^{2}+4\right )-x^{4} \ln \relax (x )-2 x^{3} \ln \relax (x )-x^{2} \ln \relax (x )\) | \(117\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.76, 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 \relax (x) + x^{2}\right )} e^{\left (2 \, x\right )} + 8 \, {\left (x^{4} + 2 \, x^{3} + x^{2} + {\left (x^{3} + x^{2}\right )} \log \relax (x)\right )} e^{x} - {\left (x^{4} + 2 \, x^{3} + x^{2}\right )} \log \relax (x) + \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 \relax (x)\,\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]
________________________________________________________________________________________
sympy [B] time = 0.63, 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 {\relax (x )} - 16 x^{2}\right ) e^{2 x} + \left (- x^{4} - 2 x^{3} - x^{2}\right ) \log {\relax (x )} + \left (8 x^{4} + 8 x^{3} \log {\relax (x )} + 16 x^{3} + 8 x^{2} \log {\relax (x )} + 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]
________________________________________________________________________________________