3.82.31 \(\int \frac {-2 x+x^3+e^{x^2} (2-x^2)+(2 x+x^3+e^{x^2} (-4 x^2-2 x^4)) \log (\frac {2+x^2}{x})}{2 x+x^3} \, dx\)

Optimal. Leaf size=28 \[ -4+\left (-e^{x^2}+x\right ) \log \left (-x+\frac {2+2 x^2}{x}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 1.30, antiderivative size = 30, normalized size of antiderivative = 1.07, number of steps used = 22, number of rules used = 10, integrand size = 65, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {1593, 6688, 6725, 388, 203, 2210, 6715, 2178, 2209, 2554} \begin {gather*} x \log \left (\frac {x^2+2}{x}\right )-e^{x^2} \log \left (\frac {x^2+2}{x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 388

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

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 2178

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$UseGamma === True

Rule 2209

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 2210

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

Rule 2554

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

Rule 6688

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

Rule 6715

Int[(u_)*(x_)^(m_.), x_Symbol] :> Dist[1/(m + 1), Subst[Int[SubstFor[x^(m + 1), u, x], x], x, x^(m + 1)], x] /
; FreeQ[m, x] && NeQ[m, -1] && FunctionOfQ[x^(m + 1), u, x]

Rule 6725

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.15, size = 18, normalized size = 0.64 \begin {gather*} \left (-e^{x^2}+x\right ) \log \left (\frac {2}{x}+x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 19, normalized size = 0.68 \begin {gather*} {\left (x - e^{\left (x^{2}\right )}\right )} \log \left (\frac {x^{2} + 2}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.21, size = 29, normalized size = 1.04 \begin {gather*} x \log \left (\frac {x^{2} + 2}{x}\right ) - e^{\left (x^{2}\right )} \log \left (\frac {x^{2} + 2}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.37, size = 30, normalized size = 1.07




method result size



default \(-\ln \left (\frac {x^{2}+2}{x}\right ) {\mathrm e}^{x^{2}}+\ln \left (\frac {x^{2}+2}{x}\right ) x\) \(30\)
norman \(-\ln \left (\frac {x^{2}+2}{x}\right ) {\mathrm e}^{x^{2}}+\ln \left (\frac {x^{2}+2}{x}\right ) x\) \(30\)
risch \(\left (-{\mathrm e}^{x^{2}}+x \right ) \ln \left (x^{2}+2\right )-x \ln \relax (x )+{\mathrm e}^{x^{2}} \ln \relax (x )+\frac {i \pi x \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2}}{2}-\frac {i \pi x \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right ) \mathrm {csgn}\left (\frac {i}{x}\right )}{2}-\frac {i \pi x \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{3}}{2}+\frac {i \pi x \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2} \mathrm {csgn}\left (\frac {i}{x}\right )}{2}-\frac {i \pi \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2} {\mathrm e}^{x^{2}}}{2}+\frac {i \pi \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right ) \mathrm {csgn}\left (\frac {i}{x}\right ) {\mathrm e}^{x^{2}}}{2}+\frac {i \pi \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{3} {\mathrm e}^{x^{2}}}{2}-\frac {i \pi \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) {\mathrm e}^{x^{2}}}{2}\) \(253\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int((((-2*x^4-4*x^2)*exp(x^2)+x^3+2*x)*ln((x^2+2)/x)+(-x^2+2)*exp(x^2)+x^3-2*x)/(x^3+2*x),x,method=_RETURNVERB
OSE)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.52, size = 28, normalized size = 1.00 \begin {gather*} {\left (x - e^{\left (x^{2}\right )}\right )} \log \left (x^{2} + 2\right ) - x \log \relax (x) + e^{\left (x^{2}\right )} \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 5.63, size = 19, normalized size = 0.68 \begin {gather*} \ln \left (\frac {x^2+2}{x}\right )\,\left (x-{\mathrm {e}}^{x^2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.49, size = 22, normalized size = 0.79 \begin {gather*} x \log {\left (\frac {x^{2} + 2}{x} \right )} - e^{x^{2}} \log {\left (\frac {x^{2} + 2}{x} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________