3.37.50 \(\int \frac {-2+2 x+x^2+(1+2 x+x^2) \log (3 x)}{1+2 x+x^2} \, dx\)

Optimal. Leaf size=14 \[ \frac {3}{1+x}+x \log (3 x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {27, 6742, 683, 2295} \begin {gather*} \frac {3}{x+1}+x \log (3 x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

3/(1 + x) + x*Log[3*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 683

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 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

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 {-2+2 x+x^2+\left (1+2 x+x^2\right ) \log (3 x)}{(1+x)^2} \, dx\\ &=\int \left (\frac {-2+2 x+x^2}{(1+x)^2}+\log (3 x)\right ) \, dx\\ &=\int \frac {-2+2 x+x^2}{(1+x)^2} \, dx+\int \log (3 x) \, dx\\ &=-x+x \log (3 x)+\int \left (1-\frac {3}{(1+x)^2}\right ) \, dx\\ &=\frac {3}{1+x}+x \log (3 x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 14, normalized size = 1.00 \begin {gather*} \frac {3}{1+x}+x \log (3 x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

3/(1 + x) + x*Log[3*x]

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 18, normalized size = 1.29 \begin {gather*} \frac {{\left (x^{2} + x\right )} \log \left (3 \, x\right ) + 3}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.25, size = 14, normalized size = 1.00 \begin {gather*} x \log \left (3 \, x\right ) + \frac {3}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*log(3*x) + 3/(x + 1)

________________________________________________________________________________________

maple [A]  time = 0.11, size = 15, normalized size = 1.07




method result size



risch \(\frac {3}{x +1}+x \ln \left (3 x \right )\) \(15\)
derivativedivides \(\frac {9}{3 x +3}+x \ln \left (3 x \right )\) \(17\)
default \(\frac {9}{3 x +3}+x \ln \left (3 x \right )\) \(17\)
norman \(\frac {x \ln \left (3 x \right )+x^{2} \ln \left (3 x \right )+3}{x +1}\) \(23\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/(x+1)+x*ln(3*x)

________________________________________________________________________________________

maxima [B]  time = 0.71, size = 51, normalized size = 3.64 \begin {gather*} x + \frac {x^{2} {\left (\log \relax (3) - 1\right )} + x^{2} \log \relax (x) + x {\left (\log \relax (3) - 1\right )} + \log \relax (3)}{x + 1} - \frac {\log \left (3 \, x\right )}{x + 1} + \frac {3}{x + 1} + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.13, size = 14, normalized size = 1.00 \begin {gather*} x\,\ln \left (3\,x\right )+\frac {3}{x+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*log(3*x) + 3/(x + 1)

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 10, normalized size = 0.71 \begin {gather*} x \log {\left (3 x \right )} + \frac {3}{x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x**2+2*x+1)*ln(3*x)+x**2+2*x-2)/(x**2+2*x+1),x)

[Out]

x*log(3*x) + 3/(x + 1)

________________________________________________________________________________________