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

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

Optimal result

Integrand size = 62, antiderivative size = 25 \[ \int \frac {8+\left (-3+2 x+x^2\right ) \log (4)+e^{2 x} \left (4+8 x+4 x^2+\left (1+4 x+5 x^2+2 x^3\right ) \log (4)\right )}{\left (1+2 x+x^2\right ) \log (4)} \, dx=9+x+\left (e^{2 x}-\frac {4}{1+x}\right ) \left (x+\frac {2}{\log (4)}\right ) \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(55\) vs. \(2(25)=50\).

Time = 0.15 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.20, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {12, 27, 6874, 2207, 2225, 697} \[ \int \frac {8+\left (-3+2 x+x^2\right ) \log (4)+e^{2 x} \left (4+8 x+4 x^2+\left (1+4 x+5 x^2+2 x^3\right ) \log (4)\right )}{\left (1+2 x+x^2\right ) \log (4)} \, dx=x+\frac {e^{2 x} (x \log (16)+4+\log (4))}{2 \log (4)}-\frac {e^{2 x} \log (16)}{4 \log (4)}-\frac {2 (4-\log (16))}{(x+1) \log (4)} \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 697

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

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 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 6874

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 7.41 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.44

method result size
parts \(x \,{\mathrm e}^{2 x}+\frac {{\mathrm e}^{2 x}}{\ln \left (2\right )}+x +\frac {4}{1+x}-\frac {4}{\ln \left (2\right ) \left (1+x \right )}\) \(36\)
risch \(x -\frac {4}{\ln \left (2\right ) \left (1+x \right )}+\frac {4}{1+x}+\frac {\left (2+2 x \ln \left (2\right )\right ) {\mathrm e}^{2 x}}{2 \ln \left (2\right )}\) \(38\)
norman \(\frac {x^{2}+{\mathrm e}^{2 x} x^{2}+\frac {{\mathrm e}^{2 x}}{\ln \left (2\right )}+\frac {\left (1+\ln \left (2\right )\right ) x \,{\mathrm e}^{2 x}}{\ln \left (2\right )}+\frac {3 \ln \left (2\right )-4}{\ln \left (2\right )}}{1+x}\) \(53\)
parallelrisch \(\frac {2 \,{\mathrm e}^{2 x} \ln \left (2\right ) x^{2}+2 \,{\mathrm e}^{2 x} \ln \left (2\right ) x +2 x^{2} \ln \left (2\right )+2 x \,{\mathrm e}^{2 x}-8+2 \,{\mathrm e}^{2 x}+6 \ln \left (2\right )}{2 \ln \left (2\right ) \left (1+x \right )}\) \(58\)
default \(\frac {-\frac {8}{1+x}+\frac {6 \ln \left (2\right )}{1+x}+4 \ln \left (2\right ) \left (\frac {1}{1+x}+\ln \left (1+x \right )\right )+2 \ln \left (2\right ) \left (x -\frac {1}{1+x}-2 \ln \left (1+x \right )\right )+2 \,{\mathrm e}^{2 x}+2 \ln \left (2\right ) \left (-\frac {{\mathrm e}^{2 x}}{1+x}-2 \,{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-2 x \right )\right )+8 \ln \left (2\right ) \left (\frac {{\mathrm e}^{2 x}}{1+x}+{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-2 x \right )\right )+5 \ln \left (2\right ) {\mathrm e}^{2 x}-\frac {10 \ln \left (2\right ) {\mathrm e}^{2 x}}{1+x}+4 \ln \left (2\right ) \left (\frac {x \,{\mathrm e}^{2 x}}{2}-\frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {{\mathrm e}^{2 x}}{1+x}-{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-2 x \right )\right )}{2 \ln \left (2\right )}\) \(175\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [F]

\[ \int \frac {8+\left (-3+2 x+x^2\right ) \log (4)+e^{2 x} \left (4+8 x+4 x^2+\left (1+4 x+5 x^2+2 x^3\right ) \log (4)\right )}{\left (1+2 x+x^2\right ) \log (4)} \, dx=\int { \frac {{\left (2 \, x^{2} + {\left (2 \, x^{3} + 5 \, x^{2} + 4 \, x + 1\right )} \log \left (2\right ) + 4 \, x + 2\right )} e^{\left (2 \, x\right )} + {\left (x^{2} + 2 \, x - 3\right )} \log \left (2\right ) + 4}{{\left (x^{2} + 2 \, x + 1\right )} \log \left (2\right )} \,d x } \]

[In]

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

[Out]

((x - 1/(x + 1) - 2*log(x + 1))*log(2) + 2*(1/(x + 1) + log(x + 1))*log(2) - e^(-2)*exp_integral_e(2, -2*x - 2
)*log(2)/(x + 1) + (x^3*log(2) + x^2*(2*log(2) + 1) + x*(log(2) + 2))*e^(2*x)/(x^2 + 2*x + 1) - 2*e^(-2)*exp_i
ntegral_e(2, -2*x - 2)/(x + 1) + 3*log(2)/(x + 1) - 4/(x + 1) - integrate((x*log(2) + log(2) + 2)*e^(2*x)/(x^3
 + 3*x^2 + 3*x + 1), x))/log(2)

Giac [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

(exp(2*x) + x*log(2) + x*exp(2*x)*log(2))/log(2) + (log(2) + log(8) - 4)/(log(2)*(x + 1))