Optimal. Leaf size=31 \[ 3-\left (1+e^{\frac {-2+x}{(-e+x) (1+2 x)}}\right )^2-x \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(245\) vs. \(2(31)=62\).
time = 4.04, antiderivative size = 245, normalized size of antiderivative = 7.90, number of steps
used = 13, number of rules used = 5, integrand size = 174, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.029, Rules used = {6820, 6874,
45, 90, 6838} \begin {gather*} -x-2 e^{\frac {2-x}{(e-x) (2 x+1)}}-e^{\frac {2 (2-x)}{(e-x) (2 x+1)}}-\frac {4 e^4}{(1+2 e)^2 (e-x)}-\frac {4 e^3}{(1+2 e)^2 (e-x)}-\frac {e^2}{(1+2 e)^2 (e-x)}+\frac {e^2}{e-x}-\frac {4 e^2 (3+2 e) \log (e-x)}{(1+2 e)^3}-\frac {16 e^3 (1+e) \log (e-x)}{(1+2 e)^3}-\frac {2 e \log (e-x)}{(1+2 e)^3}+2 e \log (e-x)-\frac {(1+6 e) \log (2 x+1)}{(1+2 e)^3}+\frac {(1+4 e) \log (2 x+1)}{(1+2 e)^3}+\frac {2 e \log (2 x+1)}{(1+2 e)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 90
Rule 6820
Rule 6838
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-x^2-4 x^3-4 x^4+2 e x (1+2 x)^2-(e+2 e x)^2+2 e^{\frac {2-x}{(e-x) (1+2 x)}} \left (-2+5 e-8 x+2 x^2\right )+2 e^{-\frac {2 (-2+x)}{(e-x) (1+2 x)}} \left (-2+5 e-8 x+2 x^2\right )}{(e-x)^2 (1+2 x)^2} \, dx\\ &=\int \left (-\frac {e^2}{(e-x)^2}+\frac {2 e x}{(e-x)^2}-\frac {x^2}{(e-x)^2 (1+2 x)^2}-\frac {4 x^3}{(e-x)^2 (1+2 x)^2}-\frac {4 x^4}{(e-x)^2 (1+2 x)^2}+\frac {2 e^{-\frac {2 (-2+x)}{(e-x) (1+2 x)}} \left (-2+5 e-8 x+2 x^2\right )}{(e-x)^2 (1+2 x)^2}+\frac {2 e^{-\frac {-2+x}{(e-x) (1+2 x)}} \left (-2+5 e-8 x+2 x^2\right )}{(e-x)^2 (1+2 x)^2}\right ) \, dx\\ &=-\frac {e^2}{e-x}+2 \int \frac {e^{-\frac {2 (-2+x)}{(e-x) (1+2 x)}} \left (-2+5 e-8 x+2 x^2\right )}{(e-x)^2 (1+2 x)^2} \, dx+2 \int \frac {e^{-\frac {-2+x}{(e-x) (1+2 x)}} \left (-2+5 e-8 x+2 x^2\right )}{(e-x)^2 (1+2 x)^2} \, dx-4 \int \frac {x^3}{(e-x)^2 (1+2 x)^2} \, dx-4 \int \frac {x^4}{(e-x)^2 (1+2 x)^2} \, dx+(2 e) \int \frac {x}{(e-x)^2} \, dx-\int \frac {x^2}{(e-x)^2 (1+2 x)^2} \, dx\\ &=-2 e^{\frac {2-x}{(e-x) (1+2 x)}}-e^{\frac {2 (2-x)}{(e-x) (1+2 x)}}-\frac {e^2}{e-x}-4 \int \left (\frac {1}{4}+\frac {e^4}{(1+2 e)^2 (e-x)^2}-\frac {4 e^3 (1+e)}{(1+2 e)^3 (e-x)}+\frac {1}{4 (1+2 e)^2 (1+2 x)^2}+\frac {-1-4 e}{2 (1+2 e)^3 (1+2 x)}\right ) \, dx-4 \int \left (\frac {e^3}{(1+2 e)^2 (e-x)^2}-\frac {e^2 (3+2 e)}{(1+2 e)^3 (e-x)}-\frac {1}{2 (1+2 e)^2 (1+2 x)^2}+\frac {1+6 e}{2 (1+2 e)^3 (1+2 x)}\right ) \, dx+(2 e) \int \left (\frac {e}{(e-x)^2}+\frac {1}{-e+x}\right ) \, dx-\int \left (\frac {e^2}{(1+2 e)^2 (e-x)^2}-\frac {2 e}{(1+2 e)^3 (e-x)}+\frac {1}{(1+2 e)^2 (1+2 x)^2}-\frac {4 e}{(1+2 e)^3 (1+2 x)}\right ) \, dx\\ &=-2 e^{\frac {2-x}{(e-x) (1+2 x)}}-e^{\frac {2 (2-x)}{(e-x) (1+2 x)}}+\frac {e^2}{e-x}-\frac {e^2}{(1+2 e)^2 (e-x)}-\frac {4 e^3}{(1+2 e)^2 (e-x)}-\frac {4 e^4}{(1+2 e)^2 (e-x)}-x+2 e \log (e-x)-\frac {2 e \log (e-x)}{(1+2 e)^3}-\frac {16 e^3 (1+e) \log (e-x)}{(1+2 e)^3}-\frac {4 e^2 (3+2 e) \log (e-x)}{(1+2 e)^3}+\frac {2 e \log (1+2 x)}{(1+2 e)^3}+\frac {(1+4 e) \log (1+2 x)}{(1+2 e)^3}-\frac {(1+6 e) \log (1+2 x)}{(1+2 e)^3}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 50, normalized size = 1.61 \begin {gather*} -e^{-\frac {2 (-2+x)}{(e-x) (1+2 x)}}-2 e^{-\frac {-2+x}{(e-x) (1+2 x)}}-x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.85, size = 51, normalized size = 1.65
method | result | size |
risch | \(-{\mathrm e}^{-\frac {2 \left (x -2\right )}{\left (2 x +1\right ) \left ({\mathrm e}-x \right )}}-x -2 \,{\mathrm e}^{-\frac {x -2}{\left (2 x +1\right ) \left ({\mathrm e}-x \right )}}\) | \(51\) |
norman | \(\frac {\left (-2 \,{\mathrm e}^{2}+{\mathrm e}-\frac {1}{2}\right ) x +\left (2-4 \,{\mathrm e}\right ) x \,{\mathrm e}^{\frac {2-x}{\left (2 x +1\right ) {\mathrm e}-2 x^{2}-x}}+\left (-2 \,{\mathrm e}+1\right ) x \,{\mathrm e}^{\frac {4-2 x}{\left (2 x +1\right ) {\mathrm e}-2 x^{2}-x}}+2 x^{3}+4 x^{2} {\mathrm e}^{\frac {2-x}{\left (2 x +1\right ) {\mathrm e}-2 x^{2}-x}}+2 x^{2} {\mathrm e}^{\frac {4-2 x}{\left (2 x +1\right ) {\mathrm e}-2 x^{2}-x}}-2 \,{\mathrm e} \,{\mathrm e}^{\frac {2-x}{\left (2 x +1\right ) {\mathrm e}-2 x^{2}-x}}-{\mathrm e} \,{\mathrm e}^{\frac {4-2 x}{\left (2 x +1\right ) {\mathrm e}-2 x^{2}-x}}-{\mathrm e}^{2}+\frac {{\mathrm e}}{2}}{\left (2 x +1\right ) \left ({\mathrm e}-x \right )}\) | \(241\) |
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. 1252 vs.
\(2 (31) = 62\).
time = 0.42, size = 1252, normalized size = 40.39 \begin {gather*} -4 \, {\left (\frac {{\left (2 \, e - 1\right )} \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {{\left (2 \, e - 1\right )} \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {x {\left (2 \, e - 1\right )} + 2 \, e}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e}\right )} e^{2} + 2 \, {\left (\frac {4 \, e \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {4 \, e \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {x {\left (4 \, e^{2} + 1\right )} + 2 \, e^{2} - e}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e}\right )} e^{2} + {\left (\frac {4 \, x - 2 \, e + 1}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e} - \frac {4 \, \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {4 \, \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1}\right )} e^{2} + 2 \, {\left (\frac {{\left (6 \, e + 1\right )} \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {4 \, {\left (2 \, e^{3} + 3 \, e^{2}\right )} \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {x {\left (8 \, e^{3} - 1\right )} + 4 \, e^{3} + e}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e}\right )} e + 2 \, {\left (\frac {{\left (2 \, e - 1\right )} \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {{\left (2 \, e - 1\right )} \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {x {\left (2 \, e - 1\right )} + 2 \, e}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e}\right )} e - 4 \, {\left (\frac {4 \, e \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {4 \, e \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {x {\left (4 \, e^{2} + 1\right )} + 2 \, e^{2} - e}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e}\right )} e - {\left (e^{\left (\frac {2 \, e}{x {\left (2 \, e + 1\right )} - 2 \, e^{2} - e} + \frac {10}{2 \, x {\left (2 \, e + 1\right )} + 2 \, e + 1}\right )} + 2 \, e^{\left (\frac {e}{x {\left (2 \, e + 1\right )} - 2 \, e^{2} - e} + \frac {5}{2 \, x {\left (2 \, e + 1\right )} + 2 \, e + 1} + \frac {2}{x {\left (2 \, e + 1\right )} - 2 \, e^{2} - e}\right )}\right )} e^{\left (-\frac {4}{x {\left (2 \, e + 1\right )} - 2 \, e^{2} - e}\right )} - x - \frac {{\left (6 \, e + 1\right )} \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {{\left (4 \, e + 1\right )} \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {2 \, e \log \left (2 \, x + 1\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {16 \, {\left (e^{4} + e^{3}\right )} \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {4 \, {\left (2 \, e^{3} + 3 \, e^{2}\right )} \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} - \frac {2 \, e \log \left (x - e\right )}{8 \, e^{3} + 12 \, e^{2} + 6 \, e + 1} + \frac {x {\left (16 \, e^{4} + 1\right )} + 8 \, e^{4} - e}{2 \, {\left (2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e\right )}} + \frac {x {\left (8 \, e^{3} - 1\right )} + 4 \, e^{3} + e}{2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e} + \frac {x {\left (4 \, e^{2} + 1\right )} + 2 \, e^{2} - e}{2 \, {\left (2 \, x^{2} {\left (4 \, e^{2} + 4 \, e + 1\right )} - x {\left (8 \, e^{3} + 4 \, e^{2} - 2 \, e - 1\right )} - 4 \, e^{3} - 4 \, e^{2} - e\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 55, normalized size = 1.77 \begin {gather*} -x - e^{\left (\frac {2 \, {\left (x - 2\right )}}{2 \, x^{2} - {\left (2 \, x + 1\right )} e + x}\right )} - 2 \, e^{\left (\frac {x - 2}{2 \, x^{2} - {\left (2 \, x + 1\right )} e + x}\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. 46 vs.
\(2 (20) = 40\).
time = 0.48, size = 46, normalized size = 1.48 \begin {gather*} - x - e^{\frac {2 \cdot \left (2 - x\right )}{- 2 x^{2} - x + e \left (2 x + 1\right )}} - 2 e^{\frac {2 - x}{- 2 x^{2} - x + e \left (2 x + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.79, size = 93, normalized size = 3.00 \begin {gather*} -x-2\,{\mathrm {e}}^{-\frac {2}{x-\mathrm {e}-2\,x\,\mathrm {e}+2\,x^2}}\,{\mathrm {e}}^{\frac {x}{x-\mathrm {e}-2\,x\,\mathrm {e}+2\,x^2}}-{\mathrm {e}}^{-\frac {4}{x-\mathrm {e}-2\,x\,\mathrm {e}+2\,x^2}}\,{\mathrm {e}}^{\frac {2\,x}{x-\mathrm {e}-2\,x\,\mathrm {e}+2\,x^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________