3.53.18 \(\int \frac {-12+4 x^2+e^x (-4+4 x)+4 \log (x)}{x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 24, normalized size of antiderivative = 0.83, number of steps used = 8, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {14, 2197, 2304} \begin {gather*} 4 x+\frac {4 e^x}{x}+\frac {8}{x}-\frac {4 \log (x)}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

8/x + (4*E^x)/x + 4*x - (4*Log[x])/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 2197

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[(g*u^(m + 1)*F^(c*v))/(b*c
*e*Log[F]), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, x
]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 17, normalized size = 0.59 \begin {gather*} \frac {4 \left (2+e^x+x^2-\log (x)\right )}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.16, size = 16, normalized size = 0.55 \begin {gather*} \frac {4 \, {\left (x^{2} + e^{x} - \log \relax (x) + 2\right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 20, normalized size = 0.69




method result size



norman \(\frac {8+4 x^{2}+4 \,{\mathrm e}^{x}-4 \ln \relax (x )}{x}\) \(20\)
risch \(-\frac {4 \ln \relax (x )}{x}+\frac {4 x^{2}+4 \,{\mathrm e}^{x}+8}{x}\) \(21\)
default \(4 x +\frac {8}{x}-\frac {4 \ln \relax (x )}{x}+\frac {4 \,{\mathrm e}^{x}}{x}\) \(24\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(8+4*x^2+4*exp(x)-4*ln(x))/x

________________________________________________________________________________________

maxima [C]  time = 0.38, size = 27, normalized size = 0.93 \begin {gather*} 4 \, x - \frac {4 \, \log \relax (x)}{x} + \frac {8}{x} + 4 \, {\rm Ei}\relax (x) - 4 \, \Gamma \left (-1, -x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*x - 4*log(x)/x + 8/x + 4*Ei(x) - 4*gamma(-1, -x)

________________________________________________________________________________________

mupad [B]  time = 3.69, size = 16, normalized size = 0.55 \begin {gather*} \frac {4\,\left ({\mathrm {e}}^x-\ln \relax (x)+x^2+2\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((4*log(x) + exp(x)*(4*x - 4) + 4*x^2 - 12)/x^2,x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.27, size = 19, normalized size = 0.66 \begin {gather*} 4 x + \frac {4 e^{x}}{x} - \frac {4 \log {\relax (x )}}{x} + \frac {8}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*x + 4*exp(x)/x - 4*log(x)/x + 8/x

________________________________________________________________________________________