3.8.24 \(\int \frac {1+4^x}{1+2^x} \, dx\) [724]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2320, 908} \begin {gather*} x-\frac {2 \log \left (2^x+1\right )}{\log (2)}+\frac {2^x}{\log (2)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + 4^x)/(1 + 2^x),x]

[Out]

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

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Integrate[(1 + 4^x)/(1 + 2^x),x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 23, normalized size = 1.05

method result size
risch \(x +\frac {2^{x}}{\ln \left (2\right )}-\frac {2 \ln \left (1+2^{x}\right )}{\ln \left (2\right )}\) \(23\)
norman \(x +\frac {{\mathrm e}^{x \ln \left (2\right )}}{\ln \left (2\right )}-\frac {2 \ln \left (1+{\mathrm e}^{x \ln \left (2\right )}\right )}{\ln \left (2\right )}\) \(27\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1+4^x)/(1+2^x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.53, size = 22, normalized size = 1.00 \begin {gather*} x + \frac {2^{x}}{\log \left (2\right )} - \frac {2 \, \log \left (2^{x} + 1\right )}{\log \left (2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+4^x)/(1+2^x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+4^x)/(1+2^x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+4**x)/(1+2**x),x)

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+4^x)/(1+2^x),x, algorithm="giac")

[Out]

integrate((4^x + 1)/(2^x + 1), x)

________________________________________________________________________________________

Mupad [B]
time = 3.48, size = 21, normalized size = 0.95 \begin {gather*} \frac {x\,\ln \left (2\right )-2\,\ln \left (2^x+1\right )+2^x}{\ln \left (2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((4^x + 1)/(2^x + 1),x)

[Out]

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

________________________________________________________________________________________