\(\int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx\) [5031]

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

Optimal result

Integrand size = 26, antiderivative size = 23 \[ \int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx=-2+x+\frac {1}{3} \left (\frac {13-e+e^{2 x}}{x}+x\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.30, number of steps used = 6, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {12, 14, 2228} \[ \int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx=\frac {4 x}{3}+\frac {e^{2 x}}{3 x}+\frac {13-e}{3 x} \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

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
]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx=\frac {13-e+e^{2 x}+4 x^2}{3 x} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91

method result size
parallelrisch \(-\frac {-4 x^{2}-13-{\mathrm e}^{2 x}+{\mathrm e}}{3 x}\) \(21\)
norman \(\frac {\frac {4 x^{2}}{3}+\frac {{\mathrm e}^{2 x}}{3}-\frac {{\mathrm e}}{3}+\frac {13}{3}}{x}\) \(22\)
parts \(\frac {4 x}{3}-\frac {{\mathrm e}-13}{3 x}+\frac {{\mathrm e}^{2 x}}{3 x}\) \(23\)
default \(\frac {4 x}{3}-\frac {{\mathrm e}}{3 x}+\frac {13}{3 x}+\frac {{\mathrm e}^{2 x}}{3 x}\) \(26\)
risch \(\frac {4 x}{3}-\frac {{\mathrm e}}{3 x}+\frac {13}{3 x}+\frac {{\mathrm e}^{2 x}}{3 x}\) \(26\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.87 \[ \int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx=\frac {4 x}{3} + \frac {e^{2 x}}{3 x} + \frac {13 - e}{3 x} \]

[In]

integrate(1/3*((-1+2*x)*exp(x)**2+exp(1)+4*x**2-13)/x**2,x)

[Out]

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

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.21 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.26 \[ \int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx=\frac {4}{3} \, x - \frac {e}{3 \, x} + \frac {13}{3 \, x} + \frac {2}{3} \, {\rm Ei}\left (2 \, x\right ) - \frac {2}{3} \, \Gamma \left (-1, -2 \, x\right ) \]

[In]

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

[Out]

4/3*x - 1/3*e/x + 13/3/x + 2/3*Ei(2*x) - 2/3*gamma(-1, -2*x)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.87 \[ \int \frac {-13+e+4 x^2+e^{2 x} (-1+2 x)}{3 x^2} \, dx=\frac {4\,x}{3}+\frac {\frac {{\mathrm {e}}^{2\,x}}{3}-\frac {\mathrm {e}}{3}+\frac {13}{3}}{x} \]

[In]

int((exp(1)/3 + (exp(2*x)*(2*x - 1))/3 + (4*x^2)/3 - 13/3)/x^2,x)

[Out]

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