\(\int \frac {1-36 x-3 x^2+e^x (-18-18 x-3 x^2)}{36+12 x+x^2+e (36+12 x+x^2)} \, dx\) [3247]

   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 = 45, antiderivative size = 26 \[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=4-\frac {x \left (\frac {1}{x}+3 \left (e^x+x\right )\right )}{(1+e) (6+x)} \]

[Out]

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

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.77, number of steps used = 13, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {6873, 27, 12, 6874, 697, 2230, 2225, 2208, 2209} \[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=-\frac {3 x}{1+e}+\frac {18 e^x}{(1+e) (x+6)}-\frac {109}{(1+e) (x+6)}-\frac {3 e^x}{1+e} \]

[In]

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

[Out]

(-3*E^x)/(1 + E) - (3*x)/(1 + E) - 109/((1 + E)*(6 + x)) + (18*E^x)/((1 + E)*(6 + x))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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 2208

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] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

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 2230

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] &&  !TrueQ[$UseGamma]

Rule 6873

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

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36 (1+e)+12 (1+e) x+(1+e) x^2} \, dx \\ & = \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{(1+e) (6+x)^2} \, dx \\ & = \frac {\int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{(6+x)^2} \, dx}{1+e} \\ & = \frac {\int \left (\frac {1-36 x-3 x^2}{(6+x)^2}-\frac {3 e^x \left (6+6 x+x^2\right )}{(6+x)^2}\right ) \, dx}{1+e} \\ & = \frac {\int \frac {1-36 x-3 x^2}{(6+x)^2} \, dx}{1+e}-\frac {3 \int \frac {e^x \left (6+6 x+x^2\right )}{(6+x)^2} \, dx}{1+e} \\ & = \frac {\int \left (-3+\frac {109}{(6+x)^2}\right ) \, dx}{1+e}-\frac {3 \int \left (e^x+\frac {6 e^x}{(6+x)^2}-\frac {6 e^x}{6+x}\right ) \, dx}{1+e} \\ & = -\frac {3 x}{1+e}-\frac {109}{(1+e) (6+x)}-\frac {3 \int e^x \, dx}{1+e}-\frac {18 \int \frac {e^x}{(6+x)^2} \, dx}{1+e}+\frac {18 \int \frac {e^x}{6+x} \, dx}{1+e} \\ & = -\frac {3 e^x}{1+e}-\frac {3 x}{1+e}-\frac {109}{(1+e) (6+x)}+\frac {18 e^x}{(1+e) (6+x)}+\frac {18 \text {Ei}(6+x)}{e^6 (1+e)}-\frac {18 \int \frac {e^x}{6+x} \, dx}{1+e} \\ & = -\frac {3 e^x}{1+e}-\frac {3 x}{1+e}-\frac {109}{(1+e) (6+x)}+\frac {18 e^x}{(1+e) (6+x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04 \[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=-\frac {109+3 \left (6+e^x\right ) x+3 x^2}{(1+e) (6+x)} \]

[In]

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

[Out]

-((109 + 3*(6 + E^x)*x + 3*x^2)/((1 + E)*(6 + x)))

Maple [A] (verified)

Time = 2.84 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00

method result size
parallelrisch \(-\frac {3 x^{2}+3 \,{\mathrm e}^{x} x +1}{\left (1+{\mathrm e}\right ) \left (6+x \right )}\) \(26\)
norman \(\frac {-\frac {3 x^{2}}{1+{\mathrm e}}-\frac {3 x \,{\mathrm e}^{x}}{1+{\mathrm e}}-\frac {1}{1+{\mathrm e}}}{6+x}\) \(38\)
risch \(-\frac {3 x}{1+{\mathrm e}}-\frac {109 \,{\mathrm e}}{\left (1+{\mathrm e}\right ) \left (x \,{\mathrm e}+6 \,{\mathrm e}+x +6\right )}-\frac {109}{\left (1+{\mathrm e}\right ) \left (x \,{\mathrm e}+6 \,{\mathrm e}+x +6\right )}-\frac {3 x \,{\mathrm e}^{x}}{\left (1+{\mathrm e}\right ) \left (6+x \right )}\) \(71\)
parts \(-\frac {3 x +\frac {109}{6+x}}{1+{\mathrm e}}-\frac {3 \,{\mathrm e}^{x}}{1+{\mathrm e}}-\frac {18 \left (-\frac {{\mathrm e}^{x}}{6+x}-{\mathrm e}^{-6} \operatorname {Ei}_{1}\left (-x -6\right )\right )}{1+{\mathrm e}}-\frac {18 \,{\mathrm e}^{-6} \operatorname {Ei}_{1}\left (-x -6\right )}{1+{\mathrm e}}\) \(77\)
default \(-\frac {1}{\left (1+{\mathrm e}\right ) \left (6+x \right )}-\frac {36 \left (\frac {6}{6+x}+\ln \left (6+x \right )\right )}{1+{\mathrm e}}-\frac {3 \left (x -\frac {36}{6+x}-12 \ln \left (6+x \right )\right )}{1+{\mathrm e}}-\frac {18 \left (-\frac {{\mathrm e}^{x}}{6+x}-{\mathrm e}^{-6} \operatorname {Ei}_{1}\left (-x -6\right )\right )}{1+{\mathrm e}}-\frac {18 \,{\mathrm e}^{-6} \operatorname {Ei}_{1}\left (-x -6\right )}{1+{\mathrm e}}-\frac {3 \,{\mathrm e}^{x}}{1+{\mathrm e}}\) \(114\)

[In]

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

[Out]

-(3*x^2+3*exp(x)*x+1)/(1+exp(1))/(6+x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

-(3*x^2 + 3*x*e^x + 18*x + 109)/((x + 6)*e + x + 6)

Sympy [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.69 \[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=- \frac {3 x}{1 + e} - \frac {3 x e^{x}}{x + e x + 6 + 6 e} - \frac {109}{x \left (1 + e\right ) + 6 + 6 e} \]

[In]

integrate(((-3*x**2-18*x-18)*exp(x)-3*x**2-36*x+1)/((x**2+12*x+36)*exp(1)+x**2+12*x+36),x)

[Out]

-3*x/(1 + E) - 3*x*exp(x)/(x + E*x + 6 + 6*E) - 109/(x*(1 + E) + 6 + 6*E)

Maxima [F]

\[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=\int { -\frac {3 \, x^{2} + 3 \, {\left (x^{2} + 6 \, x + 6\right )} e^{x} + 36 \, x - 1}{x^{2} + {\left (x^{2} + 12 \, x + 36\right )} e + 12 \, x + 36} \,d x } \]

[In]

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

[Out]

-3*x*e^x/(x*(e + 1) + 6*e + 6) - 3*x/(e + 1) + 18*e^(-6)*exp_integral_e(2, -x - 6)/((x + 6)*(e + 1)) - 109/(x*
(e + 1) + 6*e + 6) + 18*integrate(e^x/(x^2*(e + 1) + 12*x*(e + 1) + 36*e + 36), x)

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.15 \[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=-\frac {3 \, x^{2} + 3 \, x e^{x} + 18 \, x + 109}{x e + x + 6 \, e + 6} \]

[In]

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

[Out]

-(3*x^2 + 3*x*e^x + 18*x + 109)/(x*e + x + 6*e + 6)

Mupad [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.88 \[ \int \frac {1-36 x-3 x^2+e^x \left (-18-18 x-3 x^2\right )}{36+12 x+x^2+e \left (36+12 x+x^2\right )} \, dx=-\frac {x\,\left (18\,x+18\,{\mathrm {e}}^x-1\right )}{6\,\left (\mathrm {e}+1\right )\,\left (x+6\right )} \]

[In]

int(-(36*x + exp(x)*(18*x + 3*x^2 + 18) + 3*x^2 - 1)/(12*x + exp(1)*(12*x + x^2 + 36) + x^2 + 36),x)

[Out]

-(x*(18*x + 18*exp(x) - 1))/(6*(exp(1) + 1)*(x + 6))