3.85.67 \(\int \frac {-3 x^2+e^4 x^2+e^x (-3+x+x^2)}{9 x^2+6 x^3+x^4} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.45, antiderivative size = 36, normalized size of antiderivative = 1.71, number of steps used = 13, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {6, 1594, 27, 6742, 2177, 2178} \begin {gather*} -\frac {e^x}{3 (x+3)}+\frac {3-e^4}{x+3}+\frac {e^x}{3 x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, 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 1594

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 2177

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] &&  !$UseGamma ===
True

Rule 2178

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

Rule 6742

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 23, normalized size = 1.10 \begin {gather*} \frac {e^x+3 x-e^4 x}{3 x+x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(E^x + 3*x - E^4*x)/(3*x + x^2)

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 23, normalized size = 1.10 \begin {gather*} -\frac {x e^{4} - 3 \, x - e^{x}}{x^{2} + 3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.12, size = 23, normalized size = 1.10 \begin {gather*} -\frac {x e^{4} - 3 \, x - e^{x}}{x^{2} + 3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.06, size = 21, normalized size = 1.00




method result size



norman \(\frac {\left (3-{\mathrm e}^{4}\right ) x +{\mathrm e}^{x}}{\left (3+x \right ) x}\) \(21\)
risch \(-\frac {{\mathrm e}^{4}}{3+x}+\frac {3}{3+x}+\frac {{\mathrm e}^{x}}{\left (3+x \right ) x}\) \(29\)
default \(-\frac {{\mathrm e}^{4}}{3+x}-\frac {{\mathrm e}^{x}}{3 \left (3+x \right )}+\frac {3}{3+x}+\frac {{\mathrm e}^{x}}{3 x}\) \(34\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.43, size = 29, normalized size = 1.38 \begin {gather*} -\frac {e^{4}}{x + 3} + \frac {e^{x}}{x^{2} + 3 \, x} + \frac {3}{x + 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 5.17, size = 20, normalized size = 0.95 \begin {gather*} \frac {{\mathrm {e}}^x-x\,\left ({\mathrm {e}}^4-3\right )}{x^2+3\,x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.13, size = 17, normalized size = 0.81 \begin {gather*} \frac {e^{x}}{x^{2} + 3 x} - \frac {-3 + e^{4}}{x + 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

exp(x)/(x**2 + 3*x) - (-3 + exp(4))/(x + 3)

________________________________________________________________________________________