3.33.38 \(\int \frac {1+2 x+2 x^2-4 e^{2 x^2} x^2-2 \log (x)}{x} \, dx\) [3238]

Optimal. Leaf size=25 \[ -5-e^{2 x^2}+2 x+x^2+\log (x)-\log ^2(x) \]

[Out]

2*x-ln(x)^2+x^2+ln(x)-exp(x^2)^2-5

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 24, normalized size of antiderivative = 0.96, number of steps used = 8, number of rules used = 3, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {14, 2240, 2338} \begin {gather*} x^2-e^{2 x^2}+2 x-\log ^2(x)+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 2240

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(e + f*x)^n*(
F^(a + b*(c + d*x)^n)/(b*f*n*(c + d*x)^n*Log[F])), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-4 e^{2 x^2} x+\frac {1+2 x+2 x^2-2 \log (x)}{x}\right ) \, dx\\ &=-\left (4 \int e^{2 x^2} x \, dx\right )+\int \frac {1+2 x+2 x^2-2 \log (x)}{x} \, dx\\ &=-e^{2 x^2}+\int \left (\frac {1+2 x+2 x^2}{x}-\frac {2 \log (x)}{x}\right ) \, dx\\ &=-e^{2 x^2}-2 \int \frac {\log (x)}{x} \, dx+\int \frac {1+2 x+2 x^2}{x} \, dx\\ &=-e^{2 x^2}-\log ^2(x)+\int \left (2+\frac {1}{x}+2 x\right ) \, dx\\ &=-e^{2 x^2}+2 x+x^2+\log (x)-\log ^2(x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 24, normalized size = 0.96 \begin {gather*} -e^{2 x^2}+2 x+x^2+\log (x)-\log ^2(x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 24, normalized size = 0.96

method result size
default \(2 x +\ln \left (x \right )+x^{2}-{\mathrm e}^{2 x^{2}}-\ln \left (x \right )^{2}\) \(24\)
norman \(2 x +\ln \left (x \right )+x^{2}-{\mathrm e}^{2 x^{2}}-\ln \left (x \right )^{2}\) \(24\)
risch \(2 x +\ln \left (x \right )+x^{2}-{\mathrm e}^{2 x^{2}}-\ln \left (x \right )^{2}\) \(24\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 23, normalized size = 0.92 \begin {gather*} x^{2} - \log \left (x\right )^{2} + 2 \, x - e^{\left (2 \, x^{2}\right )} + \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 23, normalized size = 0.92 \begin {gather*} x^{2} - \log \left (x\right )^{2} + 2 \, x - e^{\left (2 \, x^{2}\right )} + \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.07, size = 20, normalized size = 0.80 \begin {gather*} x^{2} + 2 x - e^{2 x^{2}} - \log {\left (x \right )}^{2} + \log {\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 23, normalized size = 0.92 \begin {gather*} x^{2} - \log \left (x\right )^{2} + 2 \, x - e^{\left (2 \, x^{2}\right )} + \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.98, size = 23, normalized size = 0.92 \begin {gather*} 2\,x-{\mathrm {e}}^{2\,x^2}+\ln \left (x\right )-{\ln \left (x\right )}^2+x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x - 2*log(x) - 4*x^2*exp(2*x^2) + 2*x^2 + 1)/x,x)

[Out]

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

________________________________________________________________________________________