3.7.24 \(\int \frac {4 x+30 x^2+16 x^3+2 x^4+e^x (-4+2 x+x^2)-x^2 \log (x)}{32 x^2+16 x^3+2 x^4} \, dx\)

Optimal. Leaf size=21 \[ x+\frac {3+\frac {e^x}{x}+\log (x)}{8+2 x} \]

________________________________________________________________________________________

Rubi [B]  time = 0.73, antiderivative size = 51, normalized size of antiderivative = 2.43, number of steps used = 21, number of rules used = 10, integrand size = 57, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used = {1594, 27, 12, 6742, 44, 43, 2177, 2178, 2314, 31} \begin {gather*} x-\frac {e^x}{8 (x+4)}+\frac {3}{2 (x+4)}+\frac {e^x}{8 x}-\frac {x \log (x)}{8 (x+4)}+\frac {\log (x)}{8} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(4*x + 30*x^2 + 16*x^3 + 2*x^4 + E^x*(-4 + 2*x + x^2) - x^2*Log[x])/(32*x^2 + 16*x^3 + 2*x^4),x]

[Out]

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

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 1594

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

Rule 2177

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[((c + d*x)^(m
 + 1)*(b*F^(g*(e + f*x)))^n)/(d*(m + 1)), x] - Dist[(f*g*n*Log[F])/(d*(m + 1)), 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] && LtQ[m, -1] && IntegerQ[2*m] &&  !$UseGamma ===
True

Rule 2178

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$UseGamma === True

Rule 2314

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x_Symbol] :> Simp[(x*(d + e*x^r)^(q
+ 1)*(a + b*Log[c*x^n]))/d, x] - Dist[(b*n)/d, Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q,
r}, x] && EqQ[r*(q + 1) + 1, 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 {4 x+30 x^2+16 x^3+2 x^4+e^x \left (-4+2 x+x^2\right )-x^2 \log (x)}{x^2 \left (32+16 x+2 x^2\right )} \, dx\\ &=\int \frac {4 x+30 x^2+16 x^3+2 x^4+e^x \left (-4+2 x+x^2\right )-x^2 \log (x)}{2 x^2 (4+x)^2} \, dx\\ &=\frac {1}{2} \int \frac {4 x+30 x^2+16 x^3+2 x^4+e^x \left (-4+2 x+x^2\right )-x^2 \log (x)}{x^2 (4+x)^2} \, dx\\ &=\frac {1}{2} \int \left (\frac {30}{(4+x)^2}+\frac {4}{x (4+x)^2}+\frac {16 x}{(4+x)^2}+\frac {2 x^2}{(4+x)^2}+\frac {e^x \left (-4+2 x+x^2\right )}{x^2 (4+x)^2}-\frac {\log (x)}{(4+x)^2}\right ) \, dx\\ &=-\frac {15}{4+x}+\frac {1}{2} \int \frac {e^x \left (-4+2 x+x^2\right )}{x^2 (4+x)^2} \, dx-\frac {1}{2} \int \frac {\log (x)}{(4+x)^2} \, dx+2 \int \frac {1}{x (4+x)^2} \, dx+8 \int \frac {x}{(4+x)^2} \, dx+\int \frac {x^2}{(4+x)^2} \, dx\\ &=-\frac {15}{4+x}-\frac {x \log (x)}{8 (4+x)}+\frac {1}{8} \int \frac {1}{4+x} \, dx+\frac {1}{2} \int \left (-\frac {e^x}{4 x^2}+\frac {e^x}{4 x}+\frac {e^x}{4 (4+x)^2}-\frac {e^x}{4 (4+x)}\right ) \, dx+2 \int \left (\frac {1}{16 x}-\frac {1}{4 (4+x)^2}-\frac {1}{16 (4+x)}\right ) \, dx+8 \int \left (-\frac {4}{(4+x)^2}+\frac {1}{4+x}\right ) \, dx+\int \left (1+\frac {16}{(4+x)^2}-\frac {8}{4+x}\right ) \, dx\\ &=x+\frac {3}{2 (4+x)}+\frac {\log (x)}{8}-\frac {x \log (x)}{8 (4+x)}-\frac {1}{8} \int \frac {e^x}{x^2} \, dx+\frac {1}{8} \int \frac {e^x}{x} \, dx+\frac {1}{8} \int \frac {e^x}{(4+x)^2} \, dx-\frac {1}{8} \int \frac {e^x}{4+x} \, dx\\ &=\frac {e^x}{8 x}+x+\frac {3}{2 (4+x)}-\frac {e^x}{8 (4+x)}+\frac {\text {Ei}(x)}{8}-\frac {\text {Ei}(4+x)}{8 e^4}+\frac {\log (x)}{8}-\frac {x \log (x)}{8 (4+x)}-\frac {1}{8} \int \frac {e^x}{x} \, dx+\frac {1}{8} \int \frac {e^x}{4+x} \, dx\\ &=\frac {e^x}{8 x}+x+\frac {3}{2 (4+x)}-\frac {e^x}{8 (4+x)}+\frac {\log (x)}{8}-\frac {x \log (x)}{8 (4+x)}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.15, size = 32, normalized size = 1.52 \begin {gather*} \frac {e^x+x \left (3+8 x+2 x^2\right )+x \log (x)}{2 x (4+x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(4*x + 30*x^2 + 16*x^3 + 2*x^4 + E^x*(-4 + 2*x + x^2) - x^2*Log[x])/(32*x^2 + 16*x^3 + 2*x^4),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.63, size = 31, normalized size = 1.48 \begin {gather*} \frac {2 \, x^{3} + 8 \, x^{2} + x \log \relax (x) + 3 \, x + e^{x}}{2 \, {\left (x^{2} + 4 \, x\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2*log(x)+(x^2+2*x-4)*exp(x)+2*x^4+16*x^3+30*x^2+4*x)/(2*x^4+16*x^3+32*x^2),x, algorithm="fricas"
)

[Out]

1/2*(2*x^3 + 8*x^2 + x*log(x) + 3*x + e^x)/(x^2 + 4*x)

________________________________________________________________________________________

giac [A]  time = 0.32, size = 31, normalized size = 1.48 \begin {gather*} \frac {2 \, x^{3} + 8 \, x^{2} + x \log \relax (x) + 3 \, x + e^{x}}{2 \, {\left (x^{2} + 4 \, x\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2*log(x)+(x^2+2*x-4)*exp(x)+2*x^4+16*x^3+30*x^2+4*x)/(2*x^4+16*x^3+32*x^2),x, algorithm="giac")

[Out]

1/2*(2*x^3 + 8*x^2 + x*log(x) + 3*x + e^x)/(x^2 + 4*x)

________________________________________________________________________________________

maple [A]  time = 0.07, size = 26, normalized size = 1.24




method result size



norman \(\frac {x^{3}-\frac {29 x}{2}+\frac {x \ln \relax (x )}{2}+\frac {{\mathrm e}^{x}}{2}}{\left (4+x \right ) x}\) \(26\)
risch \(\frac {\ln \relax (x )}{2 x +8}+\frac {2 x^{3}+8 x^{2}+3 x +{\mathrm e}^{x}}{2 \left (4+x \right ) x}\) \(37\)
default \(-\frac {{\mathrm e}^{x}}{8 \left (4+x \right )}+\frac {{\mathrm e}^{x}}{8 x}-\frac {\ln \relax (x ) x}{8 \left (4+x \right )}+x +\frac {\ln \relax (x )}{8}+\frac {3}{2 \left (4+x \right )}\) \(40\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x^2*ln(x)+(x^2+2*x-4)*exp(x)+2*x^4+16*x^3+30*x^2+4*x)/(2*x^4+16*x^3+32*x^2),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 27, normalized size = 1.29 \begin {gather*} x + \frac {x \log \relax (x) + e^{x}}{2 \, {\left (x^{2} + 4 \, x\right )}} + \frac {3}{2 \, {\left (x + 4\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2*log(x)+(x^2+2*x-4)*exp(x)+2*x^4+16*x^3+30*x^2+4*x)/(2*x^4+16*x^3+32*x^2),x, algorithm="maxima"
)

[Out]

x + 1/2*(x*log(x) + e^x)/(x^2 + 4*x) + 3/2/(x + 4)

________________________________________________________________________________________

mupad [B]  time = 0.66, size = 24, normalized size = 1.14 \begin {gather*} x+\frac {\frac {{\mathrm {e}}^x}{2}+x\,\left (\frac {\ln \relax (x)}{2}+\frac {3}{2}\right )}{x\,\left (x+4\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((4*x - x^2*log(x) + exp(x)*(2*x + x^2 - 4) + 30*x^2 + 16*x^3 + 2*x^4)/(32*x^2 + 16*x^3 + 2*x^4),x)

[Out]

x + (exp(x)/2 + x*(log(x)/2 + 3/2))/(x*(x + 4))

________________________________________________________________________________________

sympy [A]  time = 0.34, size = 27, normalized size = 1.29 \begin {gather*} x + \frac {e^{x}}{2 x^{2} + 8 x} + \frac {\log {\relax (x )}}{2 x + 8} + \frac {3}{2 x + 8} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x**2*ln(x)+(x**2+2*x-4)*exp(x)+2*x**4+16*x**3+30*x**2+4*x)/(2*x**4+16*x**3+32*x**2),x)

[Out]

x + exp(x)/(2*x**2 + 8*x) + log(x)/(2*x + 8) + 3/(2*x + 8)

________________________________________________________________________________________