\(\int \frac {2+6 x+9 x^2+e^x (1+6 x+9 x^2)}{1+6 x+9 x^2} \, dx\) [3785]

   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 = 15 \[ \int \frac {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=-15+e^x+x+\frac {x}{1+3 x} \]

[Out]

-15+x/(1+3*x)+x+exp(x)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07, 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 {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=x+e^x-\frac {1}{3 (3 x+1)} \]

[In]

Int[(2 + 6*x + 9*x^2 + E^x*(1 + 6*x + 9*x^2))/(1 + 6*x + 9*x^2),x]

[Out]

E^x + x - 1/(3*(1 + 3*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 {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{(1+3 x)^2} \, dx \\ & = \int \left (e^x+\frac {2+6 x+9 x^2}{(1+3 x)^2}\right ) \, dx \\ & = \int e^x \, dx+\int \frac {2+6 x+9 x^2}{(1+3 x)^2} \, dx \\ & = e^x+\int \left (1+\frac {1}{(1+3 x)^2}\right ) \, dx \\ & = e^x+x-\frac {1}{3 (1+3 x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07 \[ \int \frac {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=e^x+x-\frac {1}{3 (1+3 x)} \]

[In]

Integrate[(2 + 6*x + 9*x^2 + E^x*(1 + 6*x + 9*x^2))/(1 + 6*x + 9*x^2),x]

[Out]

E^x + x - 1/(3*(1 + 3*x))

Maple [A] (verified)

Time = 2.90 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.80

method result size
risch \(x -\frac {1}{9 \left (x +\frac {1}{3}\right )}+{\mathrm e}^{x}\) \(12\)
default \(x -\frac {1}{3 \left (1+3 x \right )}+{\mathrm e}^{x}\) \(14\)
parts \(x -\frac {1}{3 \left (1+3 x \right )}+{\mathrm e}^{x}\) \(14\)
norman \(\frac {3 x^{2}+3 \,{\mathrm e}^{x} x -\frac {2}{3}+{\mathrm e}^{x}}{1+3 x}\) \(23\)
parallelrisch \(\frac {9 x^{2}+9 \,{\mathrm e}^{x} x -2+3 \,{\mathrm e}^{x}}{3+9 x}\) \(26\)

[In]

int(((9*x^2+6*x+1)*exp(x)+9*x^2+6*x+2)/(9*x^2+6*x+1),x,method=_RETURNVERBOSE)

[Out]

x-1/9/(x+1/3)+exp(x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.87 \[ \int \frac {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=\frac {9 \, x^{2} + 3 \, {\left (3 \, x + 1\right )} e^{x} + 3 \, x - 1}{3 \, {\left (3 \, x + 1\right )}} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.67 \[ \int \frac {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=x + e^{x} - \frac {1}{9 x + 3} \]

[In]

integrate(((9*x**2+6*x+1)*exp(x)+9*x**2+6*x+2)/(9*x**2+6*x+1),x)

[Out]

x + exp(x) - 1/(9*x + 3)

Maxima [F]

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

[In]

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

[Out]

x + 3*(3*x^2 + 2*x)*e^x/(9*x^2 + 6*x + 1) - 1/3*e^(-1/3)*exp_integral_e(2, -x - 1/3)/(3*x + 1) - 1/3/(3*x + 1)
 - 6*integrate(e^x/(27*x^3 + 27*x^2 + 9*x + 1), x)

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.87 \[ \int \frac {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=\frac {9 \, x^{2} + 9 \, x e^{x} + 3 \, x + 3 \, e^{x} - 1}{3 \, {\left (3 \, x + 1\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \frac {2+6 x+9 x^2+e^x \left (1+6 x+9 x^2\right )}{1+6 x+9 x^2} \, dx=x+{\mathrm {e}}^x-\frac {1}{3\,\left (3\,x+1\right )} \]

[In]

int((6*x + exp(x)*(6*x + 9*x^2 + 1) + 9*x^2 + 2)/(6*x + 9*x^2 + 1),x)

[Out]

x + exp(x) - 1/(3*(3*x + 1))