\(\int \frac {16-8 x+x^2+e^{3 x} (-13 x+3 x^2)}{16 x-8 x^2+x^3} \, dx\) [2594]

   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 = 38, antiderivative size = 28 \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=4-e^2+\frac {e^{3 x}}{-4+x}+\log \left (-x+\frac {x}{e^4}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.61, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {1608, 27, 6874, 2228} \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\log (x)-\frac {e^{3 x}}{4-x} \]

[In]

Int[(16 - 8*x + x^2 + E^(3*x)*(-13*x + 3*x^2))/(16*x - 8*x^2 + x^3),x]

[Out]

-(E^(3*x)/(4 - x)) + Log[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 1608

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 2228

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[g*u^(m + 1)*(F^(c*v)/(b*c*
e*Log[F])), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, 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 {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{x \left (16-8 x+x^2\right )} \, dx \\ & = \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{(-4+x)^2 x} \, dx \\ & = \int \left (\frac {1}{x}+\frac {e^{3 x} (-13+3 x)}{(-4+x)^2}\right ) \, dx \\ & = \log (x)+\int \frac {e^{3 x} (-13+3 x)}{(-4+x)^2} \, dx \\ & = -\frac {e^{3 x}}{4-x}+\log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.41 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.50 \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\frac {e^{3 x}}{-4+x}+\log (x) \]

[In]

Integrate[(16 - 8*x + x^2 + E^(3*x)*(-13*x + 3*x^2))/(16*x - 8*x^2 + x^3),x]

[Out]

E^(3*x)/(-4 + x) + Log[x]

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.50

method result size
norman \(\frac {{\mathrm e}^{3 x}}{x -4}+\ln \left (x \right )\) \(14\)
risch \(\frac {{\mathrm e}^{3 x}}{x -4}+\ln \left (x \right )\) \(14\)
parts \(\ln \left (x \right )+\frac {3 \,{\mathrm e}^{3 x}}{3 x -12}\) \(17\)
derivativedivides \(\ln \left (3 x \right )+\frac {3 \,{\mathrm e}^{3 x}}{3 x -12}\) \(19\)
default \(\ln \left (3 x \right )+\frac {3 \,{\mathrm e}^{3 x}}{3 x -12}\) \(19\)
parallelrisch \(\frac {x \ln \left (x \right )-4 \ln \left (x \right )+{\mathrm e}^{3 x}}{x -4}\) \(20\)

[In]

int(((3*x^2-13*x)*exp(3*x)+x^2-8*x+16)/(x^3-8*x^2+16*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.61 \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\frac {{\left (x - 4\right )} \log \left (x\right ) + e^{\left (3 \, x\right )}}{x - 4} \]

[In]

integrate(((3*x^2-13*x)*exp(3*x)+x^2-8*x+16)/(x^3-8*x^2+16*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.36 \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\log {\left (x \right )} + \frac {e^{3 x}}{x - 4} \]

[In]

integrate(((3*x**2-13*x)*exp(3*x)+x**2-8*x+16)/(x**3-8*x**2+16*x),x)

[Out]

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

Maxima [F]

\[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\int { \frac {x^{2} + {\left (3 \, x^{2} - 13 \, x\right )} e^{\left (3 \, x\right )} - 8 \, x + 16}{x^{3} - 8 \, x^{2} + 16 \, x} \,d x } \]

[In]

integrate(((3*x^2-13*x)*exp(3*x)+x^2-8*x+16)/(x^3-8*x^2+16*x),x, algorithm="maxima")

[Out]

x*e^(3*x)/(x^2 - 8*x + 16) + 13*e^12*exp_integral_e(2, -3*x + 12)/(x - 4) + 3*integrate(1/3*(x + 4)*e^(3*x)/(x
^3 - 12*x^2 + 48*x - 64), x) + log(x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.68 \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\frac {x \log \left (x\right ) + e^{\left (3 \, x\right )} - 4 \, \log \left (x\right )}{x - 4} \]

[In]

integrate(((3*x^2-13*x)*exp(3*x)+x^2-8*x+16)/(x^3-8*x^2+16*x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.46 \[ \int \frac {16-8 x+x^2+e^{3 x} \left (-13 x+3 x^2\right )}{16 x-8 x^2+x^3} \, dx=\ln \left (x\right )+\frac {{\mathrm {e}}^{3\,x}}{x-4} \]

[In]

int(-(8*x + exp(3*x)*(13*x - 3*x^2) - x^2 - 16)/(16*x - 8*x^2 + x^3),x)

[Out]

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