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

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

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 23, normalized size of antiderivative = 1.10, number of steps used = 5, number of rules used = 3, integrand size = 59, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {6688, 2194, 1620} \begin {gather*} -x+e^{x-4}-\frac {2}{x+1}+\frac {1}{(x+1)^2}+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1620

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

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]

Rule 6688

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 23, normalized size = 1.10 \begin {gather*} e^{-4+x}-x+\frac {1}{(1+x)^2}-\frac {2}{1+x}+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.60, size = 51, normalized size = 2.43 \begin {gather*} -\frac {x^{3} + 2 \, x^{2} - {\left (x^{2} + 2 \, x + 1\right )} e^{\left (x - 4\right )} - {\left (x^{2} + 2 \, x + 1\right )} \log \relax (x) + 3 \, x + 1}{x^{2} + 2 \, x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.25, size = 77, normalized size = 3.67 \begin {gather*} -\frac {x^{3} e^{4} - x^{2} e^{4} \log \relax (x) + 2 \, x^{2} e^{4} - x^{2} e^{x} - 2 \, x e^{4} \log \relax (x) + 3 \, x e^{4} - 2 \, x e^{x} - e^{4} \log \relax (x) + e^{4} - e^{x}}{x^{2} e^{4} + 2 \, x e^{4} + e^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.08, size = 24, normalized size = 1.14




method result size



derivativedivides \({\mathrm e}^{x -4}+\ln \relax (x )+\frac {1}{\left (x +1\right )^{2}}-\frac {2}{x +1}-x +4\) \(24\)
default \({\mathrm e}^{x -4}+\ln \relax (x )+\frac {1}{\left (x +1\right )^{2}}-\frac {2}{x +1}-x +4\) \(24\)
risch \(-x +\frac {-2 x -1}{x^{2}+2 x +1}+\ln \relax (x )+{\mathrm e}^{x -4}\) \(27\)
norman \(\frac {x^{2} {\mathrm e}^{x -4}+x -x^{3}+2 x \,{\mathrm e}^{x -4}+1+{\mathrm e}^{x -4}}{\left (x +1\right )^{2}}+\ln \relax (x )\) \(37\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} -x + \frac {{\left (x^{3} + 3 \, x^{2} + 3 \, x\right )} e^{x}}{x^{3} e^{4} + 3 \, x^{2} e^{4} + 3 \, x e^{4} + e^{4}} + \frac {6 \, x + 5}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} - \frac {4 \, x + 3}{x^{2} + 2 \, x + 1} + \frac {2 \, x + 3}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} - \frac {2 \, x + 1}{x^{2} + 2 \, x + 1} - \frac {e^{\left (-5\right )} E_{3}\left (-x - 1\right )}{{\left (x + 1\right )}^{2}} - \frac {1}{x^{2} + 2 \, x + 1} - 3 \, \int \frac {e^{x}}{x^{4} e^{4} + 4 \, x^{3} e^{4} + 6 \, x^{2} e^{4} + 4 \, x e^{4} + e^{4}}\,{d x} + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + (x^3 + 3*x^2 + 3*x)*e^x/(x^3*e^4 + 3*x^2*e^4 + 3*x*e^4 + e^4) + 1/2*(6*x + 5)/(x^2 + 2*x + 1) - (4*x + 3)
/(x^2 + 2*x + 1) + 1/2*(2*x + 3)/(x^2 + 2*x + 1) - (2*x + 1)/(x^2 + 2*x + 1) - e^(-5)*exp_integral_e(3, -x - 1
)/(x + 1)^2 - 1/(x^2 + 2*x + 1) - 3*integrate(e^x/(x^4*e^4 + 4*x^3*e^4 + 6*x^2*e^4 + 4*x*e^4 + e^4), x) + log(
x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 22, normalized size = 1.05 \begin {gather*} - x - \frac {2 x + 1}{x^{2} + 2 x + 1} + e^{x - 4} + \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________