\(\int \frac {2+x+(128 e^{2 x^2}-64 e^{x^2} x+8 x^2) \log (x^2)+(4 x^2+128 e^{2 x^2} x^2+e^{x^2} (-16 x-32 x^3)) \log ^2(x^2)}{2 x} \, dx\) [6664]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   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)

Optimal result

Integrand size = 78, antiderivative size = 28 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=\frac {x}{2}+\log (x)+\left (4 e^{x^2}-x\right )^2 \log ^2\left (x^2\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.68, number of steps used = 12, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {12, 14, 2326, 45, 2341, 2342} \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=16 e^{2 x^2} \log ^2\left (x^2\right )+x^2 \log ^2\left (x^2\right )-8 e^{x^2} x \log ^2\left (x^2\right )+\frac {x}{2}+\log (x) \]

[In]

Int[(2 + x + (128*E^(2*x^2) - 64*E^x^2*x + 8*x^2)*Log[x^2] + (4*x^2 + 128*E^(2*x^2)*x^2 + E^x^2*(-16*x - 32*x^
3))*Log[x^2]^2)/(2*x),x]

[Out]

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

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 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

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

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.04 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=\frac {1}{2} \left (x+2 \log (x)+2 \left (-4 e^{x^2}+x\right )^2 \log ^2\left (x^2\right )\right ) \]

[In]

Integrate[(2 + x + (128*E^(2*x^2) - 64*E^x^2*x + 8*x^2)*Log[x^2] + (4*x^2 + 128*E^(2*x^2)*x^2 + E^x^2*(-16*x -
 32*x^3))*Log[x^2]^2)/(2*x),x]

[Out]

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

Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.57

method result size
parallelrisch \(x^{2} \ln \left (x^{2}\right )^{2}-8 \,{\mathrm e}^{x^{2}} \ln \left (x^{2}\right )^{2} x +16 \,{\mathrm e}^{2 x^{2}} \ln \left (x^{2}\right )^{2}+\ln \left (x \right )+\frac {x}{2}\) \(44\)
default \(\ln \left (x \right )+\frac {x}{2}+64 \,{\mathrm e}^{2 x^{2}} \ln \left (x \right )^{2}+64 \left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) {\mathrm e}^{2 x^{2}} \ln \left (x \right )+16 {\left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right )}^{2} {\mathrm e}^{2 x^{2}}-32 x \,{\mathrm e}^{x^{2}} \ln \left (x \right )^{2}-8 {\left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right )}^{2} x \,{\mathrm e}^{x^{2}}-32 \left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) x \,{\mathrm e}^{x^{2}} \ln \left (x \right )+x^{2} \ln \left (x^{2}\right )^{2}\) \(114\)
parts \(\ln \left (x \right )+\frac {x}{2}+64 \,{\mathrm e}^{2 x^{2}} \ln \left (x \right )^{2}+64 \left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) {\mathrm e}^{2 x^{2}} \ln \left (x \right )+16 {\left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right )}^{2} {\mathrm e}^{2 x^{2}}-32 x \,{\mathrm e}^{x^{2}} \ln \left (x \right )^{2}-8 {\left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right )}^{2} x \,{\mathrm e}^{x^{2}}-32 \left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) x \,{\mathrm e}^{x^{2}} \ln \left (x \right )+x^{2} \ln \left (x^{2}\right )^{2}\) \(114\)
risch \(\frac {\left (128 \,{\mathrm e}^{2 x^{2}}-64 \,{\mathrm e}^{x^{2}} x +8 x^{2}\right ) \ln \left (x \right )^{2}}{2}-2 i \pi \,\operatorname {csgn}\left (i x^{2}\right ) \left (x^{2} \operatorname {csgn}\left (i x \right )^{2}-2 x^{2} \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )+x^{2} \operatorname {csgn}\left (i x^{2}\right )^{2}-8 x \operatorname {csgn}\left (i x \right )^{2} {\mathrm e}^{x^{2}}+16 x \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right ) {\mathrm e}^{x^{2}}-8 x \operatorname {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{x^{2}}+16 \operatorname {csgn}\left (i x \right )^{2} {\mathrm e}^{2 x^{2}}-32 \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right ) {\mathrm e}^{2 x^{2}}+16 \operatorname {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{2 x^{2}}\right ) \ln \left (x \right )-\frac {\pi ^{2} x^{2} \operatorname {csgn}\left (i x \right )^{4} \operatorname {csgn}\left (i x^{2}\right )^{2}}{4}+\pi ^{2} x^{2} \operatorname {csgn}\left (i x \right )^{3} \operatorname {csgn}\left (i x^{2}\right )^{3}-\frac {3 \pi ^{2} x^{2} \operatorname {csgn}\left (i x \right )^{2} \operatorname {csgn}\left (i x^{2}\right )^{4}}{2}+\pi ^{2} x^{2} \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )^{5}-\frac {\pi ^{2} x^{2} \operatorname {csgn}\left (i x^{2}\right )^{6}}{4}+\frac {x}{2}+\ln \left (x \right )-4 \pi ^{2} \operatorname {csgn}\left (i x \right )^{4} \operatorname {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{2 x^{2}}+16 \pi ^{2} \operatorname {csgn}\left (i x \right )^{3} \operatorname {csgn}\left (i x^{2}\right )^{3} {\mathrm e}^{2 x^{2}}-24 \pi ^{2} \operatorname {csgn}\left (i x \right )^{2} \operatorname {csgn}\left (i x^{2}\right )^{4} {\mathrm e}^{2 x^{2}}+16 \pi ^{2} \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )^{5} {\mathrm e}^{2 x^{2}}-4 \pi ^{2} \operatorname {csgn}\left (i x^{2}\right )^{6} {\mathrm e}^{2 x^{2}}+2 \pi ^{2} x \operatorname {csgn}\left (i x \right )^{4} \operatorname {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{x^{2}}-8 \pi ^{2} x \operatorname {csgn}\left (i x \right )^{3} \operatorname {csgn}\left (i x^{2}\right )^{3} {\mathrm e}^{x^{2}}+12 \pi ^{2} x \operatorname {csgn}\left (i x \right )^{2} \operatorname {csgn}\left (i x^{2}\right )^{4} {\mathrm e}^{x^{2}}-8 \pi ^{2} x \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )^{5} {\mathrm e}^{x^{2}}+2 \pi ^{2} x \operatorname {csgn}\left (i x^{2}\right )^{6} {\mathrm e}^{x^{2}}\) \(546\)

[In]

int(1/2*((128*x^2*exp(x^2)^2+(-32*x^3-16*x)*exp(x^2)+4*x^2)*ln(x^2)^2+(128*exp(x^2)^2-64*exp(x^2)*x+8*x^2)*ln(
x^2)+2+x)/x,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.60 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.29 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx={\left (x^{2} - 8 \, x e^{\left (x^{2}\right )} + 16 \, e^{\left (2 \, x^{2}\right )}\right )} \log \left (x^{2}\right )^{2} + \frac {1}{2} \, x + \frac {1}{2} \, \log \left (x^{2}\right ) \]

[In]

integrate(1/2*((128*x^2*exp(x^2)^2+(-32*x^3-16*x)*exp(x^2)+4*x^2)*log(x^2)^2+(128*exp(x^2)^2-64*exp(x^2)*x+8*x
^2)*log(x^2)+2+x)/x,x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (22) = 44\).

Time = 0.20 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.64 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=x^{2} \log {\left (x^{2} \right )}^{2} - 8 x e^{x^{2}} \log {\left (x^{2} \right )}^{2} + \frac {x}{2} + 16 e^{2 x^{2}} \log {\left (x^{2} \right )}^{2} + \log {\left (x \right )} \]

[In]

integrate(1/2*((128*x**2*exp(x**2)**2+(-32*x**3-16*x)*exp(x**2)+4*x**2)*ln(x**2)**2+(128*exp(x**2)**2-64*exp(x
**2)*x+8*x**2)*ln(x**2)+2+x)/x,x)

[Out]

x**2*log(x**2)**2 - 8*x*exp(x**2)*log(x**2)**2 + x/2 + 16*exp(2*x**2)*log(x**2)**2 + log(x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (23) = 46\).

Time = 0.23 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.93 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=4 \, x^{2} \log \left (x\right )^{2} - 32 \, x e^{\left (x^{2}\right )} \log \left (x\right )^{2} + 2 \, x^{2} \log \left (x^{2}\right ) - 4 \, x^{2} \log \left (x\right ) + 64 \, e^{\left (2 \, x^{2}\right )} \log \left (x\right )^{2} + \frac {1}{2} \, x + \log \left (x\right ) \]

[In]

integrate(1/2*((128*x^2*exp(x^2)^2+(-32*x^3-16*x)*exp(x^2)+4*x^2)*log(x^2)^2+(128*exp(x^2)^2-64*exp(x^2)*x+8*x
^2)*log(x^2)+2+x)/x,x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.54 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=x^{2} \log \left (x^{2}\right )^{2} - 8 \, x e^{\left (x^{2}\right )} \log \left (x^{2}\right )^{2} + 16 \, e^{\left (2 \, x^{2}\right )} \log \left (x^{2}\right )^{2} + \frac {1}{2} \, x + \log \left (x\right ) \]

[In]

integrate(1/2*((128*x^2*exp(x^2)^2+(-32*x^3-16*x)*exp(x^2)+4*x^2)*log(x^2)^2+(128*exp(x^2)^2-64*exp(x^2)*x+8*x
^2)*log(x^2)+2+x)/x,x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 13.51 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.14 \[ \int \frac {2+x+\left (128 e^{2 x^2}-64 e^{x^2} x+8 x^2\right ) \log \left (x^2\right )+\left (4 x^2+128 e^{2 x^2} x^2+e^{x^2} \left (-16 x-32 x^3\right )\right ) \log ^2\left (x^2\right )}{2 x} \, dx=\left (16\,{\mathrm {e}}^{2\,x^2}-8\,x\,{\mathrm {e}}^{x^2}+x^2\right )\,{\ln \left (x^2\right )}^2+\frac {x}{2}+\ln \left (x\right ) \]

[In]

int((x/2 + (log(x^2)*(128*exp(2*x^2) - 64*x*exp(x^2) + 8*x^2))/2 + (log(x^2)^2*(128*x^2*exp(2*x^2) - exp(x^2)*
(16*x + 32*x^3) + 4*x^2))/2 + 1)/x,x)

[Out]

x/2 + log(x) + log(x^2)^2*(16*exp(2*x^2) - 8*x*exp(x^2) + x^2)