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

Optimal. Leaf size=18 \[ 9+\log \left (\frac {\frac {4}{x}+x}{1+e^x}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.58, antiderivative size = 19, normalized size of antiderivative = 1.06, number of steps used = 10, number of rules used = 8, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.186, Rules used = {6741, 6725, 2282, 36, 29, 31, 1802, 260} \begin {gather*} \log \left (x^2+4\right )-\log \left (e^x+1\right )-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-Log[1 + E^x] - Log[x] + Log[4 + x^2]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

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

Rule 36

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

Rule 260

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

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 2282

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

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]

Rule 6741

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

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

-Log[1 + E^x] - Log[x] + Log[4 + x^2]

________________________________________________________________________________________

fricas [A]  time = 0.65, size = 18, normalized size = 1.00 \begin {gather*} \log \left (x^{2} + 4\right ) - \log \relax (x) - \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.23, size = 18, normalized size = 1.00 \begin {gather*} \log \left (x^{2} + 4\right ) - \log \relax (x) - \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 19, normalized size = 1.06




method result size



norman \(-\ln \relax (x )-\ln \left ({\mathrm e}^{x}+1\right )+\ln \left (x^{2}+4\right )\) \(19\)
risch \(-\ln \relax (x )-\ln \left ({\mathrm e}^{x}+1\right )+\ln \left (x^{2}+4\right )\) \(19\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.14, size = 18, normalized size = 1.00 \begin {gather*} \ln \left (x^2+4\right )-\ln \left ({\mathrm {e}}^x+1\right )-\ln \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x^2 + 4) - log(exp(x) + 1) - log(x)

________________________________________________________________________________________

sympy [A]  time = 0.13, size = 15, normalized size = 0.83 \begin {gather*} - \log {\relax (x )} + \log {\left (x^{2} + 4 \right )} - \log {\left (e^{x} + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________