\(\int \frac {-2-25 x+e^{x^2} (-27+4 x^2)+27 \log (x)+(-e^{x^2}-x+\log (x)) \log (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+(-2 e^{x^2}-2 x) \log (x)+\log ^2(x)}{x^2})}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx\) [7256]

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

Optimal result

Integrand size = 103, antiderivative size = 27 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=5-\frac {25+\log \left (\frac {\left (e^{x^2}+x-\log (x)\right )^2}{x^2}\right )}{x} \]

[Out]

5-(25+ln((exp(x^2)-ln(x)+x)^2/x^2))/x

Rubi [A] (verified)

Time = 1.18 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.07, number of steps used = 16, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {6874, 14, 30, 2635, 12} \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=-\frac {\log \left (\frac {\left (e^{x^2}+x-\log (x)\right )^2}{x^2}\right )}{x}-\frac {25}{x} \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2635

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*Simplify
[D[u, x]/u], x], x] /; InverseFunctionFreeQ[w, x]] /; ProductQ[u]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

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

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.07 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=-\frac {25}{x}-\frac {\log \left (\frac {\left (e^{x^2}+x-\log (x)\right )^2}{x^2}\right )}{x} \]

[In]

Integrate[(-2 - 25*x + E^x^2*(-27 + 4*x^2) + 27*Log[x] + (-E^x^2 - x + Log[x])*Log[(E^(2*x^2) + 2*E^x^2*x + x^
2 + (-2*E^x^2 - 2*x)*Log[x] + Log[x]^2)/x^2])/(-(E^x^2*x^2) - x^3 + x^2*Log[x]),x]

[Out]

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

Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.81

method result size
parallelrisch \(\frac {-50-2 \ln \left (\frac {\ln \left (x \right )^{2}+\left (-2 \,{\mathrm e}^{x^{2}}-2 x \right ) \ln \left (x \right )+{\mathrm e}^{2 x^{2}}+2 \,{\mathrm e}^{x^{2}} x +x^{2}}{x^{2}}\right )}{2 x}\) \(49\)
risch \(-\frac {2 \ln \left ({\mathrm e}^{x^{2}}-\ln \left (x \right )+x \right )}{x}+\frac {i \pi {\operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )\right )}^{2} \operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}\right )+2 i \pi \,\operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )\right ) {\operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}\right )}^{2}+i \pi {\operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}\right )}^{3}-i \pi \,\operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}\right ) {\operatorname {csgn}\left (\frac {i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}}{x^{2}}\right )}^{2}+i \pi \,\operatorname {csgn}\left (i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}\right ) \operatorname {csgn}\left (\frac {i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}}{x^{2}}\right ) \operatorname {csgn}\left (\frac {i}{x^{2}}\right )+i \pi {\operatorname {csgn}\left (\frac {i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}}{x^{2}}\right )}^{3}-i \pi {\operatorname {csgn}\left (\frac {i \left (\ln \left (x \right )-{\mathrm e}^{x^{2}}-x \right )^{2}}{x^{2}}\right )}^{2} \operatorname {csgn}\left (\frac {i}{x^{2}}\right )-i \pi \operatorname {csgn}\left (i x \right )^{2} \operatorname {csgn}\left (i x^{2}\right )+2 i \pi \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )^{2}-i \pi \operatorname {csgn}\left (i x^{2}\right )^{3}+4 \ln \left (x \right )-50}{2 x}\) \(338\)

[In]

int(((ln(x)-exp(x^2)-x)*ln((ln(x)^2+(-2*exp(x^2)-2*x)*ln(x)+exp(x^2)^2+2*exp(x^2)*x+x^2)/x^2)+27*ln(x)+(4*x^2-
27)*exp(x^2)-25*x-2)/(x^2*ln(x)-x^2*exp(x^2)-x^3),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.59 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=-\frac {\log \left (\frac {x^{2} + 2 \, x e^{\left (x^{2}\right )} - 2 \, {\left (x + e^{\left (x^{2}\right )}\right )} \log \left (x\right ) + \log \left (x\right )^{2} + e^{\left (2 \, x^{2}\right )}}{x^{2}}\right ) + 25}{x} \]

[In]

integrate(((log(x)-exp(x^2)-x)*log((log(x)^2+(-2*exp(x^2)-2*x)*log(x)+exp(x^2)^2+2*exp(x^2)*x+x^2)/x^2)+27*log
(x)+(4*x^2-27)*exp(x^2)-25*x-2)/(x^2*log(x)-x^2*exp(x^2)-x^3),x, algorithm="fricas")

[Out]

-(log((x^2 + 2*x*e^(x^2) - 2*(x + e^(x^2))*log(x) + log(x)^2 + e^(2*x^2))/x^2) + 25)/x

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (20) = 40\).

Time = 0.39 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.81 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=- \frac {\log {\left (\frac {x^{2} + 2 x e^{x^{2}} + \left (- 2 x - 2 e^{x^{2}}\right ) \log {\left (x \right )} + e^{2 x^{2}} + \log {\left (x \right )}^{2}}{x^{2}} \right )}}{x} - \frac {25}{x} \]

[In]

integrate(((ln(x)-exp(x**2)-x)*ln((ln(x)**2+(-2*exp(x**2)-2*x)*ln(x)+exp(x**2)**2+2*exp(x**2)*x+x**2)/x**2)+27
*ln(x)+(4*x**2-27)*exp(x**2)-25*x-2)/(x**2*ln(x)-x**2*exp(x**2)-x**3),x)

[Out]

-log((x**2 + 2*x*exp(x**2) + (-2*x - 2*exp(x**2))*log(x) + exp(2*x**2) + log(x)**2)/x**2)/x - 25/x

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.93 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=\frac {2 \, \log \left (x\right ) - 2 \, \log \left (-x - e^{\left (x^{2}\right )} + \log \left (x\right )\right ) - 25}{x} \]

[In]

integrate(((log(x)-exp(x^2)-x)*log((log(x)^2+(-2*exp(x^2)-2*x)*log(x)+exp(x^2)^2+2*exp(x^2)*x+x^2)/x^2)+27*log
(x)+(4*x^2-27)*exp(x^2)-25*x-2)/(x^2*log(x)-x^2*exp(x^2)-x^3),x, algorithm="maxima")

[Out]

(2*log(x) - 2*log(-x - e^(x^2) + log(x)) - 25)/x

Giac [A] (verification not implemented)

none

Time = 0.46 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.70 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=-\frac {\log \left (x^{2} + 2 \, x e^{\left (x^{2}\right )} - 2 \, x \log \left (x\right ) - 2 \, e^{\left (x^{2}\right )} \log \left (x\right ) + \log \left (x\right )^{2} + e^{\left (2 \, x^{2}\right )}\right ) - 2 \, \log \left (x\right ) + 25}{x} \]

[In]

integrate(((log(x)-exp(x^2)-x)*log((log(x)^2+(-2*exp(x^2)-2*x)*log(x)+exp(x^2)^2+2*exp(x^2)*x+x^2)/x^2)+27*log
(x)+(4*x^2-27)*exp(x^2)-25*x-2)/(x^2*log(x)-x^2*exp(x^2)-x^3),x, algorithm="giac")

[Out]

-(log(x^2 + 2*x*e^(x^2) - 2*x*log(x) - 2*e^(x^2)*log(x) + log(x)^2 + e^(2*x^2)) - 2*log(x) + 25)/x

Mupad [B] (verification not implemented)

Time = 12.97 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.74 \[ \int \frac {-2-25 x+e^{x^2} \left (-27+4 x^2\right )+27 \log (x)+\left (-e^{x^2}-x+\log (x)\right ) \log \left (\frac {e^{2 x^2}+2 e^{x^2} x+x^2+\left (-2 e^{x^2}-2 x\right ) \log (x)+\log ^2(x)}{x^2}\right )}{-e^{x^2} x^2-x^3+x^2 \log (x)} \, dx=-\frac {\ln \left (\frac {{\mathrm {e}}^{2\,x^2}+2\,x\,{\mathrm {e}}^{x^2}-\ln \left (x\right )\,\left (2\,x+2\,{\mathrm {e}}^{x^2}\right )+{\ln \left (x\right )}^2+x^2}{x^2}\right )+25}{x} \]

[In]

int((25*x - 27*log(x) - exp(x^2)*(4*x^2 - 27) + log((exp(2*x^2) + 2*x*exp(x^2) - log(x)*(2*x + 2*exp(x^2)) + l
og(x)^2 + x^2)/x^2)*(x + exp(x^2) - log(x)) + 2)/(x^2*exp(x^2) - x^2*log(x) + x^3),x)

[Out]

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