3.40.92 \(\int \frac {35+7 x+(-6+2 x) \log (5+x)+(-5-x) \log ^2(5+x)}{45-21 x-x^2+x^3} \, dx\)

Optimal. Leaf size=19 \[ 1+\frac {-4-x+\log ^2(5+x)}{-3+x} \]

________________________________________________________________________________________

Rubi [C]  time = 0.22, antiderivative size = 98, normalized size of antiderivative = 5.16, number of steps used = 11, number of rules used = 10, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.233, Rules used = {6742, 2411, 2344, 2301, 2316, 2315, 2397, 2394, 2393, 2391} \begin {gather*} -\frac {1}{4} \text {Li}_2\left (\frac {3-x}{8}\right )-\frac {1}{4} \text {Li}_2\left (\frac {x+5}{8}\right )+\frac {7}{3-x}-\frac {(x+5) \log ^2(x+5)}{8 (3-x)}-\frac {1}{8} \log ^2(x+5)-\frac {1}{4} \log \left (\frac {3-x}{8}\right ) \log (x+5)+\frac {1}{4} \log (8) \log (3-x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(35 + 7*x + (-6 + 2*x)*Log[5 + x] + (-5 - x)*Log[5 + x]^2)/(45 - 21*x - x^2 + x^3),x]

[Out]

7/(3 - x) + (Log[8]*Log[3 - x])/4 - (Log[(3 - x)/8]*Log[5 + x])/4 - Log[5 + x]^2/8 - ((5 + x)*Log[5 + x]^2)/(8
*(3 - x)) - PolyLog[2, (3 - x)/8]/4 - PolyLog[2, (5 + x)/8]/4

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2315

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> -Simp[PolyLog[2, 1 - c*x]/e, x] /; FreeQ[{c, d, e}, x] &
& EqQ[e + c*d, 0]

Rule 2316

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

Rule 2344

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_))), x_Symbol] :> Dist[1/d, Int[(a + b*
Log[c*x^n])^p/x, x], x] - Dist[e/d, Int[(a + b*Log[c*x^n])^p/(d + e*x), x], x] /; FreeQ[{a, b, c, d, e, n}, x]
 && IGtQ[p, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 2393

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Dist[1/g, Subst[Int[(a +
 b*Log[1 + (c*e*x)/g])/x, x], x, f + g*x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && EqQ[g
 + c*(e*f - d*g), 0]

Rule 2394

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(Log[(e*(f +
g*x))/(e*f - d*g)]*(a + b*Log[c*(d + e*x)^n]))/g, x] - Dist[(b*e*n)/g, Int[Log[(e*(f + g*x))/(e*f - d*g)]/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0]

Rule 2397

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_))^2, x_Symbol] :> Simp[((d +
e*x)*(a + b*Log[c*(d + e*x)^n])^p)/((e*f - d*g)*(f + g*x)), x] - Dist[(b*e*n*p)/(e*f - d*g), Int[(a + b*Log[c*
(d + e*x)^n])^(p - 1)/(f + g*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0] && GtQ[p, 0
]

Rule 2411

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((g*x)/e)^q*((e*h - d*i)/e + (i*x)/e)^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

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

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 14, normalized size = 0.74 \begin {gather*} \frac {-7+\log ^2(5+x)}{-3+x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(35 + 7*x + (-6 + 2*x)*Log[5 + x] + (-5 - x)*Log[5 + x]^2)/(45 - 21*x - x^2 + x^3),x]

[Out]

(-7 + Log[5 + x]^2)/(-3 + x)

________________________________________________________________________________________

fricas [A]  time = 0.90, size = 14, normalized size = 0.74 \begin {gather*} \frac {\log \left (x + 5\right )^{2} - 7}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x-5)*log(5+x)^2+(2*x-6)*log(5+x)+7*x+35)/(x^3-x^2-21*x+45),x, algorithm="fricas")

[Out]

(log(x + 5)^2 - 7)/(x - 3)

________________________________________________________________________________________

giac [A]  time = 0.22, size = 20, normalized size = 1.05 \begin {gather*} \frac {\log \left (x + 5\right )^{2}}{x - 3} - \frac {7}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x-5)*log(5+x)^2+(2*x-6)*log(5+x)+7*x+35)/(x^3-x^2-21*x+45),x, algorithm="giac")

[Out]

log(x + 5)^2/(x - 3) - 7/(x - 3)

________________________________________________________________________________________

maple [A]  time = 0.09, size = 15, normalized size = 0.79




method result size



norman \(\frac {\ln \left (5+x \right )^{2}-7}{x -3}\) \(15\)
risch \(\frac {\ln \left (5+x \right )^{2}}{x -3}-\frac {7}{x -3}\) \(21\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-x-5)*ln(5+x)^2+(2*x-6)*ln(5+x)+7*x+35)/(x^3-x^2-21*x+45),x,method=_RETURNVERBOSE)

[Out]

(ln(5+x)^2-7)/(x-3)

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 20, normalized size = 1.05 \begin {gather*} \frac {\log \left (x + 5\right )^{2}}{x - 3} - \frac {7}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x-5)*log(5+x)^2+(2*x-6)*log(5+x)+7*x+35)/(x^3-x^2-21*x+45),x, algorithm="maxima")

[Out]

log(x + 5)^2/(x - 3) - 7/(x - 3)

________________________________________________________________________________________

mupad [B]  time = 2.57, size = 14, normalized size = 0.74 \begin {gather*} \frac {{\ln \left (x+5\right )}^2-7}{x-3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(7*x + log(x + 5)*(2*x - 6) - log(x + 5)^2*(x + 5) + 35)/(21*x + x^2 - x^3 - 45),x)

[Out]

(log(x + 5)^2 - 7)/(x - 3)

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 14, normalized size = 0.74 \begin {gather*} \frac {\log {\left (x + 5 \right )}^{2}}{x - 3} - \frac {7}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x-5)*ln(5+x)**2+(2*x-6)*ln(5+x)+7*x+35)/(x**3-x**2-21*x+45),x)

[Out]

log(x + 5)**2/(x - 3) - 7/(x - 3)

________________________________________________________________________________________