\(\int \frac {16+144 x+36 x^2+e^2 x^2+e (-8 x-20 x^2)}{16+16 x+4 x^2+e^2 x^2+e (-8 x-4 x^2)} \, dx\) [4555]

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

Optimal result

Integrand size = 59, antiderivative size = 20 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=2+x+\frac {16 x}{1-e+\frac {4+x}{x}} \]

[Out]

16*x/((4+x)/x-exp(1)+1)+2+x

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.75, number of steps used = 7, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.068, Rules used = {6, 2009, 27, 697} \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=\frac {(18-e) x}{2-e}+\frac {256}{(2-e)^2 ((2-e) x+4)} \]

[In]

Int[(16 + 144*x + 36*x^2 + E^2*x^2 + E*(-8*x - 20*x^2))/(16 + 16*x + 4*x^2 + E^2*x^2 + E*(-8*x - 4*x^2)),x]

[Out]

((18 - E)*x)/(2 - E) + 256/((2 - E)^2*(4 + (2 - E)*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 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 2009

Int[(u_)^(p_.)*(v_)^(q_.), x_Symbol] :> Int[ExpandToSum[u, x]^p*ExpandToSum[v, x]^q, x] /; FreeQ[{p, q}, x] &&
 QuadraticQ[{u, v}, x] &&  !QuadraticMatchQ[{u, v}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {16+144 x+\left (36+e^2\right ) x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx \\ & = \int \frac {16+144 x+\left (36+e^2\right ) x^2+e \left (-8 x-20 x^2\right )}{16+16 x+\left (4+e^2\right ) x^2+e \left (-8 x-4 x^2\right )} \, dx \\ & = \int \frac {16+8 (18-e) x+(2-e) (18-e) x^2}{16+8 (2-e) x+(2-e)^2 x^2} \, dx \\ & = \int \frac {16+8 (18-e) x+(2-e) (18-e) x^2}{(-4-2 x+e x)^2} \, dx \\ & = \int \frac {16+8 (18-e) x+(2-e) (18-e) x^2}{(-4+(-2+e) x)^2} \, dx \\ & = \int \left (\frac {-18+e}{-2+e}+\frac {256}{(-2+e) (4+(2-e) x)^2}\right ) \, dx \\ & = \frac {(18-e) x}{2-e}+\frac {256}{(2-e)^2 (4+(2-e) x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.40 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=\frac {(-18+e) x}{-2+e}-\frac {256}{(-2+e)^2 (-4-2 x+e x)} \]

[In]

Integrate[(16 + 144*x + 36*x^2 + E^2*x^2 + E*(-8*x - 20*x^2))/(16 + 16*x + 4*x^2 + E^2*x^2 + E*(-8*x - 4*x^2))
,x]

[Out]

((-18 + E)*x)/(-2 + E) - 256/((-2 + E)^2*(-4 - 2*x + E*x))

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.15

method result size
gosper \(\frac {x \left (x \,{\mathrm e}-18 x -4\right )}{x \,{\mathrm e}-2 x -4}\) \(23\)
norman \(\frac {\left ({\mathrm e}-18\right ) x^{2}-4 x}{x \,{\mathrm e}-2 x -4}\) \(25\)
parallelrisch \(\frac {4 x^{2} {\mathrm e}-72 x^{2}-16 x}{4 x \,{\mathrm e}-8 x -16}\) \(30\)
risch \(\frac {x \,{\mathrm e}}{{\mathrm e}-2}-\frac {18 x}{{\mathrm e}-2}-\frac {256}{\left ({\mathrm e}-2\right )^{2} \left (x \,{\mathrm e}-2 x -4\right )}\) \(40\)
meijerg \(\frac {\left ({\mathrm e}-2\right )^{2} x}{\left ({\mathrm e}^{2}-4 \,{\mathrm e}+4\right ) \left (1+\frac {x \left (2-{\mathrm e}\right )}{4}\right )}+\frac {64 \left (\frac {{\mathrm e}^{2}}{16}-\frac {5 \,{\mathrm e}}{4}+\frac {9}{4}\right ) \left ({\mathrm e}-2\right )^{2} \left (\frac {x \left (2-{\mathrm e}\right ) \left (\frac {3 x \left (2-{\mathrm e}\right )}{4}+6\right )}{12+3 x \left (2-{\mathrm e}\right )}-2 \ln \left (1+\frac {x \left (2-{\mathrm e}\right )}{4}\right )\right )}{\left (2-{\mathrm e}\right )^{3} \left ({\mathrm e}^{2}-4 \,{\mathrm e}+4\right )}+\frac {16 \left (-\frac {{\mathrm e}}{2}+9\right ) \left ({\mathrm e}-2\right )^{2} \left (-\frac {x \left (2-{\mathrm e}\right )}{4 \left (1+\frac {x \left (2-{\mathrm e}\right )}{4}\right )}+\ln \left (1+\frac {x \left (2-{\mathrm e}\right )}{4}\right )\right )}{\left (2-{\mathrm e}\right )^{2} \left ({\mathrm e}^{2}-4 \,{\mathrm e}+4\right )}\) \(184\)

[In]

int((x^2*exp(1)^2+(-20*x^2-8*x)*exp(1)+36*x^2+144*x+16)/(x^2*exp(1)^2+(-4*x^2-8*x)*exp(1)+4*x^2+16*x+16),x,met
hod=_RETURNVERBOSE)

[Out]

x*(x*exp(1)-18*x-4)/(x*exp(1)-2*x-4)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 72 vs. \(2 (21) = 42\).

Time = 0.23 (sec) , antiderivative size = 72, normalized size of antiderivative = 3.60 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=\frac {x^{2} e^{3} - 72 \, x^{2} - 2 \, {\left (11 \, x^{2} + 2 \, x\right )} e^{2} + 4 \, {\left (19 \, x^{2} + 20 \, x\right )} e - 144 \, x - 256}{x e^{3} - 2 \, {\left (3 \, x + 2\right )} e^{2} + 4 \, {\left (3 \, x + 4\right )} e - 8 \, x - 16} \]

[In]

integrate((x^2*exp(1)^2+(-20*x^2-8*x)*exp(1)+36*x^2+144*x+16)/(x^2*exp(1)^2+(-4*x^2-8*x)*exp(1)+4*x^2+16*x+16)
,x, algorithm="fricas")

[Out]

(x^2*e^3 - 72*x^2 - 2*(11*x^2 + 2*x)*e^2 + 4*(19*x^2 + 20*x)*e - 144*x - 256)/(x*e^3 - 2*(3*x + 2)*e^2 + 4*(3*
x + 4)*e - 8*x - 16)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (15) = 30\).

Time = 0.15 (sec) , antiderivative size = 46, normalized size of antiderivative = 2.30 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=x \left (- \frac {18}{-2 + e} + \frac {e}{-2 + e}\right ) - \frac {256}{x \left (- 6 e^{2} - 8 + e^{3} + 12 e\right ) - 4 e^{2} - 16 + 16 e} \]

[In]

integrate((x**2*exp(1)**2+(-20*x**2-8*x)*exp(1)+36*x**2+144*x+16)/(x**2*exp(1)**2+(-4*x**2-8*x)*exp(1)+4*x**2+
16*x+16),x)

[Out]

x*(-18/(-2 + E) + E/(-2 + E)) - 256/(x*(-6*exp(2) - 8 + exp(3) + 12*E) - 4*exp(2) - 16 + 16*E)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 41, normalized size of antiderivative = 2.05 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=\frac {x {\left (e - 18\right )}}{e - 2} - \frac {256}{x {\left (e^{3} - 6 \, e^{2} + 12 \, e - 8\right )} - 4 \, e^{2} + 16 \, e - 16} \]

[In]

integrate((x^2*exp(1)^2+(-20*x^2-8*x)*exp(1)+36*x^2+144*x+16)/(x^2*exp(1)^2+(-4*x^2-8*x)*exp(1)+4*x^2+16*x+16)
,x, algorithm="maxima")

[Out]

x*(e - 18)/(e - 2) - 256/(x*(e^3 - 6*e^2 + 12*e - 8) - 4*e^2 + 16*e - 16)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 48 vs. \(2 (21) = 42\).

Time = 0.26 (sec) , antiderivative size = 48, normalized size of antiderivative = 2.40 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=\frac {x e^{2} - 20 \, x e + 36 \, x}{e^{2} - 4 \, e + 4} - \frac {256}{{\left (x e - 2 \, x - 4\right )} {\left (e^{2} - 4 \, e + 4\right )}} \]

[In]

integrate((x^2*exp(1)^2+(-20*x^2-8*x)*exp(1)+36*x^2+144*x+16)/(x^2*exp(1)^2+(-4*x^2-8*x)*exp(1)+4*x^2+16*x+16)
,x, algorithm="giac")

[Out]

(x*e^2 - 20*x*e + 36*x)/(e^2 - 4*e + 4) - 256/((x*e - 2*x - 4)*(e^2 - 4*e + 4))

Mupad [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 43, normalized size of antiderivative = 2.15 \[ \int \frac {16+144 x+36 x^2+e^2 x^2+e \left (-8 x-20 x^2\right )}{16+16 x+4 x^2+e^2 x^2+e \left (-8 x-4 x^2\right )} \, dx=\frac {x\,\left ({\mathrm {e}}^2-20\,\mathrm {e}+36\right )}{{\left (\mathrm {e}-2\right )}^2}-\frac {256}{\left (\mathrm {e}-2\right )\,\left (x\,\left ({\mathrm {e}}^2-4\,\mathrm {e}+4\right )-4\,\mathrm {e}+8\right )} \]

[In]

int((144*x - exp(1)*(8*x + 20*x^2) + x^2*exp(2) + 36*x^2 + 16)/(16*x - exp(1)*(8*x + 4*x^2) + x^2*exp(2) + 4*x
^2 + 16),x)

[Out]

(x*(exp(2) - 20*exp(1) + 36))/(exp(1) - 2)^2 - 256/((exp(1) - 2)*(x*(exp(2) - 4*exp(1) + 4) - 4*exp(1) + 8))