3.70.21 \(\int \frac {2-x-2 e^x x-4 x^2}{2 x} \, dx\)

Optimal. Leaf size=20 \[ -x \left (\frac {1}{2}+x\right )+\log \left (3 e^{-e^x} x\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 18, normalized size of antiderivative = 0.90, number of steps used = 6, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {12, 14, 2194} \begin {gather*} -x^2-\frac {x}{2}-e^x+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(2 - x - 2*E^x*x - 4*x^2)/(2*x),x]

[Out]

-E^x - x/2 - x^2 + Log[x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2194

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 18, normalized size = 0.90 \begin {gather*} -e^x-\frac {x}{2}-x^2+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(2 - x - 2*E^x*x - 4*x^2)/(2*x),x]

[Out]

-E^x - x/2 - x^2 + Log[x]

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 15, normalized size = 0.75 \begin {gather*} -x^{2} - \frac {1}{2} \, x - e^{x} + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.15, size = 15, normalized size = 0.75 \begin {gather*} -x^{2} - \frac {1}{2} \, x - e^{x} + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 16, normalized size = 0.80




method result size



default \(-x^{2}-\frac {x}{2}+\ln \relax (x )-{\mathrm e}^{x}\) \(16\)
norman \(-x^{2}-\frac {x}{2}+\ln \relax (x )-{\mathrm e}^{x}\) \(16\)
risch \(-x^{2}-\frac {x}{2}+\ln \relax (x )-{\mathrm e}^{x}\) \(16\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.38, size = 15, normalized size = 0.75 \begin {gather*} -x^{2} - \frac {1}{2} \, x - e^{x} + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 4.15, size = 15, normalized size = 0.75 \begin {gather*} \ln \relax (x)-{\mathrm {e}}^x-\frac {x}{2}-x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x) - exp(x) - x/2 - x^2

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 12, normalized size = 0.60 \begin {gather*} - x^{2} - \frac {x}{2} - e^{x} + \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________