\(\int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x (-12-8 x+8 x^2)}{3 x^2+e^{2 x} (1+x)+e^x (3+3 x+x^2)} \, dx\) [4316]

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

Optimal result

Integrand size = 61, antiderivative size = 29 \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=4 \log \left (\frac {9 \left (3+e^x\right )}{4 x \left (1+\frac {1}{x}+e^{-x} x\right )}\right ) \]

[Out]

4*ln(9/4*(3+exp(x))/(1+x/exp(x)+1/x)/x)

Rubi [F]

\[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=\int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

Time = 3.75 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.86 \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=4 \left (x+\log \left (3+e^x\right )-\log \left (e^x+e^x x+x^2\right )\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.86

method result size
norman \(4 x +4 \ln \left (3+{\mathrm e}^{x}\right )-4 \ln \left (x^{2}+{\mathrm e}^{x} x +{\mathrm e}^{x}\right )\) \(25\)
parallelrisch \(4 x +4 \ln \left (3+{\mathrm e}^{x}\right )-4 \ln \left (x^{2}+{\mathrm e}^{x} x +{\mathrm e}^{x}\right )\) \(25\)
risch \(4 x -4 \ln \left (1+x \right )+4 \ln \left (3+{\mathrm e}^{x}\right )-4 \ln \left ({\mathrm e}^{x}+\frac {x^{2}}{1+x}\right )\) \(33\)

[In]

int((4*x*exp(x)^2+(8*x^2-8*x-12)*exp(x)+12*x^2-24*x)/((1+x)*exp(x)^2+(x^2+3*x+3)*exp(x)+3*x^2),x,method=_RETUR
NVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.24 \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=4 \, x - 4 \, \log \left (x + 1\right ) - 4 \, \log \left (\frac {x^{2} + {\left (x + 1\right )} e^{x}}{x + 1}\right ) + 4 \, \log \left (e^{x} + 3\right ) \]

[In]

integrate((4*x*exp(x)^2+(8*x^2-8*x-12)*exp(x)+12*x^2-24*x)/((1+x)*exp(x)^2+(x^2+3*x+3)*exp(x)+3*x^2),x, algori
thm="fricas")

[Out]

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

Sympy [F(-2)]

Exception generated. \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=\text {Exception raised: PolynomialError} \]

[In]

integrate((4*x*exp(x)**2+(8*x**2-8*x-12)*exp(x)+12*x**2-24*x)/((1+x)*exp(x)**2+(x**2+3*x+3)*exp(x)+3*x**2),x)

[Out]

Exception raised: PolynomialError >> 1/(x**2 + 2*x + 1) contains an element of the set of generators.

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.24 \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=4 \, x - 4 \, \log \left (x + 1\right ) - 4 \, \log \left (\frac {x^{2} + {\left (x + 1\right )} e^{x}}{x + 1}\right ) + 4 \, \log \left (e^{x} + 3\right ) \]

[In]

integrate((4*x*exp(x)^2+(8*x^2-8*x-12)*exp(x)+12*x^2-24*x)/((1+x)*exp(x)^2+(x^2+3*x+3)*exp(x)+3*x^2),x, algori
thm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.83 \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=4 \, x - 4 \, \log \left (x^{2} + x e^{x} + e^{x}\right ) + 4 \, \log \left (e^{x} + 3\right ) \]

[In]

integrate((4*x*exp(x)^2+(8*x^2-8*x-12)*exp(x)+12*x^2-24*x)/((1+x)*exp(x)^2+(x^2+3*x+3)*exp(x)+3*x^2),x, algori
thm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.83 \[ \int \frac {-24 x+4 e^{2 x} x+12 x^2+e^x \left (-12-8 x+8 x^2\right )}{3 x^2+e^{2 x} (1+x)+e^x \left (3+3 x+x^2\right )} \, dx=4\,x-4\,\ln \left ({\mathrm {e}}^x+x\,{\mathrm {e}}^x+x^2\right )+4\,\ln \left ({\mathrm {e}}^x+3\right ) \]

[In]

int(-(24*x - 4*x*exp(2*x) + exp(x)*(8*x - 8*x^2 + 12) - 12*x^2)/(exp(x)*(3*x + x^2 + 3) + exp(2*x)*(x + 1) + 3
*x^2),x)

[Out]

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