Optimal. Leaf size=30 \[ 2 x+\frac {3}{x-\frac {4}{4+x}}-\left (e^x+(-1+x) x\right ) \log (16) \]
________________________________________________________________________________________
Rubi [B] time = 0.73, antiderivative size = 257, normalized size of antiderivative = 8.57, number of steps used = 24, number of rules used = 13, integrand size = 95, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.137, Rules used = {6688, 6742, 614, 618, 206, 638, 722, 738, 773, 632, 31, 800, 2194} \begin {gather*} \frac {2 (2-x) x^2}{-x^2-4 x+4}-\frac {x^2}{4}+\frac {13 (2-x) x}{8 \left (-x^2-4 x+4\right )}-\frac {11 (2-x)}{-x^2-4 x+4}-\frac {7 (x+2)}{4 \left (-x^2-4 x+4\right )}+\frac {(2-x) x^3}{4 \left (-x^2-4 x+4\right )}+\frac {3 x}{2}+\left (8-5 \sqrt {2}\right ) \log \left (x+2 \left (1-\sqrt {2}\right )\right )-\frac {1}{4} \left (32-23 \sqrt {2}\right ) \log \left (x+2 \left (1-\sqrt {2}\right )\right )-\frac {1}{4} \left (32+23 \sqrt {2}\right ) \log \left (x+2 \left (1+\sqrt {2}\right )\right )+\left (8+5 \sqrt {2}\right ) \log \left (x+2 \left (1+\sqrt {2}\right )\right )-e^x \log (16)-\frac {1}{4} (1-2 x)^2 \log (16)+\frac {3 \tanh ^{-1}\left (\frac {x+2}{2 \sqrt {2}}\right )}{\sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 206
Rule 614
Rule 618
Rule 632
Rule 638
Rule 722
Rule 738
Rule 773
Rule 800
Rule 2194
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-28-88 x+13 x^2+16 x^3+2 x^4-e^x \left (-4+4 x+x^2\right )^2 \log (16)-(-1+2 x) \left (-4+4 x+x^2\right )^2 \log (16)}{\left (4-4 x-x^2\right )^2} \, dx\\ &=\int \left (-\frac {28}{\left (-4+4 x+x^2\right )^2}-\frac {88 x}{\left (-4+4 x+x^2\right )^2}+\frac {13 x^2}{\left (-4+4 x+x^2\right )^2}+\frac {16 x^3}{\left (-4+4 x+x^2\right )^2}+\frac {2 x^4}{\left (-4+4 x+x^2\right )^2}-e^x \log (16)-(-1+2 x) \log (16)\right ) \, dx\\ &=-\frac {1}{4} (1-2 x)^2 \log (16)+2 \int \frac {x^4}{\left (-4+4 x+x^2\right )^2} \, dx+13 \int \frac {x^2}{\left (-4+4 x+x^2\right )^2} \, dx+16 \int \frac {x^3}{\left (-4+4 x+x^2\right )^2} \, dx-28 \int \frac {1}{\left (-4+4 x+x^2\right )^2} \, dx-88 \int \frac {x}{\left (-4+4 x+x^2\right )^2} \, dx-\log (16) \int e^x \, dx\\ &=-\frac {11 (2-x)}{4-4 x-x^2}+\frac {13 (2-x) x}{8 \left (4-4 x-x^2\right )}+\frac {2 (2-x) x^2}{4-4 x-x^2}+\frac {(2-x) x^3}{4 \left (4-4 x-x^2\right )}-\frac {7 (2+x)}{4 \left (4-4 x-x^2\right )}-e^x \log (16)-\frac {1}{4} (1-2 x)^2 \log (16)-\frac {1}{16} \int \frac {x^2 (-24+8 x)}{-4+4 x+x^2} \, dx-\frac {1}{2} \int \frac {x (-16+4 x)}{-4+4 x+x^2} \, dx+\frac {7}{4} \int \frac {1}{-4+4 x+x^2} \, dx+\frac {13}{4} \int \frac {1}{-4+4 x+x^2} \, dx-11 \int \frac {1}{-4+4 x+x^2} \, dx\\ &=-2 x-\frac {11 (2-x)}{4-4 x-x^2}+\frac {13 (2-x) x}{8 \left (4-4 x-x^2\right )}+\frac {2 (2-x) x^2}{4-4 x-x^2}+\frac {(2-x) x^3}{4 \left (4-4 x-x^2\right )}-\frac {7 (2+x)}{4 \left (4-4 x-x^2\right )}-e^x \log (16)-\frac {1}{4} (1-2 x)^2 \log (16)-\frac {1}{16} \int \left (-56+8 x-\frac {32 (7-8 x)}{-4+4 x+x^2}\right ) \, dx-\frac {1}{2} \int \frac {16-32 x}{-4+4 x+x^2} \, dx-\frac {7}{2} \operatorname {Subst}\left (\int \frac {1}{32-x^2} \, dx,x,4+2 x\right )-\frac {13}{2} \operatorname {Subst}\left (\int \frac {1}{32-x^2} \, dx,x,4+2 x\right )+22 \operatorname {Subst}\left (\int \frac {1}{32-x^2} \, dx,x,4+2 x\right )\\ &=\frac {3 x}{2}-\frac {x^2}{4}-\frac {11 (2-x)}{4-4 x-x^2}+\frac {13 (2-x) x}{8 \left (4-4 x-x^2\right )}+\frac {2 (2-x) x^2}{4-4 x-x^2}+\frac {(2-x) x^3}{4 \left (4-4 x-x^2\right )}-\frac {7 (2+x)}{4 \left (4-4 x-x^2\right )}+\frac {3 \tanh ^{-1}\left (\frac {2+x}{2 \sqrt {2}}\right )}{\sqrt {2}}-e^x \log (16)-\frac {1}{4} (1-2 x)^2 \log (16)+2 \int \frac {7-8 x}{-4+4 x+x^2} \, dx-\left (-8+5 \sqrt {2}\right ) \int \frac {1}{2-2 \sqrt {2}+x} \, dx+\left (8+5 \sqrt {2}\right ) \int \frac {1}{2+2 \sqrt {2}+x} \, dx\\ &=\frac {3 x}{2}-\frac {x^2}{4}-\frac {11 (2-x)}{4-4 x-x^2}+\frac {13 (2-x) x}{8 \left (4-4 x-x^2\right )}+\frac {2 (2-x) x^2}{4-4 x-x^2}+\frac {(2-x) x^3}{4 \left (4-4 x-x^2\right )}-\frac {7 (2+x)}{4 \left (4-4 x-x^2\right )}+\frac {3 \tanh ^{-1}\left (\frac {2+x}{2 \sqrt {2}}\right )}{\sqrt {2}}-e^x \log (16)-\frac {1}{4} (1-2 x)^2 \log (16)+\left (8-5 \sqrt {2}\right ) \log \left (2 \left (1-\sqrt {2}\right )+x\right )+\left (8+5 \sqrt {2}\right ) \log \left (2 \left (1+\sqrt {2}\right )+x\right )+\frac {1}{4} \left (-32+23 \sqrt {2}\right ) \int \frac {1}{2-2 \sqrt {2}+x} \, dx-\frac {1}{4} \left (32+23 \sqrt {2}\right ) \int \frac {1}{2+2 \sqrt {2}+x} \, dx\\ &=\frac {3 x}{2}-\frac {x^2}{4}-\frac {11 (2-x)}{4-4 x-x^2}+\frac {13 (2-x) x}{8 \left (4-4 x-x^2\right )}+\frac {2 (2-x) x^2}{4-4 x-x^2}+\frac {(2-x) x^3}{4 \left (4-4 x-x^2\right )}-\frac {7 (2+x)}{4 \left (4-4 x-x^2\right )}+\frac {3 \tanh ^{-1}\left (\frac {2+x}{2 \sqrt {2}}\right )}{\sqrt {2}}-e^x \log (16)-\frac {1}{4} (1-2 x)^2 \log (16)-\frac {1}{4} \left (32-23 \sqrt {2}\right ) \log \left (2 \left (1-\sqrt {2}\right )+x\right )+\left (8-5 \sqrt {2}\right ) \log \left (2 \left (1-\sqrt {2}\right )+x\right )+\left (8+5 \sqrt {2}\right ) \log \left (2 \left (1+\sqrt {2}\right )+x\right )-\frac {1}{4} \left (32+23 \sqrt {2}\right ) \log \left (2 \left (1+\sqrt {2}\right )+x\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.33, size = 39, normalized size = 1.30 \begin {gather*} \frac {3 (4+x)}{-4+4 x+x^2}-x (-2-\log (16))-e^x \log (16)-x^2 \log (16) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.96, size = 61, normalized size = 2.03 \begin {gather*} \frac {2 \, x^{3} - 4 \, {\left (x^{2} + 4 \, x - 4\right )} e^{x} \log \relax (2) + 8 \, x^{2} - 4 \, {\left (x^{4} + 3 \, x^{3} - 8 \, x^{2} + 4 \, x\right )} \log \relax (2) - 5 \, x + 12}{x^{2} + 4 \, x - 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.17, size = 75, normalized size = 2.50 \begin {gather*} -\frac {4 \, x^{4} \log \relax (2) + 12 \, x^{3} \log \relax (2) + 4 \, x^{2} e^{x} \log \relax (2) - 2 \, x^{3} - 32 \, x^{2} \log \relax (2) + 16 \, x e^{x} \log \relax (2) - 8 \, x^{2} + 16 \, x \log \relax (2) - 16 \, e^{x} \log \relax (2) + 5 \, x - 12}{x^{2} + 4 \, x - 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.14, size = 39, normalized size = 1.30
method | result | size |
risch | \(-4 x^{2} \ln \relax (2)+4 x \ln \relax (2)+2 x +\frac {3 x +12}{x^{2}+4 x -4}-4 \,{\mathrm e}^{x} \ln \relax (2)\) | \(39\) |
norman | \(\frac {\left (2-12 \ln \relax (2)\right ) x^{3}+\left (-37-144 \ln \relax (2)\right ) x -4 x^{4} \ln \relax (2)+16 \,{\mathrm e}^{x} \ln \relax (2)-16 x \ln \relax (2) {\mathrm e}^{x}-4 x^{2} \ln \relax (2) {\mathrm e}^{x}+44+128 \ln \relax (2)}{x^{2}+4 x -4}\) | \(65\) |
default | \(\frac {\frac {7 x}{4}+\frac {7}{2}}{x^{2}+4 x -4}+\frac {-11 x +22}{x^{2}+4 x -4}+\frac {-\frac {39 x}{4}+\frac {13}{2}}{x^{2}+4 x -4}+\frac {56 x -48}{x^{2}+4 x -4}+2 x -\frac {16 \left (\frac {17 x}{8}-\frac {7}{4}\right )}{x^{2}+4 x -4}+4 x \ln \relax (2)-4 x^{2} \ln \relax (2)-4 \,{\mathrm e}^{x} \ln \relax (2)\) | \(108\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.50, size = 410, normalized size = 13.67 \begin {gather*} -2 \, {\left (2 \, x^{2} - 79 \, \sqrt {2} \log \left (\frac {x - 2 \, \sqrt {2} + 2}{x + 2 \, \sqrt {2} + 2}\right ) - 32 \, x + \frac {8 \, {\left (41 \, x - 34\right )}}{x^{2} + 4 \, x - 4} + 112 \, \log \left (x^{2} + 4 \, x - 4\right )\right )} \log \relax (2) - \frac {15}{2} \, {\left (23 \, \sqrt {2} \log \left (\frac {x - 2 \, \sqrt {2} + 2}{x + 2 \, \sqrt {2} + 2}\right ) + 8 \, x - \frac {8 \, {\left (17 \, x - 14\right )}}{x^{2} + 4 \, x - 4} - 32 \, \log \left (x^{2} + 4 \, x - 4\right )\right )} \log \relax (2) + 2 \, {\left (5 \, \sqrt {2} \log \left (\frac {x - 2 \, \sqrt {2} + 2}{x + 2 \, \sqrt {2} + 2}\right ) - \frac {8 \, {\left (7 \, x - 6\right )}}{x^{2} + 4 \, x - 4} - 8 \, \log \left (x^{2} + 4 \, x - 4\right )\right )} \log \relax (2) + 9 \, {\left (\sqrt {2} \log \left (\frac {x - 2 \, \sqrt {2} + 2}{x + 2 \, \sqrt {2} + 2}\right ) - \frac {8 \, {\left (3 \, x - 2\right )}}{x^{2} + 4 \, x - 4}\right )} \log \relax (2) - \frac {1}{2} \, {\left (\sqrt {2} \log \left (\frac {x - 2 \, \sqrt {2} + 2}{x + 2 \, \sqrt {2} + 2}\right ) + \frac {8 \, {\left (x + 2\right )}}{x^{2} + 4 \, x - 4}\right )} \log \relax (2) - 4 \, {\left (\sqrt {2} \log \left (\frac {x - 2 \, \sqrt {2} + 2}{x + 2 \, \sqrt {2} + 2}\right ) + \frac {8 \, {\left (x - 2\right )}}{x^{2} + 4 \, x - 4}\right )} \log \relax (2) - 4 \, e^{x} \log \relax (2) + 2 \, x - \frac {2 \, {\left (17 \, x - 14\right )}}{x^{2} + 4 \, x - 4} + \frac {8 \, {\left (7 \, x - 6\right )}}{x^{2} + 4 \, x - 4} - \frac {13 \, {\left (3 \, x - 2\right )}}{4 \, {\left (x^{2} + 4 \, x - 4\right )}} + \frac {7 \, {\left (x + 2\right )}}{4 \, {\left (x^{2} + 4 \, x - 4\right )}} - \frac {11 \, {\left (x - 2\right )}}{x^{2} + 4 \, x - 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.73, size = 38, normalized size = 1.27 \begin {gather*} x\,\left (4\,\ln \relax (2)+2\right )+\frac {3\,x+12}{x^2+4\,x-4}-4\,x^2\,\ln \relax (2)-4\,{\mathrm {e}}^x\,\ln \relax (2) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.29, size = 42, normalized size = 1.40 \begin {gather*} - 4 x^{2} \log {\relax (2 )} - x \left (- 4 \log {\relax (2 )} - 2\right ) - \frac {- 3 x - 12}{x^{2} + 4 x - 4} - 4 e^{x} \log {\relax (2 )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________