3.2.47 \(\int \frac {18+9 x-4 x^2+4 x^3-x^4+(9 x-3 x^2) \log (\frac {e^x (-9+3 x)}{x^2})}{-3 x-5 x^2-x^3+x^4} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.52, antiderivative size = 25, normalized size of antiderivative = 1.04, number of steps used = 16, number of rules used = 8, integrand size = 63, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.127, Rules used = {6741, 6742, 44, 72, 77, 88, 2551, 1612} \begin {gather*} \frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{x+1}-x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 77

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 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 1612

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[E
xpandIntegrand[Px*(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && Poly
Q[Px, x] && IntegersQ[m, n]

Rule 2551

Int[Log[u_]*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[((a + b*x)^(m + 1)*Log[u])/(b*(m + 1)), x] - Dist[1/
(b*(m + 1)), Int[SimplifyIntegrand[((a + b*x)^(m + 1)*D[u, x])/u, x], x], x] /; FreeQ[{a, b, m}, x] && Inverse
FunctionFreeQ[u, x] && NeQ[m, -1]

Rule 6741

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

Rule 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-18-9 x+4 x^2-4 x^3+x^4-\left (9 x-3 x^2\right ) \log \left (\frac {e^x (-9+3 x)}{x^2}\right )}{x \left (3+5 x+x^2-x^3\right )} \, dx\\ &=\int \left (\frac {9}{(-3+x) (1+x)^2}+\frac {18}{(-3+x) x (1+x)^2}-\frac {4 x}{(-3+x) (1+x)^2}+\frac {4 x^2}{(-3+x) (1+x)^2}-\frac {x^3}{(-3+x) (1+x)^2}-\frac {3 \log \left (\frac {3 e^x (-3+x)}{x^2}\right )}{(1+x)^2}\right ) \, dx\\ &=-\left (3 \int \frac {\log \left (\frac {3 e^x (-3+x)}{x^2}\right )}{(1+x)^2} \, dx\right )-4 \int \frac {x}{(-3+x) (1+x)^2} \, dx+4 \int \frac {x^2}{(-3+x) (1+x)^2} \, dx+9 \int \frac {1}{(-3+x) (1+x)^2} \, dx+18 \int \frac {1}{(-3+x) x (1+x)^2} \, dx-\int \frac {x^3}{(-3+x) (1+x)^2} \, dx\\ &=\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x}-3 \int \frac {-6+4 x-x^2}{(3-x) x (1+x)} \, dx-4 \int \left (\frac {3}{16 (-3+x)}+\frac {1}{4 (1+x)^2}-\frac {3}{16 (1+x)}\right ) \, dx+4 \int \left (\frac {9}{16 (-3+x)}-\frac {1}{4 (1+x)^2}+\frac {7}{16 (1+x)}\right ) \, dx+9 \int \left (\frac {1}{16 (-3+x)}-\frac {1}{4 (1+x)^2}-\frac {1}{16 (1+x)}\right ) \, dx+18 \int \left (\frac {1}{48 (-3+x)}-\frac {1}{3 x}+\frac {1}{4 (1+x)^2}+\frac {5}{16 (1+x)}\right ) \, dx-\int \left (1+\frac {27}{16 (-3+x)}+\frac {1}{4 (1+x)^2}-\frac {11}{16 (1+x)}\right ) \, dx\\ &=-x+\frac {3}{4} \log (3-x)+\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x}-6 \log (x)+\frac {33}{4} \log (1+x)-3 \int \left (\frac {1}{4 (-3+x)}-\frac {2}{x}+\frac {11}{4 (1+x)}\right ) \, dx\\ &=-x+\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.16, size = 25, normalized size = 1.04 \begin {gather*} -\frac {x^{2} + x - 3 \, \log \left (\frac {3 \, {\left (x - 3\right )} e^{x}}{x^{2}}\right )}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-3*x^2+9*x)*log((3*x-9)*exp(x)/x^2)-x^4+4*x^3-4*x^2+9*x+18)/(x^4-x^3-5*x^2-3*x),x, algorithm="fric
as")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.54, size = 27, normalized size = 1.12 \begin {gather*} -x + \frac {3 \, \log \left (\frac {3 \, {\left (x - 3\right )}}{x^{2}}\right )}{x + 1} - \frac {3}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.19, size = 24, normalized size = 1.00




method result size



default \(\frac {3 \ln \left (\frac {\left (3 x -9\right ) {\mathrm e}^{x}}{x^{2}}\right )}{x +1}-x\) \(24\)
norman \(\frac {-x^{2}+3 \ln \left (\frac {\left (3 x -9\right ) {\mathrm e}^{x}}{x^{2}}\right )+1}{x +1}\) \(28\)
risch \(\frac {3 \ln \left ({\mathrm e}^{x}\right )}{x +1}+\frac {-6 i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}-3 i \pi \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )+3 i \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )-3 i \pi \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{3}+3 i \pi \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{2}+3 i \pi \mathrm {csgn}\left (i x^{2}\right )^{3}+3 i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{2}-3 i \pi \,\mathrm {csgn}\left (i \left (x -3\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )+3 i \pi \,\mathrm {csgn}\left (i \left (x -3\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{2}+3 i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{2}-3 i \pi \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{3}-2 x^{2}+6 \ln \relax (3)-2 x -12 \ln \relax (x )+6 \ln \left (x -3\right )}{2 x +2}\) \(277\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.66, size = 40, normalized size = 1.67 \begin {gather*} -x - \frac {3 \, {\left ({\left (x - 3\right )} \log \left (x - 3\right ) - 8 \, x \log \relax (x) - 4 \, \log \relax (3) + 4\right )}}{4 \, {\left (x + 1\right )}} + \frac {3}{4} \, \log \left (x - 3\right ) - 6 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-3*x^2+9*x)*log((3*x-9)*exp(x)/x^2)-x^4+4*x^3-4*x^2+9*x+18)/(x^4-x^3-5*x^2-3*x),x, algorithm="maxi
ma")

[Out]

-x - 3/4*((x - 3)*log(x - 3) - 8*x*log(x) - 4*log(3) + 4)/(x + 1) + 3/4*log(x - 3) - 6*log(x)

________________________________________________________________________________________

mupad [B]  time = 0.58, size = 23, normalized size = 0.96 \begin {gather*} \frac {3\,\ln \left (\frac {{\mathrm {e}}^x\,\left (3\,x-9\right )}{x^2}\right )}{x+1}-x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.21, size = 19, normalized size = 0.79 \begin {gather*} - x + \frac {3 \log {\left (\frac {\left (3 x - 9\right ) e^{x}}{x^{2}} \right )}}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-3*x**2+9*x)*ln((3*x-9)*exp(x)/x**2)-x**4+4*x**3-4*x**2+9*x+18)/(x**4-x**3-5*x**2-3*x),x)

[Out]

-x + 3*log((3*x - 9)*exp(x)/x**2)/(x + 1)

________________________________________________________________________________________