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

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 22, normalized size of antiderivative = 1.10, number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {12, 14, 2176, 2194} \begin {gather*} -\frac {1}{2} e^x (1-x)-\frac {e^x}{2}+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-1/2*E^x - (E^x*(1 - 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 2176

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[((c + d*x)^m
*(b*F^(g*(e + f*x)))^n)/(f*g*n*Log[F]), x] - Dist[(d*m)/(f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !$UseGamma === True

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-2 e^x x+e^x x (1+x)}{x} \, dx\\ &=\frac {1}{2} \int \left (e^x (-1+x)+\frac {2}{x}\right ) \, dx\\ &=\log (x)+\frac {1}{2} \int e^x (-1+x) \, dx\\ &=-\frac {1}{2} e^x (1-x)+\log (x)-\frac {\int e^x \, dx}{2}\\ &=-\frac {e^x}{2}-\frac {1}{2} e^x (1-x)+\log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 13, normalized size = 0.65 \begin {gather*} \frac {1}{2} e^x (-2+x)+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.83, size = 20, normalized size = 1.00 \begin {gather*} \frac {{\left (x - 2\right )} e^{\left (x + \log \relax (x)\right )} + 2 \, x \log \relax (x)}{2 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.03, size = 11, normalized size = 0.55




method result size



risch \(\ln \relax (x )+\frac {{\mathrm e}^{x} \left (x -2\right )}{2}\) \(11\)
default \(\frac {{\mathrm e}^{x} x}{2}+\ln \relax (x )-{\mathrm e}^{x}\) \(13\)
norman \(\frac {{\mathrm e}^{x} x}{2}+\ln \relax (x )-{\mathrm e}^{x}\) \(13\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 12, normalized size = 0.60 \begin {gather*} \ln \relax (x)-{\mathrm {e}}^x+\frac {x\,{\mathrm {e}}^x}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 10, normalized size = 0.50 \begin {gather*} \frac {\left (x - 2\right ) e^{x}}{2} + \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________