3.23.61 \(\int \frac {1+2 x+e^{2 x-x^2} (2 x-2 x^3)}{x+x^2} \, dx\)

Optimal. Leaf size=19 \[ 9+e^{2 x-x^2}+\log \left (x+x^2\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.36, antiderivative size = 18, normalized size of antiderivative = 0.95, number of steps used = 6, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {1593, 6742, 2236, 72} \begin {gather*} e^{2 x-x^2}+\log (x)+\log (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + 2*x + E^(2*x - x^2)*(2*x - 2*x^3))/(x + x^2),x]

[Out]

E^(2*x - x^2) + Log[x] + Log[1 + x]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 2236

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[(e*F^(a + b*x + c*x^2))/(
2*c*Log[F]), x] /; FreeQ[{F, a, b, c, d, e}, x] && EqQ[b*e - 2*c*d, 0]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {1+2 x+e^{2 x-x^2} \left (2 x-2 x^3\right )}{x (1+x)} \, dx\\ &=\int \left (2 e^{2 x-x^2} (1-x)+\frac {1+2 x}{x (1+x)}\right ) \, dx\\ &=2 \int e^{2 x-x^2} (1-x) \, dx+\int \frac {1+2 x}{x (1+x)} \, dx\\ &=e^{2 x-x^2}+\int \left (\frac {1}{x}+\frac {1}{1+x}\right ) \, dx\\ &=e^{2 x-x^2}+\log (x)+\log (1+x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.36, size = 15, normalized size = 0.79 \begin {gather*} e^{-((-2+x) x)}+\log (x)+\log (1+x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + 2*x + E^(2*x - x^2)*(2*x - 2*x^3))/(x + x^2),x]

[Out]

E^(-((-2 + x)*x)) + Log[x] + Log[1 + x]

________________________________________________________________________________________

fricas [A]  time = 0.76, size = 17, normalized size = 0.89 \begin {gather*} e^{\left (-x^{2} + 2 \, x\right )} + \log \left (x^{2} + x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^3+2*x)*exp(-x^2+2*x)+2*x+1)/(x^2+x),x, algorithm="fricas")

[Out]

e^(-x^2 + 2*x) + log(x^2 + x)

________________________________________________________________________________________

giac [A]  time = 0.26, size = 17, normalized size = 0.89 \begin {gather*} e^{\left (-x^{2} + 2 \, x\right )} + \log \left (x + 1\right ) + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^3+2*x)*exp(-x^2+2*x)+2*x+1)/(x^2+x),x, algorithm="giac")

[Out]

e^(-x^2 + 2*x) + log(x + 1) + log(x)

________________________________________________________________________________________

maple [A]  time = 0.38, size = 15, normalized size = 0.79




method result size



risch \(\ln \left (x^{2}+x \right )+{\mathrm e}^{-\left (x -2\right ) x}\) \(15\)
default \({\mathrm e}^{-x^{2}+2 x}+\ln \left (\left (x +1\right ) x \right )\) \(18\)
norman \({\mathrm e}^{-x^{2}+2 x}+\ln \left (x +1\right )+\ln \relax (x )\) \(18\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-2*x^3+2*x)*exp(-x^2+2*x)+2*x+1)/(x^2+x),x,method=_RETURNVERBOSE)

[Out]

ln(x^2+x)+exp(-(x-2)*x)

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 17, normalized size = 0.89 \begin {gather*} e^{\left (-x^{2} + 2 \, x\right )} + \log \left (x + 1\right ) + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^3+2*x)*exp(-x^2+2*x)+2*x+1)/(x^2+x),x, algorithm="maxima")

[Out]

e^(-x^2 + 2*x) + log(x + 1) + log(x)

________________________________________________________________________________________

mupad [B]  time = 1.30, size = 17, normalized size = 0.89 \begin {gather*} \ln \left (x+1\right )+{\mathrm {e}}^{2\,x-x^2}+\ln \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x + exp(2*x - x^2)*(2*x - 2*x^3) + 1)/(x + x^2),x)

[Out]

log(x + 1) + exp(2*x - x^2) + log(x)

________________________________________________________________________________________

sympy [A]  time = 0.13, size = 14, normalized size = 0.74 \begin {gather*} e^{- x^{2} + 2 x} + \log {\left (x^{2} + x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x**3+2*x)*exp(-x**2+2*x)+2*x+1)/(x**2+x),x)

[Out]

exp(-x**2 + 2*x) + log(x**2 + x)

________________________________________________________________________________________