\(\int \frac {-40 x-4 x^3+e (-8+14 x+2 x^2)+e^{x^2} (8-14 x-58 x^2+28 x^3)+(-12 x^2+e (-20+20 x-2 x^2)+e^{x^2} (20-20 x-38 x^2+28 x^3-4 x^4)) \log (x)}{4 x^2-4 x^3+x^4} \, dx\) [1069]

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

Optimal result

Integrand size = 106, antiderivative size = 32 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=\frac {\left (4+\frac {2 \left (-e+e^{x^2}\right )}{x}\right ) (7+(5-x) \log (x))}{-2+x} \] Output:

(7+ln(x)*(5-x))*(4+2*(exp(x^2)-exp(1))/x)/(-2+x)
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.94 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=-\frac {2 \left (-e+e^{x^2}+2 x\right ) (-7+(-5+x) \log (x))}{(-2+x) x} \] Input:

Integrate[(-40*x - 4*x^3 + E*(-8 + 14*x + 2*x^2) + E^x^2*(8 - 14*x - 58*x^ 
2 + 28*x^3) + (-12*x^2 + E*(-20 + 20*x - 2*x^2) + E^x^2*(20 - 20*x - 38*x^ 
2 + 28*x^3 - 4*x^4))*Log[x])/(4*x^2 - 4*x^3 + x^4),x]
 

Output:

(-2*(-E + E^x^2 + 2*x)*(-7 + (-5 + x)*Log[x]))/((-2 + x)*x)
 

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(140\) vs. \(2(32)=64\).

Time = 3.57 (sec) , antiderivative size = 140, normalized size of antiderivative = 4.38, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.047, Rules used = {2026, 7277, 27, 7293, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {-4 x^3+e \left (2 x^2+14 x-8\right )+e^{x^2} \left (28 x^3-58 x^2-14 x+8\right )+\left (-12 x^2+e \left (-2 x^2+20 x-20\right )+e^{x^2} \left (-4 x^4+28 x^3-38 x^2-20 x+20\right )\right ) \log (x)-40 x}{x^4-4 x^3+4 x^2} \, dx\)

\(\Big \downarrow \) 2026

\(\displaystyle \int \frac {-4 x^3+e \left (2 x^2+14 x-8\right )+e^{x^2} \left (28 x^3-58 x^2-14 x+8\right )+\left (-12 x^2+e \left (-2 x^2+20 x-20\right )+e^{x^2} \left (-4 x^4+28 x^3-38 x^2-20 x+20\right )\right ) \log (x)-40 x}{x^2 \left (x^2-4 x+4\right )}dx\)

\(\Big \downarrow \) 7277

\(\displaystyle 4 \int -\frac {2 x^3+20 x+e \left (-x^2-7 x+4\right )-e^{x^2} \left (14 x^3-29 x^2-7 x+4\right )+\left (6 x^2+e \left (x^2-10 x+10\right )-e^{x^2} \left (-2 x^4+14 x^3-19 x^2-10 x+10\right )\right ) \log (x)}{2 (2-x)^2 x^2}dx\)

\(\Big \downarrow \) 27

\(\displaystyle -2 \int \frac {2 x^3+20 x+e \left (-x^2-7 x+4\right )-e^{x^2} \left (14 x^3-29 x^2-7 x+4\right )+\left (6 x^2+e \left (x^2-10 x+10\right )-e^{x^2} \left (-2 x^4+14 x^3-19 x^2-10 x+10\right )\right ) \log (x)}{(2-x)^2 x^2}dx\)

\(\Big \downarrow \) 7293

\(\displaystyle -2 \int \left (\frac {2 x}{(x-2)^2}+\frac {6 \log (x)}{(x-2)^2}+\frac {20}{(x-2)^2 x}-\frac {e \left (x^2+7 x-4\right )}{(x-2)^2 x^2}+\frac {e \left (x^2-10 x+10\right ) \log (x)}{(x-2)^2 x^2}+\frac {e^{x^2} \left (2 \log (x) x^4-14 \log (x) x^3-14 x^3+19 \log (x) x^2+29 x^2+10 \log (x) x+7 x-10 \log (x)-4\right )}{(x-2)^2 x^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -2 \left (\frac {7 e^{x^2}}{2 (2-x)}+\frac {7 e^{x^2}}{2 x}+\frac {3 e^{x^2} \log (x)}{2 (2-x)}+\frac {5 e^{x^2} \log (x)}{2 x}-\frac {7 e}{2 (2-x)}+\frac {14}{2-x}-\frac {7 e}{2 x}-\frac {3 e x \log (x)}{4 (2-x)}+\frac {3 x \log (x)}{2-x}-\frac {5 e \log (x)}{2 x}-\frac {3}{4} e \log (x)+5 \log (x)\right )\)

Input:

Int[(-40*x - 4*x^3 + E*(-8 + 14*x + 2*x^2) + E^x^2*(8 - 14*x - 58*x^2 + 28 
*x^3) + (-12*x^2 + E*(-20 + 20*x - 2*x^2) + E^x^2*(20 - 20*x - 38*x^2 + 28 
*x^3 - 4*x^4))*Log[x])/(4*x^2 - 4*x^3 + x^4),x]
 

Output:

-2*(14/(2 - x) - (7*E)/(2*(2 - x)) + (7*E^x^2)/(2*(2 - x)) - (7*E)/(2*x) + 
 (7*E^x^2)/(2*x) + 5*Log[x] - (3*E*Log[x])/4 + (3*E^x^2*Log[x])/(2*(2 - x) 
) - (5*E*Log[x])/(2*x) + (5*E^x^2*Log[x])/(2*x) + (3*x*Log[x])/(2 - x) - ( 
3*E*x*Log[x])/(4*(2 - x)))
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2026
Int[(Fx_.)*(Px_)^(p_.), x_Symbol] :> With[{r = Expon[Px, x, Min]}, Int[x^(p 
*r)*ExpandToSum[Px/x^r, x]^p*Fx, x] /; IGtQ[r, 0]] /; PolyQ[Px, x] && Integ 
erQ[p] &&  !MonomialQ[Px, x] && (ILtQ[p, 0] ||  !PolyQ[u, x])
 

rule 7277
Int[(u_)*((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.))^(p_.), x_Symbol] :> 
 Simp[1/(4^p*c^p)   Int[u*(b + 2*c*x^n)^(2*p), x], x] /; FreeQ[{a, b, c, n} 
, x] && EqQ[n2, 2*n] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p] &&  !AlgebraicFu 
nctionQ[u, x]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [A] (verified)

Time = 32.78 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.00

method result size
norman \(\frac {28 x -4 x^{2} \ln \left (x \right )+\left (2 \,{\mathrm e}+20\right ) x \ln \left (x \right )-10 \,{\mathrm e} \ln \left (x \right )+10 \,{\mathrm e}^{x^{2}} \ln \left (x \right )-2 x \,{\mathrm e}^{x^{2}} \ln \left (x \right )-14 \,{\mathrm e}+14 \,{\mathrm e}^{x^{2}}}{\left (-2+x \right ) x}\) \(64\)
parallelrisch \(\frac {2 x \,{\mathrm e} \ln \left (x \right )-4 x^{2} \ln \left (x \right )-2 x \,{\mathrm e}^{x^{2}} \ln \left (x \right )-10 \,{\mathrm e} \ln \left (x \right )+20 x \ln \left (x \right )+10 \,{\mathrm e}^{x^{2}} \ln \left (x \right )-14 \,{\mathrm e}+28 x +14 \,{\mathrm e}^{x^{2}}}{x \left (-2+x \right )}\) \(66\)
risch \(\frac {2 \left (x \,{\mathrm e}-{\mathrm e}^{x^{2}} x -5 \,{\mathrm e}+6 x +5 \,{\mathrm e}^{x^{2}}\right ) \ln \left (x \right )}{\left (-2+x \right ) x}-\frac {2 \left (2 x^{2} \ln \left (x \right )-4 x \ln \left (x \right )+7 \,{\mathrm e}-14 x -7 \,{\mathrm e}^{x^{2}}\right )}{\left (-2+x \right ) x}\) \(75\)
default \(\frac {10 \,{\mathrm e}^{x^{2}} \ln \left (x \right )-2 x \,{\mathrm e}^{x^{2}} \ln \left (x \right )+14 \,{\mathrm e}^{x^{2}}}{x \left (-2+x \right )}+2 \left (\frac {3 \,{\mathrm e}}{4}-5\right ) \ln \left (x \right )+\frac {2 \,{\mathrm e}}{x}+2 \left (-\frac {3 \,{\mathrm e}}{4}+3\right ) \ln \left (-2+x \right )-\frac {2 \left (\frac {7 \,{\mathrm e}}{2}-14\right )}{-2+x}-5 \,{\mathrm e} \left (-\frac {\ln \left (x \right )}{x}-\frac {1}{x}\right )-\left (-3 \,{\mathrm e}+12\right ) \left (\frac {\ln \left (-2+x \right )}{2}-\frac {\ln \left (x \right ) x}{2 \left (-2+x \right )}\right )\) \(119\)
parts \(\frac {10 \,{\mathrm e}^{x^{2}} \ln \left (x \right )-2 x \,{\mathrm e}^{x^{2}} \ln \left (x \right )+14 \,{\mathrm e}^{x^{2}}}{x \left (-2+x \right )}+2 \left (\frac {3 \,{\mathrm e}}{4}-5\right ) \ln \left (x \right )+\frac {2 \,{\mathrm e}}{x}+2 \left (-\frac {3 \,{\mathrm e}}{4}+3\right ) \ln \left (-2+x \right )-\frac {2 \left (\frac {7 \,{\mathrm e}}{2}-14\right )}{-2+x}-5 \,{\mathrm e} \left (-\frac {\ln \left (x \right )}{x}-\frac {1}{x}\right )-\left (-3 \,{\mathrm e}+12\right ) \left (\frac {\ln \left (-2+x \right )}{2}-\frac {\ln \left (x \right ) x}{2 \left (-2+x \right )}\right )\) \(119\)

Input:

int((((-4*x^4+28*x^3-38*x^2-20*x+20)*exp(x^2)+(-2*x^2+20*x-20)*exp(1)-12*x 
^2)*ln(x)+(28*x^3-58*x^2-14*x+8)*exp(x^2)+(2*x^2+14*x-8)*exp(1)-4*x^3-40*x 
)/(x^4-4*x^3+4*x^2),x,method=_RETURNVERBOSE)
 

Output:

(28*x-4*x^2*ln(x)+(2*exp(1)+20)*x*ln(x)-10*exp(1)*ln(x)+10*exp(x^2)*ln(x)- 
2*x*exp(x^2)*ln(x)-14*exp(1)+14*exp(x^2))/(-2+x)/x
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.62 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=-\frac {2 \, {\left ({\left (2 \, x^{2} - {\left (x - 5\right )} e + {\left (x - 5\right )} e^{\left (x^{2}\right )} - 10 \, x\right )} \log \left (x\right ) - 14 \, x + 7 \, e - 7 \, e^{\left (x^{2}\right )}\right )}}{x^{2} - 2 \, x} \] Input:

integrate((((-4*x^4+28*x^3-38*x^2-20*x+20)*exp(x^2)+(-2*x^2+20*x-20)*exp(1 
)-12*x^2)*log(x)+(28*x^3-58*x^2-14*x+8)*exp(x^2)+(2*x^2+14*x-8)*exp(1)-4*x 
^3-40*x)/(x^4-4*x^3+4*x^2),x, algorithm="fricas")
 

Output:

-2*((2*x^2 - (x - 5)*e + (x - 5)*e^(x^2) - 10*x)*log(x) - 14*x + 7*e - 7*e 
^(x^2))/(x^2 - 2*x)
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (26) = 52\).

Time = 0.40 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.19 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=- \frac {- 28 x + 14 e}{x^{2} - 2 x} - 4 \log {\left (x \right )} + \frac {\left (2 e x + 12 x - 10 e\right ) \log {\left (x \right )}}{x^{2} - 2 x} + \frac {\left (- 2 x \log {\left (x \right )} + 10 \log {\left (x \right )} + 14\right ) e^{x^{2}}}{x^{2} - 2 x} \] Input:

integrate((((-4*x**4+28*x**3-38*x**2-20*x+20)*exp(x**2)+(-2*x**2+20*x-20)* 
exp(1)-12*x**2)*ln(x)+(28*x**3-58*x**2-14*x+8)*exp(x**2)+(2*x**2+14*x-8)*e 
xp(1)-4*x**3-40*x)/(x**4-4*x**3+4*x**2),x)
 

Output:

-(-28*x + 14*E)/(x**2 - 2*x) - 4*log(x) + (2*E*x + 12*x - 10*E)*log(x)/(x* 
*2 - 2*x) + (-2*x*log(x) + 10*log(x) + 14)*exp(x**2)/(x**2 - 2*x)
 

Maxima [B] (verification not implemented)

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

Time = 0.09 (sec) , antiderivative size = 142, normalized size of antiderivative = 4.44 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=2 \, {\left (\frac {2 \, {\left (x - 1\right )}}{x^{2} - 2 \, x} + \log \left (x - 2\right ) - \log \left (x\right )\right )} e - \frac {7}{2} \, {\left (\frac {2}{x - 2} + \log \left (x - 2\right ) - \log \left (x\right )\right )} e + \frac {3}{2} \, {\left (e - 4\right )} \log \left (x - 2\right ) + \frac {10 \, x e - 4 \, {\left ({\left (x - 5\right )} \log \left (x\right ) - 7\right )} e^{\left (x^{2}\right )} - {\left (3 \, x^{2} {\left (e - 4\right )} - 10 \, x e + 20 \, e\right )} \log \left (x\right ) - 20 \, e}{2 \, {\left (x^{2} - 2 \, x\right )}} - \frac {2 \, e}{x - 2} + \frac {28}{x - 2} + 6 \, \log \left (x - 2\right ) - 10 \, \log \left (x\right ) \] Input:

integrate((((-4*x^4+28*x^3-38*x^2-20*x+20)*exp(x^2)+(-2*x^2+20*x-20)*exp(1 
)-12*x^2)*log(x)+(28*x^3-58*x^2-14*x+8)*exp(x^2)+(2*x^2+14*x-8)*exp(1)-4*x 
^3-40*x)/(x^4-4*x^3+4*x^2),x, algorithm="maxima")
 

Output:

2*(2*(x - 1)/(x^2 - 2*x) + log(x - 2) - log(x))*e - 7/2*(2/(x - 2) + log(x 
 - 2) - log(x))*e + 3/2*(e - 4)*log(x - 2) + 1/2*(10*x*e - 4*((x - 5)*log( 
x) - 7)*e^(x^2) - (3*x^2*(e - 4) - 10*x*e + 20*e)*log(x) - 20*e)/(x^2 - 2* 
x) - 2*e/(x - 2) + 28/(x - 2) + 6*log(x - 2) - 10*log(x)
 

Giac [B] (verification not implemented)

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

Time = 0.13 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.06 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=-\frac {2 \, {\left (2 \, x^{2} \log \left (x\right ) - x e \log \left (x\right ) + x e^{\left (x^{2}\right )} \log \left (x\right ) - 10 \, x \log \left (x\right ) + 5 \, e \log \left (x\right ) - 5 \, e^{\left (x^{2}\right )} \log \left (x\right ) - 14 \, x + 7 \, e - 7 \, e^{\left (x^{2}\right )}\right )}}{x^{2} - 2 \, x} \] Input:

integrate((((-4*x^4+28*x^3-38*x^2-20*x+20)*exp(x^2)+(-2*x^2+20*x-20)*exp(1 
)-12*x^2)*log(x)+(28*x^3-58*x^2-14*x+8)*exp(x^2)+(2*x^2+14*x-8)*exp(1)-4*x 
^3-40*x)/(x^4-4*x^3+4*x^2),x, algorithm="giac")
 

Output:

-2*(2*x^2*log(x) - x*e*log(x) + x*e^(x^2)*log(x) - 10*x*log(x) + 5*e*log(x 
) - 5*e^(x^2)*log(x) - 14*x + 7*e - 7*e^(x^2))/(x^2 - 2*x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=\int -\frac {40\,x-\mathrm {e}\,\left (2\,x^2+14\,x-8\right )+{\mathrm {e}}^{x^2}\,\left (-28\,x^3+58\,x^2+14\,x-8\right )+\ln \left (x\right )\,\left (\mathrm {e}\,\left (2\,x^2-20\,x+20\right )+{\mathrm {e}}^{x^2}\,\left (4\,x^4-28\,x^3+38\,x^2+20\,x-20\right )+12\,x^2\right )+4\,x^3}{x^4-4\,x^3+4\,x^2} \,d x \] Input:

int(-(40*x - exp(1)*(14*x + 2*x^2 - 8) + exp(x^2)*(14*x + 58*x^2 - 28*x^3 
- 8) + log(x)*(exp(1)*(2*x^2 - 20*x + 20) + exp(x^2)*(20*x + 38*x^2 - 28*x 
^3 + 4*x^4 - 20) + 12*x^2) + 4*x^3)/(4*x^2 - 4*x^3 + x^4),x)
 

Output:

int(-(40*x - exp(1)*(14*x + 2*x^2 - 8) + exp(x^2)*(14*x + 58*x^2 - 28*x^3 
- 8) + log(x)*(exp(1)*(2*x^2 - 20*x + 20) + exp(x^2)*(20*x + 38*x^2 - 28*x 
^3 + 4*x^4 - 20) + 12*x^2) + 4*x^3)/(4*x^2 - 4*x^3 + x^4), x)
                                                                                    
                                                                                    
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 67, normalized size of antiderivative = 2.09 \[ \int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{4 x^2-4 x^3+x^4} \, dx=\frac {-2 e^{x^{2}} \mathrm {log}\left (x \right ) x +10 e^{x^{2}} \mathrm {log}\left (x \right )+14 e^{x^{2}}+2 \,\mathrm {log}\left (x \right ) e x -10 \,\mathrm {log}\left (x \right ) e -4 \,\mathrm {log}\left (x \right ) x^{2}+20 \,\mathrm {log}\left (x \right ) x -14 e +14 x^{2}}{x \left (x -2\right )} \] Input:

int((((-4*x^4+28*x^3-38*x^2-20*x+20)*exp(x^2)+(-2*x^2+20*x-20)*exp(1)-12*x 
^2)*log(x)+(28*x^3-58*x^2-14*x+8)*exp(x^2)+(2*x^2+14*x-8)*exp(1)-4*x^3-40* 
x)/(x^4-4*x^3+4*x^2),x)
 

Output:

(2*( - e**(x**2)*log(x)*x + 5*e**(x**2)*log(x) + 7*e**(x**2) + log(x)*e*x 
- 5*log(x)*e - 2*log(x)*x**2 + 10*log(x)*x - 7*e + 7*x**2))/(x*(x - 2))