3.75.86 \(\int \frac {2-4 x-2 x^2+e^{2+x} (1+2 x+x^2)+e^x (30+60 x+30 x^2)}{1+2 x+x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 21, normalized size of antiderivative = 0.66, number of steps used = 7, number of rules used = 4, integrand size = 49, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.082, Rules used = {27, 6688, 2194, 683} \begin {gather*} -2 x+30 e^x+e^{x+2}-\frac {4}{x+1} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

30*E^x + E^(2 + x) - 2*x - 4/(1 + 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 683

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 21, normalized size = 0.66 \begin {gather*} 30 e^x+e^{2+x}-2 x-\frac {4}{1+x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

30*E^x + E^(2 + x) - 2*x - 4/(1 + x)

________________________________________________________________________________________

fricas [A]  time = 0.78, size = 37, normalized size = 1.16 \begin {gather*} -\frac {{\left (2 \, {\left (x^{2} + x + 2\right )} e^{2} - {\left ({\left (x + 1\right )} e^{2} + 30 \, x + 30\right )} e^{\left (x + 2\right )}\right )} e^{\left (-2\right )}}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.15, size = 39, normalized size = 1.22 \begin {gather*} -\frac {2 \, x^{2} - x e^{\left (x + 2\right )} - 30 \, x e^{x} + 2 \, x - e^{\left (x + 2\right )} - 30 \, e^{x} + 4}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.28, size = 21, normalized size = 0.66




method result size



risch \(-2 x -\frac {4}{x +1}+{\mathrm e}^{2} {\mathrm e}^{x}+30 \,{\mathrm e}^{x}\) \(21\)
norman \(\frac {\left (30+{\mathrm e}^{2}\right ) {\mathrm e}^{x}+\left (30+{\mathrm e}^{2}\right ) x \,{\mathrm e}^{x}-2 x^{2}-2}{x +1}\) \(29\)
default \({\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{x +1}-{\mathrm e}^{-1} \expIntegralEi \left (1, -x -1\right )\right )+{\mathrm e}^{2} \left ({\mathrm e}^{x}-\frac {{\mathrm e}^{x}}{x +1}+{\mathrm e}^{-1} \expIntegralEi \left (1, -x -1\right )\right )-\frac {4}{x +1}-2 x +30 \,{\mathrm e}^{x}+\frac {2 \,{\mathrm e}^{2} {\mathrm e}^{x}}{x +1}\) \(76\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*x + (x^2*(e^2 + 30) + 2*x*e^2)*e^x/(x^2 + 2*x + 1) - 30*e^(-1)*exp_integral_e(2, -x - 1)/(x + 1) + 60*e^x/(
x + 1) - 4/(x + 1) + integrate((x*(e^2 - 60) - e^2)*e^x/(x^3 + 3*x^2 + 3*x + 1), x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 15, normalized size = 0.47 \begin {gather*} - 2 x + \left (e^{2} + 30\right ) e^{x} - \frac {4}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________