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

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

Optimal result

Integrand size = 59, antiderivative size = 20 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=2-2 x+\log (x)+x \log \left (e^5 x (-4+x+\log (4))\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.119, Rules used = {6, 1607, 6874, 78, 2579, 31, 8} \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=3 x+x \log (-x (-x+4-\log (4)))+\log (x) \]

[In]

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

[Out]

3*x + Log[x] + x*Log[-(x*(4 - x - Log[4]))]

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 1607

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 2579

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.), x_Symbol] :> Simp[(a
 + b*x)*(Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s/b), x] + (Dist[q*r*s*((b*c - a*d)/b), Int[Log[e*(f*(a + b*x)^p
*(c + d*x)^q)^r]^(s - 1)/(c + d*x), x], x] - Dist[r*s*(p + q), Int[Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^(s - 1
), x], x]) /; FreeQ[{a, b, c, d, e, f, p, q, r, s}, x] && NeQ[b*c - a*d, 0] && NeQ[p + q, 0] && IGtQ[s, 0] &&
LtQ[s, 4]

Rule 6874

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

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

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.80 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=3 x+\log (x)+x \log (x (-4+x+\log (4))) \]

[In]

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

[Out]

3*x + Log[x] + x*Log[x*(-4 + x + Log[4])]

Maple [A] (verified)

Time = 0.52 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.30

method result size
parallelrisch \(-16+x \ln \left (x \,{\mathrm e}^{5} \left (x -4+2 \ln \left (2\right )\right )\right )+\ln \left (x \right )+8 \ln \left (2\right )-2 x\) \(26\)
norman \(x \ln \left (2 x \,{\mathrm e}^{5} \ln \left (2\right )+\left (x^{2}-4 x \right ) {\mathrm e}^{5}\right )-2 x +\ln \left (x \right )\) \(28\)
risch \(x \ln \left (2 x \,{\mathrm e}^{5} \ln \left (2\right )+\left (x^{2}-4 x \right ) {\mathrm e}^{5}\right )-2 x +\ln \left (x \right )\) \(28\)
default \(-\left (2 \ln \left (2\right )-4\right ) \ln \left (x -4+2 \ln \left (2\right )\right )+\ln \left (x \right )+\ln \left (2 x \,{\mathrm e}^{5} \ln \left (2\right )+x^{2} {\mathrm e}^{5}-4 x \,{\mathrm e}^{5}\right ) x -2 x -2 \left (2-\ln \left (2\right )\right ) \ln \left (x -4+2 \ln \left (2\right )\right )\) \(61\)
parts \(-\left (2 \ln \left (2\right )-4\right ) \ln \left (x -4+2 \ln \left (2\right )\right )+\ln \left (x \right )+\ln \left (2 x \,{\mathrm e}^{5} \ln \left (2\right )+x^{2} {\mathrm e}^{5}-4 x \,{\mathrm e}^{5}\right ) x -2 x -2 \left (2-\ln \left (2\right )\right ) \ln \left (x -4+2 \ln \left (2\right )\right )\) \(61\)

[In]

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

[Out]

-16+x*ln(x*exp(5)*(x-4+2*ln(2)))+ln(x)+8*ln(2)-2*x

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.35 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=x \log \left (2 \, x e^{5} \log \left (2\right ) + {\left (x^{2} - 4 \, x\right )} e^{5}\right ) - 2 \, x + \log \left (x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.45 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=x \log {\left (2 x e^{5} \log {\left (2 \right )} + \left (x^{2} - 4 x\right ) e^{5} \right )} - 2 x + \log {\left (x \right )} \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 102 vs. \(2 (21) = 42\).

Time = 0.30 (sec) , antiderivative size = 102, normalized size of antiderivative = 5.10 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=-{\left (\frac {\log \left (x + 2 \, \log \left (2\right ) - 4\right )}{\log \left (2\right ) - 2} - \frac {\log \left (x\right )}{\log \left (2\right ) - 2}\right )} \log \left (2\right ) + {\left (x + 2 \, \log \left (2\right ) - 4\right )} \log \left (x + 2 \, \log \left (2\right ) - 4\right ) - 2 \, \log \left (2\right ) \log \left (x + 2 \, \log \left (2\right ) - 4\right ) + x \log \left (x\right ) + 3 \, x + \frac {2 \, \log \left (x + 2 \, \log \left (2\right ) - 4\right )}{\log \left (2\right ) - 2} - \frac {2 \, \log \left (x\right )}{\log \left (2\right ) - 2} + 5 \, \log \left (x + 2 \, \log \left (2\right ) - 4\right ) \]

[In]

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

[Out]

-(log(x + 2*log(2) - 4)/(log(2) - 2) - log(x)/(log(2) - 2))*log(2) + (x + 2*log(2) - 4)*log(x + 2*log(2) - 4)
- 2*log(2)*log(x + 2*log(2) - 4) + x*log(x) + 3*x + 2*log(x + 2*log(2) - 4)/(log(2) - 2) - 2*log(x)/(log(2) -
2) + 5*log(x + 2*log(2) - 4)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=x \log \left (x^{2} + 2 \, x \log \left (2\right ) - 4 \, x\right ) + 3 \, x + \log \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 13.34 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.50 \[ \int \frac {-4+5 x+(1-x) \log (4)+\left (-4 x+x^2+x \log (4)\right ) \log \left (e^5 \left (-4 x+x^2\right )+e^5 x \log (4)\right )}{-4 x+x^2+x \log (4)} \, dx=\ln \left (x\right )-2\,x+x\,\ln \left (2\,x\,{\mathrm {e}}^5\,\ln \left (2\right )-{\mathrm {e}}^5\,\left (4\,x-x^2\right )\right ) \]

[In]

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

[Out]

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