3.45.10 \(\int \frac {3-x^2+(-2 x^2+e^x (2+2 x)) \log (x)+(e^x (1+x)+e^x (2 x+x^2) \log (x)) \log (x^2)}{x} \, dx\) [4410]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 1.86, antiderivative size = 33, normalized size of antiderivative = 1.32, number of steps used = 50, number of rules used = 13, integrand size = 55, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.236, Rules used = {14, 2341, 6820, 6874, 2230, 2225, 2209, 2634, 6618, 6610, 2207, 12, 2637} \begin {gather*} x^2 (-\log (x))+e^x x \log (x) \log \left (x^2\right )+e^x \log (x) \log \left (x^2\right )+3 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

3*Log[x] - x^2*Log[x] + E^x*Log[x]*Log[x^2] + E^x*x*Log[x]*Log[x^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 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

Rule 2209

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

Rule 2225

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

Rule 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

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 2634

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 2637

Int[Log[v_]*Log[w_]*(u_), x_Symbol] :> With[{z = IntHide[u, x]}, Dist[Log[v]*Log[w], z, x] + (-Int[SimplifyInt
egrand[z*Log[w]*(D[v, x]/v), x], x] - Int[SimplifyIntegrand[z*Log[v]*(D[w, x]/w), x], x]) /; InverseFunctionFr
eeQ[z, x]] /; InverseFunctionFreeQ[v, x] && InverseFunctionFreeQ[w, x]

Rule 6610

Int[ExpIntegralE[1, (b_.)*(x_)]/(x_), x_Symbol] :> Simp[b*x*HypergeometricPFQ[{1, 1, 1}, {2, 2, 2}, (-b)*x], x
] + (-Simp[EulerGamma*Log[x], x] - Simp[(1/2)*Log[b*x]^2, x]) /; FreeQ[b, x]

Rule 6618

Int[ExpIntegralEi[(b_.)*(x_)]/(x_), x_Symbol] :> Simp[Log[x]*(ExpIntegralEi[b*x] + ExpIntegralE[1, (-b)*x]), x
] - Int[ExpIntegralE[1, (-b)*x]/x, x] /; FreeQ[b, x]

Rule 6820

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

Rule 6874

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.13, size = 21, normalized size = 0.84 \begin {gather*} -\log (x) \left (-3+x^2-e^x (1+x) \log \left (x^2\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(58\) vs. \(2(24)=48\).
time = 0.14, size = 59, normalized size = 2.36

method result size
default \(\left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) {\mathrm e}^{x} \ln \left (x \right )+x \left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) {\mathrm e}^{x} \ln \left (x \right )+2 \,{\mathrm e}^{x} \ln \left (x \right )^{2}+2 x \,{\mathrm e}^{x} \ln \left (x \right )^{2}-x^{2} \ln \left (x \right )+3 \ln \left (x \right )\) \(59\)
risch \(2 \left (x +1\right ) {\mathrm e}^{x} \ln \left (x \right )^{2}+\left (-x^{2}-\frac {i \pi x \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right ) {\mathrm e}^{x}}{2}+i \pi x \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{x}-\frac {i \pi x \mathrm {csgn}\left (i x^{2}\right )^{3} {\mathrm e}^{x}}{2}-\frac {i \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right ) {\mathrm e}^{x}}{2}+i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{x}-\frac {i \pi \mathrm {csgn}\left (i x^{2}\right )^{3} {\mathrm e}^{x}}{2}\right ) \ln \left (x \right )+3 \ln \left (x \right )\) \(139\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((((x^2+2*x)*exp(x)*ln(x)+(x+1)*exp(x))*ln(x^2)+((2*x+2)*exp(x)-2*x^2)*ln(x)-x^2+3)/x,x,method=_RETURNVERBO
SE)

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x^2*log(x) + 2*((x + 1)*log(x)^2 - log(x))*e^x + 2*e^x*log(x) - 2*Ei(x) + 2*integrate(e^x/x, x) + 3*log(x)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 21, normalized size = 0.84 \begin {gather*} 2 \, {\left (x + 1\right )} e^{x} \log \left (x\right )^{2} - {\left (x^{2} - 3\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.13, size = 29, normalized size = 1.16 \begin {gather*} - x^{2} \log {\left (x \right )} + \left (2 x \log {\left (x \right )}^{2} + 2 \log {\left (x \right )}^{2}\right ) e^{x} + 3 \log {\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 29, normalized size = 1.16 \begin {gather*} 2 \, x e^{x} \log \left (x\right )^{2} - x^{2} \log \left (x\right ) + 2 \, e^{x} \log \left (x\right )^{2} + 3 \, \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________