3.22.49 \(\int \frac {-e+2 x^2-4 x \log (3)+2 \log ^2(3)}{x^2-2 x \log (3)+\log ^2(3)} \, dx\) [2149]

Optimal. Leaf size=26 \[ 9-e^3-x+3 (5+x)-\frac {e}{-x+\log (3)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 14, normalized size of antiderivative = 0.54, number of steps used = 3, number of rules used = 2, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {27, 697} \begin {gather*} 2 x+\frac {e}{x-\log (3)} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 19, normalized size = 0.73 \begin {gather*} \frac {e}{x-\log (3)}+2 (x-\log (3)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.44, size = 16, normalized size = 0.62

method result size
default \(2 x +\frac {{\mathrm e}}{-\ln \left (3\right )+x}\) \(16\)
risch \(2 x -\frac {{\mathrm e}}{\ln \left (3\right )-x}\) \(17\)
gosper \(-\frac {2 x^{2}-2 \ln \left (3\right )^{2}+{\mathrm e}}{\ln \left (3\right )-x}\) \(25\)
norman \(\frac {-2 x^{2}+2 \ln \left (3\right )^{2}-{\mathrm e}}{\ln \left (3\right )-x}\) \(26\)
meijerg \(\frac {2 x}{1-\frac {x}{\ln \left (3\right )}}-4 \ln \left (3\right ) \left (\frac {x}{\ln \left (3\right ) \left (1-\frac {x}{\ln \left (3\right )}\right )}+\ln \left (1-\frac {x}{\ln \left (3\right )}\right )\right )-\frac {{\mathrm e} x}{\ln \left (3\right )^{2} \left (1-\frac {x}{\ln \left (3\right )}\right )}-2 \ln \left (3\right ) \left (-\frac {x \left (-\frac {3 x}{\ln \left (3\right )}+6\right )}{3 \ln \left (3\right ) \left (1-\frac {x}{\ln \left (3\right )}\right )}-2 \ln \left (1-\frac {x}{\ln \left (3\right )}\right )\right )\) \(112\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 15, normalized size = 0.58 \begin {gather*} 2 \, x + \frac {e}{x - \log \left (3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 22, normalized size = 0.85 \begin {gather*} \frac {2 \, x^{2} - 2 \, x \log \left (3\right ) + e}{x - \log \left (3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.04, size = 10, normalized size = 0.38 \begin {gather*} 2 x + \frac {e}{x - \log {\left (3 \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x + E/(x - log(3))

________________________________________________________________________________________

Giac [A]
time = 0.39, size = 15, normalized size = 0.58 \begin {gather*} 2 \, x + \frac {e}{x - \log \left (3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.07, size = 15, normalized size = 0.58 \begin {gather*} 2\,x+\frac {\mathrm {e}}{x-\ln \left (3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________