\(\int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+(e^2-6 x-2 x^2) \log (\frac {-e^2+6 x+2 x^2}{2 x})+\log (x) (-3 e^2+12 x+2 x^2+(e^2-6 x-2 x^2) \log (\frac {-e^2+6 x+2 x^2}{2 x}))}{e^2-6 x-2 x^2} \, dx\) [870]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [A] (verification not implemented)
Sympy [B] (verification not implemented)
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 125, antiderivative size = 28 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=-1+x-x^2+x \log (x) \left (-2+\log \left (3-\frac {e^2}{2 x}+x\right )\right ) \] Output:

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

Mathematica [A] (verified)

Time = 0.21 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.93 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=x \left (1-x+\log (x) \left (-2+\log \left (3-\frac {e^2}{2 x}+x\right )\right )\right ) \] Input:

Integrate[(E^2*(-1 - 2*x) + 6*x + 14*x^2 + 4*x^3 + (E^2 - 6*x - 2*x^2)*Log 
[(-E^2 + 6*x + 2*x^2)/(2*x)] + Log[x]*(-3*E^2 + 12*x + 2*x^2 + (E^2 - 6*x 
- 2*x^2)*Log[(-E^2 + 6*x + 2*x^2)/(2*x)]))/(E^2 - 6*x - 2*x^2),x]
 

Output:

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

Rubi [A] (verified)

Time = 1.09 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.07, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.016, Rules used = {7239, 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+14 x^2+\left (-2 x^2-6 x+e^2\right ) \log \left (\frac {2 x^2+6 x-e^2}{2 x}\right )+\log (x) \left (2 x^2+\left (-2 x^2-6 x+e^2\right ) \log \left (\frac {2 x^2+6 x-e^2}{2 x}\right )+12 x-3 e^2\right )+6 x+e^2 (-2 x-1)}{-2 x^2-6 x+e^2} \, dx\)

\(\Big \downarrow \) 7239

\(\displaystyle \int \left (\frac {\log (x) \left (2 x (x+6)+\left (e^2-2 x (x+3)\right ) \log \left (x-\frac {e^2}{2 x}+3\right )-3 e^2\right )}{-2 x^2-6 x+e^2}-2 x+\log \left (x-\frac {e^2}{2 x}+3\right )-1\right )dx\)

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 7239
Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; Simpl 
erIntegrandQ[v, u, x]]
 
Maple [C] (warning: unable to verify)

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

Time = 0.85 (sec) , antiderivative size = 564, normalized size of antiderivative = 20.14

\[x -2 x \ln \left (x \right )-x^{2}-x \ln \left (2\right ) \ln \left (x \right )+x \ln \left (\frac {-{\mathrm e}^{2}+2 x^{2}+6 x}{x}\right )-x \ln \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )+\frac {\ln \left (x +\frac {3}{2}-\frac {\sqrt {9+2 \,{\mathrm e}^{2}}}{2}\right ) \sqrt {9+2 \,{\mathrm e}^{2}}}{2}-\frac {\ln \left (x +\frac {3}{2}+\frac {\sqrt {9+2 \,{\mathrm e}^{2}}}{2}\right ) \sqrt {9+2 \,{\mathrm e}^{2}}}{2}-\frac {i \pi \ln \left (x \right ) \operatorname {csgn}\left (i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )\right ) \operatorname {csgn}\left (\frac {i}{x}\right ) \operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right ) x}{2}+\frac {3 \ln \left (-{\mathrm e}^{2}+2 x^{2}+6 x \right )}{2}-\frac {\left (-9-2 \,{\mathrm e}^{2}\right ) \operatorname {arctanh}\left (\frac {4 x +6}{2 \sqrt {9+2 \,{\mathrm e}^{2}}}\right )}{\sqrt {9+2 \,{\mathrm e}^{2}}}-\frac {3 \ln \left (x +\frac {3}{2}-\frac {\sqrt {9+2 \,{\mathrm e}^{2}}}{2}\right )}{2}-\frac {3 \ln \left (x +\frac {3}{2}+\frac {\sqrt {9+2 \,{\mathrm e}^{2}}}{2}\right )}{2}-\left (\ln \left (x \right )-1\right ) x \ln \left (x \right )+\ln \left (x \right ) x \ln \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )+i x \pi {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{2}-\frac {i x \pi {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{3}}{2}+i \pi \ln \left (x \right ) x +\frac {i \pi \ln \left (x \right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{3} x}{2}-\frac {i x \pi \,\operatorname {csgn}\left (\frac {i}{x}\right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{2}}{2}-i \pi \ln \left (x \right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{2} x -\frac {i x \pi \,\operatorname {csgn}\left (i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )\right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{2}}{2}+\frac {i \pi \ln \left (x \right ) \operatorname {csgn}\left (i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )\right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{2} x}{2}+\frac {i \pi \ln \left (x \right ) \operatorname {csgn}\left (\frac {i}{x}\right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}^{2} x}{2}+\frac {i x \pi \,\operatorname {csgn}\left (i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )\right ) \operatorname {csgn}\left (\frac {i}{x}\right ) \operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{2}-2 x^{2}-6 x \right )}{x}\right )}{2}-i \pi x\]

Input:

int((((exp(2)-2*x^2-6*x)*ln(1/2*(-exp(2)+2*x^2+6*x)/x)-3*exp(2)+2*x^2+12*x 
)*ln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/x)^2*x+1/2*I*x*Pi*csgn(I*(e 
xp(2)-2*x^2-6*x))*csgn(I/x)*csgn(I*(exp(2)-2*x^2-6*x)/x)
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.25 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=-x^{2} + {\left (x \log \left (\frac {2 \, x^{2} + 6 \, x - e^{2}}{2 \, x}\right ) - 2 \, x\right )} \log \left (x\right ) + x \] Input:

integrate((((exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)-3*exp(2)+2*x 
^2+12*x)*log(x)+(exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)+(-1-2*x) 
*exp(2)+4*x^3+14*x^2+6*x)/(exp(2)-2*x^2-6*x),x, algorithm="fricas")
 

Output:

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

Sympy [B] (verification not implemented)

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

Time = 1.20 (sec) , antiderivative size = 58, normalized size of antiderivative = 2.07 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=- x^{2} - 2 x \log {\left (x \right )} + x + \left (x \log {\left (x \right )} + \frac {5}{48}\right ) \log {\left (\frac {x^{2} + 3 x - \frac {e^{2}}{2}}{x} \right )} + \frac {5 \log {\left (x \right )}}{48} - \frac {5 \log {\left (x^{2} + 3 x - \frac {e^{2}}{2} \right )}}{48} \] Input:

integrate((((exp(2)-2*x**2-6*x)*ln(1/2*(-exp(2)+2*x**2+6*x)/x)-3*exp(2)+2* 
x**2+12*x)*ln(x)+(exp(2)-2*x**2-6*x)*ln(1/2*(-exp(2)+2*x**2+6*x)/x)+(-2*x- 
1)*exp(2)+4*x**3+14*x**2+6*x)/(exp(2)-2*x**2-6*x),x)
 

Output:

-x**2 - 2*x*log(x) + x + (x*log(x) + 5/48)*log((x**2 + 3*x - exp(2)/2)/x) 
+ 5*log(x)/48 - 5*log(x**2 + 3*x - exp(2)/2)/48
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 318 vs. \(2 (25) = 50\).

Time = 0.19 (sec) , antiderivative size = 318, normalized size of antiderivative = 11.36 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=-x {\left (\log \left (2\right ) + 2\right )} \log \left (x\right ) + x \log \left (2 \, x^{2} + 6 \, x - e^{2}\right ) \log \left (x\right ) - x \log \left (x\right )^{2} - x^{2} - \frac {1}{2} \, {\left (\frac {3 \, \log \left (\frac {2 \, x - \sqrt {2 \, e^{2} + 9} + 3}{2 \, x + \sqrt {2 \, e^{2} + 9} + 3}\right )}{\sqrt {2 \, e^{2} + 9}} - \log \left (2 \, x^{2} + 6 \, x - e^{2}\right )\right )} e^{2} - \frac {1}{2} \, {\left (e^{2} + 18\right )} \log \left (2 \, x^{2} + 6 \, x - e^{2}\right ) - \frac {7 \, {\left (e^{2} + 9\right )} \log \left (\frac {2 \, x - \sqrt {2 \, e^{2} + 9} + 3}{2 \, x + \sqrt {2 \, e^{2} + 9} + 3}\right )}{2 \, \sqrt {2 \, e^{2} + 9}} + \frac {9 \, {\left (e^{2} + 6\right )} \log \left (\frac {2 \, x - \sqrt {2 \, e^{2} + 9} + 3}{2 \, x + \sqrt {2 \, e^{2} + 9} + 3}\right )}{2 \, \sqrt {2 \, e^{2} + 9}} + \frac {e^{2} \log \left (\frac {2 \, x - \sqrt {2 \, e^{2} + 9} + 3}{2 \, x + \sqrt {2 \, e^{2} + 9} + 3}\right )}{2 \, \sqrt {2 \, e^{2} + 9}} + x + \frac {9 \, \log \left (\frac {2 \, x - \sqrt {2 \, e^{2} + 9} + 3}{2 \, x + \sqrt {2 \, e^{2} + 9} + 3}\right )}{2 \, \sqrt {2 \, e^{2} + 9}} + 9 \, \log \left (2 \, x^{2} + 6 \, x - e^{2}\right ) \] Input:

integrate((((exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)-3*exp(2)+2*x 
^2+12*x)*log(x)+(exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)+(-1-2*x) 
*exp(2)+4*x^3+14*x^2+6*x)/(exp(2)-2*x^2-6*x),x, algorithm="maxima")
 

Output:

-x*(log(2) + 2)*log(x) + x*log(2*x^2 + 6*x - e^2)*log(x) - x*log(x)^2 - x^ 
2 - 1/2*(3*log((2*x - sqrt(2*e^2 + 9) + 3)/(2*x + sqrt(2*e^2 + 9) + 3))/sq 
rt(2*e^2 + 9) - log(2*x^2 + 6*x - e^2))*e^2 - 1/2*(e^2 + 18)*log(2*x^2 + 6 
*x - e^2) - 7/2*(e^2 + 9)*log((2*x - sqrt(2*e^2 + 9) + 3)/(2*x + sqrt(2*e^ 
2 + 9) + 3))/sqrt(2*e^2 + 9) + 9/2*(e^2 + 6)*log((2*x - sqrt(2*e^2 + 9) + 
3)/(2*x + sqrt(2*e^2 + 9) + 3))/sqrt(2*e^2 + 9) + 1/2*e^2*log((2*x - sqrt( 
2*e^2 + 9) + 3)/(2*x + sqrt(2*e^2 + 9) + 3))/sqrt(2*e^2 + 9) + x + 9/2*log 
((2*x - sqrt(2*e^2 + 9) + 3)/(2*x + sqrt(2*e^2 + 9) + 3))/sqrt(2*e^2 + 9) 
+ 9*log(2*x^2 + 6*x - e^2)
 

Giac [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.57 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=-x \log \left (2\right ) \log \left (x\right ) + x \log \left (2 \, x^{2} + 6 \, x - e^{2}\right ) \log \left (x\right ) - x \log \left (x\right )^{2} - x^{2} - 2 \, x \log \left (x\right ) + x \] Input:

integrate((((exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)-3*exp(2)+2*x 
^2+12*x)*log(x)+(exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)+(-1-2*x) 
*exp(2)+4*x^3+14*x^2+6*x)/(exp(2)-2*x^2-6*x),x, algorithm="giac")
 

Output:

-x*log(2)*log(x) + x*log(2*x^2 + 6*x - e^2)*log(x) - x*log(x)^2 - x^2 - 2* 
x*log(x) + x
                                                                                    
                                                                                    
 

Mupad [B] (verification not implemented)

Time = 3.61 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.14 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=x-2\,x\,\ln \left (x\right )-x^2+x\,\ln \left (\frac {x^2+3\,x-\frac {{\mathrm {e}}^2}{2}}{x}\right )\,\ln \left (x\right ) \] Input:

int(-(6*x - log((3*x - exp(2)/2 + x^2)/x)*(6*x - exp(2) + 2*x^2) + log(x)* 
(12*x - 3*exp(2) - log((3*x - exp(2)/2 + x^2)/x)*(6*x - exp(2) + 2*x^2) + 
2*x^2) + 14*x^2 + 4*x^3 - exp(2)*(2*x + 1))/(6*x - exp(2) + 2*x^2),x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.21 \[ \int \frac {e^2 (-1-2 x)+6 x+14 x^2+4 x^3+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )+\log (x) \left (-3 e^2+12 x+2 x^2+\left (e^2-6 x-2 x^2\right ) \log \left (\frac {-e^2+6 x+2 x^2}{2 x}\right )\right )}{e^2-6 x-2 x^2} \, dx=x \left (\mathrm {log}\left (\frac {-e^{2}+2 x^{2}+6 x}{2 x}\right ) \mathrm {log}\left (x \right )-2 \,\mathrm {log}\left (x \right )-x +1\right ) \] Input:

int((((exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)-3*exp(2)+2*x^2+12* 
x)*log(x)+(exp(2)-2*x^2-6*x)*log(1/2*(-exp(2)+2*x^2+6*x)/x)+(-2*x-1)*exp(2 
)+4*x^3+14*x^2+6*x)/(exp(2)-2*x^2-6*x),x)
 

Output:

x*(log(( - e**2 + 2*x**2 + 6*x)/(2*x))*log(x) - 2*log(x) - x + 1)