3.42.23 \(\int \frac {8-2 x+24 x^2+2 x^3+e^x (4+3 x+x^2)}{128+96 x+24 x^2+2 x^3} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.25, antiderivative size = 50, normalized size of antiderivative = 1.85, number of steps used = 15, number of rules used = 6, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {6742, 37, 43, 2199, 2177, 2178} \begin {gather*} -\frac {x^2}{8 (x+4)^2}+x+\frac {e^x}{2 (x+4)}+\frac {48}{x+4}-\frac {2 e^x}{(x+4)^2}-\frac {66}{(x+4)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(8 - 2*x + 24*x^2 + 2*x^3 + E^x*(4 + 3*x + x^2))/(128 + 96*x + 24*x^2 + 2*x^3),x]

[Out]

x - 66/(4 + x)^2 - (2*E^x)/(4 + x)^2 - x^2/(8*(4 + x)^2) + 48/(4 + x) + E^x/(2*(4 + x))

Rule 37

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

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 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 2199

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !$UseGamma === True

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 \left (\frac {4}{(4+x)^3}-\frac {x}{(4+x)^3}+\frac {12 x^2}{(4+x)^3}+\frac {x^3}{(4+x)^3}+\frac {e^x \left (4+3 x+x^2\right )}{2 (4+x)^3}\right ) \, dx\\ &=-\frac {2}{(4+x)^2}+\frac {1}{2} \int \frac {e^x \left (4+3 x+x^2\right )}{(4+x)^3} \, dx+12 \int \frac {x^2}{(4+x)^3} \, dx-\int \frac {x}{(4+x)^3} \, dx+\int \frac {x^3}{(4+x)^3} \, dx\\ &=-\frac {2}{(4+x)^2}-\frac {x^2}{8 (4+x)^2}+\frac {1}{2} \int \left (\frac {8 e^x}{(4+x)^3}-\frac {5 e^x}{(4+x)^2}+\frac {e^x}{4+x}\right ) \, dx+12 \int \left (\frac {16}{(4+x)^3}-\frac {8}{(4+x)^2}+\frac {1}{4+x}\right ) \, dx+\int \left (1-\frac {64}{(4+x)^3}+\frac {48}{(4+x)^2}-\frac {12}{4+x}\right ) \, dx\\ &=x-\frac {66}{(4+x)^2}-\frac {x^2}{8 (4+x)^2}+\frac {48}{4+x}+\frac {1}{2} \int \frac {e^x}{4+x} \, dx-\frac {5}{2} \int \frac {e^x}{(4+x)^2} \, dx+4 \int \frac {e^x}{(4+x)^3} \, dx\\ &=x-\frac {66}{(4+x)^2}-\frac {2 e^x}{(4+x)^2}-\frac {x^2}{8 (4+x)^2}+\frac {48}{4+x}+\frac {5 e^x}{2 (4+x)}+\frac {\text {Ei}(4+x)}{2 e^4}+2 \int \frac {e^x}{(4+x)^2} \, dx-\frac {5}{2} \int \frac {e^x}{4+x} \, dx\\ &=x-\frac {66}{(4+x)^2}-\frac {2 e^x}{(4+x)^2}-\frac {x^2}{8 (4+x)^2}+\frac {48}{4+x}+\frac {e^x}{2 (4+x)}-\frac {2 \text {Ei}(4+x)}{e^4}+2 \int \frac {e^x}{4+x} \, dx\\ &=x-\frac {66}{(4+x)^2}-\frac {2 e^x}{(4+x)^2}-\frac {x^2}{8 (4+x)^2}+\frac {48}{4+x}+\frac {e^x}{2 (4+x)}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 28, normalized size = 1.04 \begin {gather*} \frac {256+\left (130+e^x\right ) x+16 x^2+2 x^3}{2 (4+x)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(8 - 2*x + 24*x^2 + 2*x^3 + E^x*(4 + 3*x + x^2))/(128 + 96*x + 24*x^2 + 2*x^3),x]

[Out]

(256 + (130 + E^x)*x + 16*x^2 + 2*x^3)/(2*(4 + x)^2)

________________________________________________________________________________________

fricas [A]  time = 1.43, size = 31, normalized size = 1.15 \begin {gather*} \frac {2 \, x^{3} + 16 \, x^{2} + x e^{x} + 130 \, x + 256}{2 \, {\left (x^{2} + 8 \, x + 16\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^2+3*x+4)*exp(x)+2*x^3+24*x^2-2*x+8)/(2*x^3+24*x^2+96*x+128),x, algorithm="fricas")

[Out]

1/2*(2*x^3 + 16*x^2 + x*e^x + 130*x + 256)/(x^2 + 8*x + 16)

________________________________________________________________________________________

giac [A]  time = 0.14, size = 31, normalized size = 1.15 \begin {gather*} \frac {2 \, x^{3} + 16 \, x^{2} + x e^{x} + 130 \, x + 256}{2 \, {\left (x^{2} + 8 \, x + 16\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^2+3*x+4)*exp(x)+2*x^3+24*x^2-2*x+8)/(2*x^3+24*x^2+96*x+128),x, algorithm="giac")

[Out]

1/2*(2*x^3 + 16*x^2 + x*e^x + 130*x + 256)/(x^2 + 8*x + 16)

________________________________________________________________________________________

maple [A]  time = 0.04, size = 17, normalized size = 0.63




method result size



norman \(\frac {x^{3}+x +\frac {{\mathrm e}^{x} x}{2}}{\left (4+x \right )^{2}}\) \(17\)
risch \(x +\frac {49 x +128}{x^{2}+8 x +16}+\frac {x \,{\mathrm e}^{x}}{2 \left (4+x \right )^{2}}\) \(29\)
default \(-\frac {2 \,{\mathrm e}^{x}}{\left (4+x \right )^{2}}-\frac {68}{\left (4+x \right )^{2}}+\frac {49}{4+x}+x +\frac {{\mathrm e}^{x}}{2 x +8}\) \(35\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x^2+3*x+4)*exp(x)+2*x^3+24*x^2-2*x+8)/(2*x^3+24*x^2+96*x+128),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} x + \frac {x e^{x}}{2 \, {\left (x^{2} + 8 \, x + 16\right )}} - \frac {16 \, {\left (3 \, x + 10\right )}}{x^{2} + 8 \, x + 16} + \frac {96 \, {\left (x + 3\right )}}{x^{2} + 8 \, x + 16} + \frac {x + 2}{x^{2} + 8 \, x + 16} - \frac {2 \, e^{\left (-4\right )} E_{3}\left (-x - 4\right )}{{\left (x + 4\right )}^{2}} - \frac {2}{x^{2} + 8 \, x + 16} - 2 \, \int \frac {e^{x}}{x^{3} + 12 \, x^{2} + 48 \, x + 64}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^2+3*x+4)*exp(x)+2*x^3+24*x^2-2*x+8)/(2*x^3+24*x^2+96*x+128),x, algorithm="maxima")

[Out]

x + 1/2*x*e^x/(x^2 + 8*x + 16) - 16*(3*x + 10)/(x^2 + 8*x + 16) + 96*(x + 3)/(x^2 + 8*x + 16) + (x + 2)/(x^2 +
 8*x + 16) - 2*e^(-4)*exp_integral_e(3, -x - 4)/(x + 4)^2 - 2/(x^2 + 8*x + 16) - 2*integrate(e^x/(x^3 + 12*x^2
 + 48*x + 64), x)

________________________________________________________________________________________

mupad [B]  time = 3.61, size = 17, normalized size = 0.63 \begin {gather*} \frac {x\,\left ({\mathrm {e}}^x+2\,x^2+2\right )}{2\,{\left (x+4\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((exp(x)*(3*x + x^2 + 4) - 2*x + 24*x^2 + 2*x^3 + 8)/(96*x + 24*x^2 + 2*x^3 + 128),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.13, size = 29, normalized size = 1.07 \begin {gather*} x + \frac {x e^{x}}{2 x^{2} + 16 x + 32} + \frac {49 x + 128}{x^{2} + 8 x + 16} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x**2+3*x+4)*exp(x)+2*x**3+24*x**2-2*x+8)/(2*x**3+24*x**2+96*x+128),x)

[Out]

x + x*exp(x)/(2*x**2 + 16*x + 32) + (49*x + 128)/(x**2 + 8*x + 16)

________________________________________________________________________________________