\(\int \frac {29+4 x+2 x^2+e^{2 x} (2+4 x+2 x^2)}{1+2 x+x^2} \, dx\) [9152]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 37, antiderivative size = 18 \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=e^{2 x}+x+\frac {-28+x^2}{1+x} \]

[Out]

x+(x^2-28)/(1+x)+exp(2*x)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.89, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.108, Rules used = {27, 6874, 2225, 697} \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=2 x+e^{2 x}-\frac {27}{x+1} \]

[In]

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

[Out]

E^(2*x) + 2*x - 27/(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 697

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 2225

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 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{(1+x)^2} \, dx \\ & = \int \left (2 e^{2 x}+\frac {29+4 x+2 x^2}{(1+x)^2}\right ) \, dx \\ & = 2 \int e^{2 x} \, dx+\int \frac {29+4 x+2 x^2}{(1+x)^2} \, dx \\ & = e^{2 x}+\int \left (2+\frac {27}{(1+x)^2}\right ) \, dx \\ & = e^{2 x}+2 x-\frac {27}{1+x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=e^{2 x}-\frac {27}{1+x}+2 (1+x) \]

[In]

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

[Out]

E^(2*x) - 27/(1 + x) + 2*(1 + x)

Maple [A] (verified)

Time = 0.87 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.89

method result size
risch \(2 x -\frac {27}{1+x}+{\mathrm e}^{2 x}\) \(16\)
parts \(2 x -\frac {27}{1+x}+{\mathrm e}^{2 x}\) \(16\)
derivativedivides \(2 x -\frac {54}{2+2 x}+{\mathrm e}^{2 x}\) \(18\)
default \(2 x -\frac {54}{2+2 x}+{\mathrm e}^{2 x}\) \(18\)
norman \(\frac {x \,{\mathrm e}^{2 x}+2 x^{2}-29+{\mathrm e}^{2 x}}{1+x}\) \(24\)
parallelrisch \(\frac {x \,{\mathrm e}^{2 x}+2 x^{2}-29+{\mathrm e}^{2 x}}{1+x}\) \(24\)

[In]

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

[Out]

2*x-27/(1+x)+exp(2*x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.33 \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=\frac {2 \, x^{2} + {\left (x + 1\right )} e^{\left (2 \, x\right )} + 2 \, x - 27}{x + 1} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.67 \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=2 x + e^{2 x} - \frac {27}{x + 1} \]

[In]

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

[Out]

2*x + exp(2*x) - 27/(x + 1)

Maxima [F]

\[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=\int { \frac {2 \, x^{2} + 2 \, {\left (x^{2} + 2 \, x + 1\right )} e^{\left (2 \, x\right )} + 4 \, x + 29}{x^{2} + 2 \, x + 1} \,d x } \]

[In]

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

[Out]

2*x + (x^2 + 2*x)*e^(2*x)/(x^2 + 2*x + 1) - 2*e^(-2)*exp_integral_e(2, -2*x - 2)/(x + 1) - 27/(x + 1) - 2*inte
grate(e^(2*x)/(x^3 + 3*x^2 + 3*x + 1), x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.44 \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=\frac {2 \, x^{2} + x e^{\left (2 \, x\right )} + 2 \, x + e^{\left (2 \, x\right )} - 27}{x + 1} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.83 \[ \int \frac {29+4 x+2 x^2+e^{2 x} \left (2+4 x+2 x^2\right )}{1+2 x+x^2} \, dx=2\,x+{\mathrm {e}}^{2\,x}-\frac {27}{x+1} \]

[In]

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

[Out]

2*x + exp(2*x) - 27/(x + 1)