3.2.15 \(\int \frac {-20+8 x+5 x^3}{(-4+x)^3 (8-4 x+x^2)} \, dx\) [115]

Optimal. Leaf size=58 \[ -\frac {83}{4 (4-x)^2}+\frac {41}{4 (4-x)}-\frac {3}{16} \tan ^{-1}\left (1-\frac {x}{2}\right )-\frac {45}{16} \log (4-x)+\frac {45}{32} \log \left (8-4 x+x^2\right ) \]

[Out]

-83/4/(4-x)^2+41/4/(4-x)+3/16*arctan(-1+1/2*x)-45/16*ln(4-x)+45/32*ln(x^2-4*x+8)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {1642, 648, 631, 210, 642} \begin {gather*} -\frac {3}{16} \text {ArcTan}\left (1-\frac {x}{2}\right )+\frac {45}{32} \log \left (x^2-4 x+8\right )+\frac {41}{4 (4-x)}-\frac {83}{4 (4-x)^2}-\frac {45}{16} \log (4-x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-20 + 8*x + 5*x^3)/((-4 + x)^3*(8 - 4*x + x^2)),x]

[Out]

-83/(4*(4 - x)^2) + 41/(4*(4 - x)) - (3*ArcTan[1 - x/2])/16 - (45*Log[4 - x])/16 + (45*Log[8 - 4*x + x^2])/32

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 631

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[a*(c/b^2)]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b)], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

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

Rule 648

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

Rule 1642

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

Rubi steps

\begin {align*} \int \frac {-20+8 x+5 x^3}{(-4+x)^3 \left (8-4 x+x^2\right )} \, dx &=\int \left (\frac {83}{2 (-4+x)^3}+\frac {41}{4 (-4+x)^2}-\frac {45}{16 (-4+x)}+\frac {3 (-28+15 x)}{16 \left (8-4 x+x^2\right )}\right ) \, dx\\ &=-\frac {83}{4 (4-x)^2}+\frac {41}{4 (4-x)}-\frac {45}{16} \log (4-x)+\frac {3}{16} \int \frac {-28+15 x}{8-4 x+x^2} \, dx\\ &=-\frac {83}{4 (4-x)^2}+\frac {41}{4 (4-x)}-\frac {45}{16} \log (4-x)+\frac {3}{8} \int \frac {1}{8-4 x+x^2} \, dx+\frac {45}{32} \int \frac {-4+2 x}{8-4 x+x^2} \, dx\\ &=-\frac {83}{4 (4-x)^2}+\frac {41}{4 (4-x)}-\frac {45}{16} \log (4-x)+\frac {45}{32} \log \left (8-4 x+x^2\right )+\frac {3}{16} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {x}{2}\right )\\ &=-\frac {83}{4 (4-x)^2}+\frac {41}{4 (4-x)}-\frac {3}{16} \tan ^{-1}\left (1-\frac {x}{2}\right )-\frac {45}{16} \log (4-x)+\frac {45}{32} \log \left (8-4 x+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 46, normalized size = 0.79 \begin {gather*} \frac {1}{32} \left (-\frac {664}{(-4+x)^2}-\frac {328}{-4+x}+6 \tan ^{-1}\left (\frac {1}{2} (-2+x)\right )-90 \log (-4+x)+45 \log \left (8-4 x+x^2\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-20 + 8*x + 5*x^3)/((-4 + x)^3*(8 - 4*x + x^2)),x]

[Out]

(-664/(-4 + x)^2 - 328/(-4 + x) + 6*ArcTan[(-2 + x)/2] - 90*Log[-4 + x] + 45*Log[8 - 4*x + x^2])/32

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 41, normalized size = 0.71

method result size
risch \(\frac {-\frac {41 x}{4}+\frac {81}{4}}{\left (x -4\right )^{2}}-\frac {45 \ln \left (x -4\right )}{16}+\frac {45 \ln \left (x^{2}-4 x +8\right )}{32}+\frac {3 \arctan \left (-1+\frac {x}{2}\right )}{16}\) \(38\)
default \(-\frac {83}{4 \left (x -4\right )^{2}}-\frac {41}{4 \left (x -4\right )}-\frac {45 \ln \left (x -4\right )}{16}+\frac {45 \ln \left (x^{2}-4 x +8\right )}{32}+\frac {3 \arctan \left (-1+\frac {x}{2}\right )}{16}\) \(41\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-83/4/(x-4)^2-41/4/(x-4)-45/16*ln(x-4)+45/32*ln(x^2-4*x+8)+3/16*arctan(-1+1/2*x)

________________________________________________________________________________________

Maxima [A]
time = 1.71, size = 43, normalized size = 0.74 \begin {gather*} -\frac {41 \, x - 81}{4 \, {\left (x^{2} - 8 \, x + 16\right )}} + \frac {3}{16} \, \arctan \left (\frac {1}{2} \, x - 1\right ) + \frac {45}{32} \, \log \left (x^{2} - 4 \, x + 8\right ) - \frac {45}{16} \, \log \left (x - 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*(41*x - 81)/(x^2 - 8*x + 16) + 3/16*arctan(1/2*x - 1) + 45/32*log(x^2 - 4*x + 8) - 45/16*log(x - 4)

________________________________________________________________________________________

Fricas [A]
time = 0.48, size = 66, normalized size = 1.14 \begin {gather*} \frac {6 \, {\left (x^{2} - 8 \, x + 16\right )} \arctan \left (\frac {1}{2} \, x - 1\right ) + 45 \, {\left (x^{2} - 8 \, x + 16\right )} \log \left (x^{2} - 4 \, x + 8\right ) - 90 \, {\left (x^{2} - 8 \, x + 16\right )} \log \left (x - 4\right ) - 328 \, x + 648}{32 \, {\left (x^{2} - 8 \, x + 16\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/32*(6*(x^2 - 8*x + 16)*arctan(1/2*x - 1) + 45*(x^2 - 8*x + 16)*log(x^2 - 4*x + 8) - 90*(x^2 - 8*x + 16)*log(
x - 4) - 328*x + 648)/(x^2 - 8*x + 16)

________________________________________________________________________________________

Sympy [A]
time = 0.07, size = 46, normalized size = 0.79 \begin {gather*} \frac {81 - 41 x}{4 x^{2} - 32 x + 64} - \frac {45 \log {\left (x - 4 \right )}}{16} + \frac {45 \log {\left (x^{2} - 4 x + 8 \right )}}{32} + \frac {3 \operatorname {atan}{\left (\frac {x}{2} - 1 \right )}}{16} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x**3+8*x-20)/(-4+x)**3/(x**2-4*x+8),x)

[Out]

(81 - 41*x)/(4*x**2 - 32*x + 64) - 45*log(x - 4)/16 + 45*log(x**2 - 4*x + 8)/32 + 3*atan(x/2 - 1)/16

________________________________________________________________________________________

Giac [A]
time = 0.94, size = 39, normalized size = 0.67 \begin {gather*} -\frac {41 \, x - 81}{4 \, {\left (x - 4\right )}^{2}} + \frac {3}{16} \, \arctan \left (\frac {1}{2} \, x - 1\right ) + \frac {45}{32} \, \log \left (x^{2} - 4 \, x + 8\right ) - \frac {45}{16} \, \log \left ({\left | x - 4 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*(41*x - 81)/(x - 4)^2 + 3/16*arctan(1/2*x - 1) + 45/32*log(x^2 - 4*x + 8) - 45/16*log(abs(x - 4))

________________________________________________________________________________________

Mupad [B]
time = 0.20, size = 44, normalized size = 0.76 \begin {gather*} -\frac {45\,\ln \left (x-4\right )}{16}-\frac {\frac {41\,x}{4}-\frac {81}{4}}{x^2-8\,x+16}+\ln \left (x-2-2{}\mathrm {i}\right )\,\left (\frac {45}{32}-\frac {3}{32}{}\mathrm {i}\right )+\ln \left (x-2+2{}\mathrm {i}\right )\,\left (\frac {45}{32}+\frac {3}{32}{}\mathrm {i}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((8*x + 5*x^3 - 20)/((x - 4)^3*(x^2 - 4*x + 8)),x)

[Out]

log(x - (2 + 2i))*(45/32 - 3i/32) - (45*log(x - 4))/16 + log(x - (2 - 2i))*(45/32 + 3i/32) - ((41*x)/4 - 81/4)
/(x^2 - 8*x + 16)

________________________________________________________________________________________