\(\int \frac {50+60 x+12 x^2+e^{2 x} (72-108 x+27 x^2)+e^x (-120+18 x+63 x^2)}{25+20 x+4 x^2+e^{2 x} (36-36 x+9 x^2)+e^x (-60+6 x+12 x^2)} \, dx\) [996]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 83, antiderivative size = 22 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=x \left (2+\frac {x}{-2+\frac {3}{\frac {2}{3}+e^x}+x}\right ) \]

[Out]

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

Rubi [F]

\[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=\int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx \]

[In]

Int[(50 + 60*x + 12*x^2 + E^(2*x)*(72 - 108*x + 27*x^2) + E^x*(-120 + 18*x + 63*x^2))/(25 + 20*x + 4*x^2 + E^(
2*x)*(36 - 36*x + 9*x^2) + E^x*(-60 + 6*x + 12*x^2)),x]

[Out]

-4/(2 - x) + 3*x - 243*Defer[Int][(5 - 6*E^x + 2*x + 3*E^x*x)^(-2), x] - 324*Defer[Int][1/((-2 + x)^2*(5 - 6*E
^x + 2*x + 3*E^x*x)^2), x] - 648*Defer[Int][1/((-2 + x)*(5 - 6*E^x + 2*x + 3*E^x*x)^2), x] - 81*Defer[Int][x/(
5 - 6*E^x + 2*x + 3*E^x*x)^2, x] - 18*Defer[Int][x^2/(5 - 6*E^x + 2*x + 3*E^x*x)^2, x] + 18*Defer[Int][(5 - 6*
E^x + 2*x + 3*E^x*x)^(-1), x] + 72*Defer[Int][1/((-2 + x)^2*(5 - 6*E^x + 2*x + 3*E^x*x)), x] + 72*Defer[Int][1
/((-2 + x)*(5 - 6*E^x + 2*x + 3*E^x*x)), x] + 9*Defer[Int][x/(5 - 6*E^x + 2*x + 3*E^x*x), x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {50+60 x+12 x^2+9 e^{2 x} \left (8-12 x+3 x^2\right )+3 e^x \left (-40+6 x+21 x^2\right )}{\left (5+3 e^x (-2+x)+2 x\right )^2} \, dx \\ & = \int \left (\frac {9 x \left (4-2 x+x^2\right )}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )}-\frac {9 x^2 \left (-1+x+2 x^2\right )}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )^2}+\frac {8-12 x+3 x^2}{(-2+x)^2}\right ) \, dx \\ & = 9 \int \frac {x \left (4-2 x+x^2\right )}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )} \, dx-9 \int \frac {x^2 \left (-1+x+2 x^2\right )}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )^2} \, dx+\int \frac {8-12 x+3 x^2}{(-2+x)^2} \, dx \\ & = -\left (9 \int \left (\frac {27}{\left (5-6 e^x+2 x+3 e^x x\right )^2}+\frac {36}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )^2}+\frac {72}{(-2+x) \left (5-6 e^x+2 x+3 e^x x\right )^2}+\frac {9 x}{\left (5-6 e^x+2 x+3 e^x x\right )^2}+\frac {2 x^2}{\left (5-6 e^x+2 x+3 e^x x\right )^2}\right ) \, dx\right )+9 \int \left (\frac {2}{5-6 e^x+2 x+3 e^x x}+\frac {8}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )}+\frac {8}{(-2+x) \left (5-6 e^x+2 x+3 e^x x\right )}+\frac {x}{5-6 e^x+2 x+3 e^x x}\right ) \, dx+\int \left (3-\frac {4}{(-2+x)^2}\right ) \, dx \\ & = -\frac {4}{2-x}+3 x+9 \int \frac {x}{5-6 e^x+2 x+3 e^x x} \, dx-18 \int \frac {x^2}{\left (5-6 e^x+2 x+3 e^x x\right )^2} \, dx+18 \int \frac {1}{5-6 e^x+2 x+3 e^x x} \, dx+72 \int \frac {1}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )} \, dx+72 \int \frac {1}{(-2+x) \left (5-6 e^x+2 x+3 e^x x\right )} \, dx-81 \int \frac {x}{\left (5-6 e^x+2 x+3 e^x x\right )^2} \, dx-243 \int \frac {1}{\left (5-6 e^x+2 x+3 e^x x\right )^2} \, dx-324 \int \frac {1}{(-2+x)^2 \left (5-6 e^x+2 x+3 e^x x\right )^2} \, dx-648 \int \frac {1}{(-2+x) \left (5-6 e^x+2 x+3 e^x x\right )^2} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 2.47 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.64 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=\frac {4}{-2+x}+3 x-\frac {9 x^2}{(-2+x) \left (5+3 e^x (-2+x)+2 x\right )} \]

[In]

Integrate[(50 + 60*x + 12*x^2 + E^(2*x)*(72 - 108*x + 27*x^2) + E^x*(-120 + 18*x + 63*x^2))/(25 + 20*x + 4*x^2
 + E^(2*x)*(36 - 36*x + 9*x^2) + E^x*(-60 + 6*x + 12*x^2)),x]

[Out]

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

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.73

method result size
risch \(3 x +\frac {4}{-2+x}-\frac {9 x^{2}}{\left (-2+x \right ) \left (3 \,{\mathrm e}^{x} x -6 \,{\mathrm e}^{x}+2 x +5\right )}\) \(38\)
norman \(\frac {-24 \,{\mathrm e}^{x}+18 x +6 x^{2}+9 \,{\mathrm e}^{x} x^{2}+20}{3 \,{\mathrm e}^{x} x -6 \,{\mathrm e}^{x}+2 x +5}\) \(39\)
parallelrisch \(\frac {27 \,{\mathrm e}^{x} x^{2}+60+18 x^{2}+54 x -72 \,{\mathrm e}^{x}}{9 \,{\mathrm e}^{x} x -18 \,{\mathrm e}^{x}+6 x +15}\) \(40\)

[In]

int(((27*x^2-108*x+72)*exp(x)^2+(63*x^2+18*x-120)*exp(x)+12*x^2+60*x+50)/((9*x^2-36*x+36)*exp(x)^2+(12*x^2+6*x
-60)*exp(x)+4*x^2+20*x+25),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.77 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=\frac {6 \, x^{2} + 3 \, {\left (3 \, x^{2} - 6 \, x + 4\right )} e^{x} + 6 \, x - 10}{3 \, {\left (x - 2\right )} e^{x} + 2 \, x + 5} \]

[In]

integrate(((27*x^2-108*x+72)*exp(x)^2+(63*x^2+18*x-120)*exp(x)+12*x^2+60*x+50)/((9*x^2-36*x+36)*exp(x)^2+(12*x
^2+6*x-60)*exp(x)+4*x^2+20*x+25),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.13 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.55 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=- \frac {9 x^{2}}{2 x^{2} + x + \left (3 x^{2} - 12 x + 12\right ) e^{x} - 10} + 3 x + \frac {4}{x - 2} \]

[In]

integrate(((27*x**2-108*x+72)*exp(x)**2+(63*x**2+18*x-120)*exp(x)+12*x**2+60*x+50)/((9*x**2-36*x+36)*exp(x)**2
+(12*x**2+6*x-60)*exp(x)+4*x**2+20*x+25),x)

[Out]

-9*x**2/(2*x**2 + x + (3*x**2 - 12*x + 12)*exp(x) - 10) + 3*x + 4/(x - 2)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.77 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=\frac {6 \, x^{2} + 3 \, {\left (3 \, x^{2} - 6 \, x + 4\right )} e^{x} + 6 \, x - 10}{3 \, {\left (x - 2\right )} e^{x} + 2 \, x + 5} \]

[In]

integrate(((27*x^2-108*x+72)*exp(x)^2+(63*x^2+18*x-120)*exp(x)+12*x^2+60*x+50)/((9*x^2-36*x+36)*exp(x)^2+(12*x
^2+6*x-60)*exp(x)+4*x^2+20*x+25),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.95 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=\frac {9 \, x^{2} e^{x} + 6 \, x^{2} - 18 \, x e^{x} + 6 \, x + 12 \, e^{x} - 10}{3 \, x e^{x} + 2 \, x - 6 \, e^{x} + 5} \]

[In]

integrate(((27*x^2-108*x+72)*exp(x)^2+(63*x^2+18*x-120)*exp(x)+12*x^2+60*x+50)/((9*x^2-36*x+36)*exp(x)^2+(12*x
^2+6*x-60)*exp(x)+4*x^2+20*x+25),x, algorithm="giac")

[Out]

(9*x^2*e^x + 6*x^2 - 18*x*e^x + 6*x + 12*e^x - 10)/(3*x*e^x + 2*x - 6*e^x + 5)

Mupad [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.45 \[ \int \frac {50+60 x+12 x^2+e^{2 x} \left (72-108 x+27 x^2\right )+e^x \left (-120+18 x+63 x^2\right )}{25+20 x+4 x^2+e^{2 x} \left (36-36 x+9 x^2\right )+e^x \left (-60+6 x+12 x^2\right )} \, dx=\frac {x\,\left (6\,x-12\,{\mathrm {e}}^x+9\,x\,{\mathrm {e}}^x+10\right )}{2\,x-6\,{\mathrm {e}}^x+3\,x\,{\mathrm {e}}^x+5} \]

[In]

int((60*x + exp(2*x)*(27*x^2 - 108*x + 72) + exp(x)*(18*x + 63*x^2 - 120) + 12*x^2 + 50)/(20*x + exp(2*x)*(9*x
^2 - 36*x + 36) + exp(x)*(6*x + 12*x^2 - 60) + 4*x^2 + 25),x)

[Out]

(x*(6*x - 12*exp(x) + 9*x*exp(x) + 10))/(2*x - 6*exp(x) + 3*x*exp(x) + 5)