3.27.53 \(\int \frac {12-18 x+24 x^2-15 x^3+3 x^4+e^x (16 x-32 x^2+32 x^3-16 x^4+4 x^5)}{4 x-8 x^2+8 x^3-4 x^4+x^5} \, dx\)

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

________________________________________________________________________________________

Rubi [B]  time = 0.62, antiderivative size = 104, normalized size of antiderivative = 3.35, number of steps used = 26, number of rules used = 14, integrand size = 73, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {6741, 6742, 2194, 614, 617, 204, 740, 800, 634, 628, 638, 722, 738, 773} \begin {gather*} -\frac {3 (2-x) x^2}{2 \left (x^2-2 x+2\right )}+\frac {15 (2-x) x}{2 \left (x^2-2 x+2\right )}+\frac {3 x}{x^2-2 x+2}+\frac {9 (1-x)}{x^2-2 x+2}-\frac {12 (2-x)}{x^2-2 x+2}-\frac {3 x}{2}+4 e^x+3 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(12 - 18*x + 24*x^2 - 15*x^3 + 3*x^4 + E^x*(16*x - 32*x^2 + 32*x^3 - 16*x^4 + 4*x^5))/(4*x - 8*x^2 + 8*x^3
 - 4*x^4 + x^5),x]

[Out]

4*E^x - (3*x)/2 + (9*(1 - x))/(2 - 2*x + x^2) - (12*(2 - x))/(2 - 2*x + x^2) + (3*x)/(2 - 2*x + x^2) + (15*(2
- x)*x)/(2*(2 - 2*x + x^2)) - (3*(2 - x)*x^2)/(2*(2 - 2*x + x^2)) + 3*Log[x]

Rule 204

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

Rule 614

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b + 2*c*x)*(a + b*x + c*x^2)^(p + 1))/((p +
1)*(b^2 - 4*a*c)), x] - Dist[(2*c*(2*p + 3))/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2] && IntegerQ[4*p]

Rule 617

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 628

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 634

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 638

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

Rule 722

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(
d*b - 2*a*e + (2*c*d - b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[(2*(2*p + 3)*(c*d
^2 - b*d*e + a*e^2))/((p + 1)*(b^2 - 4*a*c)), Int[(d + e*x)^(m - 2)*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ
[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && EqQ[m +
 2*p + 2, 0] && LtQ[p, -1]

Rule 738

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(
d*b - 2*a*e + (2*c*d - b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] + Dist[1/((p + 1)*(b^2 -
 4*a*c)), Int[(d + e*x)^(m - 2)*Simp[e*(2*a*e*(m - 1) + b*d*(2*p - m + 4)) - 2*c*d^2*(2*p + 3) + e*(b*e - 2*d*
c)*(m + 2*p + 2)*x, x]*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] &
& NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[p, -1] && GtQ[m, 1] && IntQuadraticQ[a, b, c, d,
 e, m, p, x]

Rule 740

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m + 1)*(
b*c*d - b^2*e + 2*a*c*e + c*(2*c*d - b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)*(c*d^2 - b*d*e
+ a*e^2)), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)), Int[(d + e*x)^m*Simp[b*c*d*e*(2*p - m
+ 2) + b^2*e^2*(m + p + 2) - 2*c^2*d^2*(2*p + 3) - 2*a*c*e^2*(m + 2*p + 3) - c*e*(2*c*d - b*e)*(m + 2*p + 4)*x
, x]*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b
*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[p, -1] && IntQuadraticQ[a, b, c, d, e, m, p, x]

Rule 773

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

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 2194

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

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 {12-18 x+24 x^2-15 x^3+3 x^4+e^x \left (16 x-32 x^2+32 x^3-16 x^4+4 x^5\right )}{x \left (2-2 x+x^2\right )^2} \, dx\\ &=\int \left (4 e^x-\frac {18}{\left (2-2 x+x^2\right )^2}+\frac {12}{x \left (2-2 x+x^2\right )^2}+\frac {24 x}{\left (2-2 x+x^2\right )^2}-\frac {15 x^2}{\left (2-2 x+x^2\right )^2}+\frac {3 x^3}{\left (2-2 x+x^2\right )^2}\right ) \, dx\\ &=3 \int \frac {x^3}{\left (2-2 x+x^2\right )^2} \, dx+4 \int e^x \, dx+12 \int \frac {1}{x \left (2-2 x+x^2\right )^2} \, dx-15 \int \frac {x^2}{\left (2-2 x+x^2\right )^2} \, dx-18 \int \frac {1}{\left (2-2 x+x^2\right )^2} \, dx+24 \int \frac {x}{\left (2-2 x+x^2\right )^2} \, dx\\ &=4 e^x+\frac {9 (1-x)}{2-2 x+x^2}-\frac {12 (2-x)}{2-2 x+x^2}+\frac {3 x}{2-2 x+x^2}+\frac {15 (2-x) x}{2 \left (2-2 x+x^2\right )}-\frac {3 (2-x) x^2}{2 \left (2-2 x+x^2\right )}+\frac {3}{4} \int \frac {(8-2 x) x}{2-2 x+x^2} \, dx+\frac {3}{2} \int \frac {4+2 x}{x \left (2-2 x+x^2\right )} \, dx-9 \int \frac {1}{2-2 x+x^2} \, dx+12 \int \frac {1}{2-2 x+x^2} \, dx-15 \int \frac {1}{2-2 x+x^2} \, dx\\ &=4 e^x-\frac {3 x}{2}+\frac {9 (1-x)}{2-2 x+x^2}-\frac {12 (2-x)}{2-2 x+x^2}+\frac {3 x}{2-2 x+x^2}+\frac {15 (2-x) x}{2 \left (2-2 x+x^2\right )}-\frac {3 (2-x) x^2}{2 \left (2-2 x+x^2\right )}+\frac {3}{4} \int \frac {4+4 x}{2-2 x+x^2} \, dx+\frac {3}{2} \int \left (\frac {2}{x}-\frac {2 (-3+x)}{2-2 x+x^2}\right ) \, dx-9 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-x\right )+12 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-x\right )-15 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-x\right )\\ &=4 e^x-\frac {3 x}{2}+\frac {9 (1-x)}{2-2 x+x^2}-\frac {12 (2-x)}{2-2 x+x^2}+\frac {3 x}{2-2 x+x^2}+\frac {15 (2-x) x}{2 \left (2-2 x+x^2\right )}-\frac {3 (2-x) x^2}{2 \left (2-2 x+x^2\right )}+12 \tan ^{-1}(1-x)+3 \log (x)+\frac {3}{2} \int \frac {-2+2 x}{2-2 x+x^2} \, dx-3 \int \frac {-3+x}{2-2 x+x^2} \, dx+6 \int \frac {1}{2-2 x+x^2} \, dx\\ &=4 e^x-\frac {3 x}{2}+\frac {9 (1-x)}{2-2 x+x^2}-\frac {12 (2-x)}{2-2 x+x^2}+\frac {3 x}{2-2 x+x^2}+\frac {15 (2-x) x}{2 \left (2-2 x+x^2\right )}-\frac {3 (2-x) x^2}{2 \left (2-2 x+x^2\right )}+12 \tan ^{-1}(1-x)+3 \log (x)+\frac {3}{2} \log \left (2-2 x+x^2\right )-\frac {3}{2} \int \frac {-2+2 x}{2-2 x+x^2} \, dx+6 \int \frac {1}{2-2 x+x^2} \, dx+6 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-x\right )\\ &=4 e^x-\frac {3 x}{2}+\frac {9 (1-x)}{2-2 x+x^2}-\frac {12 (2-x)}{2-2 x+x^2}+\frac {3 x}{2-2 x+x^2}+\frac {15 (2-x) x}{2 \left (2-2 x+x^2\right )}-\frac {3 (2-x) x^2}{2 \left (2-2 x+x^2\right )}+6 \tan ^{-1}(1-x)+3 \log (x)+6 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-x\right )\\ &=4 e^x-\frac {3 x}{2}+\frac {9 (1-x)}{2-2 x+x^2}-\frac {12 (2-x)}{2-2 x+x^2}+\frac {3 x}{2-2 x+x^2}+\frac {15 (2-x) x}{2 \left (2-2 x+x^2\right )}-\frac {3 (2-x) x^2}{2 \left (2-2 x+x^2\right )}+3 \log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.20, size = 23, normalized size = 0.74 \begin {gather*} 4 e^x+\frac {3 x}{2-2 x+x^2}+3 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(12 - 18*x + 24*x^2 - 15*x^3 + 3*x^4 + E^x*(16*x - 32*x^2 + 32*x^3 - 16*x^4 + 4*x^5))/(4*x - 8*x^2 +
 8*x^3 - 4*x^4 + x^5),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.71, size = 39, normalized size = 1.26 \begin {gather*} \frac {4 \, {\left (x^{2} - 2 \, x + 2\right )} e^{x} + 3 \, {\left (x^{2} - 2 \, x + 2\right )} \log \relax (x) + 3 \, x}{x^{2} - 2 \, x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((4*x^5-16*x^4+32*x^3-32*x^2+16*x)*exp(x)+3*x^4-15*x^3+24*x^2-18*x+12)/(x^5-4*x^4+8*x^3-8*x^2+4*x),x
, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.19, size = 47, normalized size = 1.52 \begin {gather*} \frac {4 \, x^{2} e^{x} + 3 \, x^{2} \log \relax (x) - 8 \, x e^{x} - 6 \, x \log \relax (x) + 3 \, x + 8 \, e^{x} + 6 \, \log \relax (x)}{x^{2} - 2 \, x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((4*x^5-16*x^4+32*x^3-32*x^2+16*x)*exp(x)+3*x^4-15*x^3+24*x^2-18*x+12)/(x^5-4*x^4+8*x^3-8*x^2+4*x),x
, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.08, size = 23, normalized size = 0.74




method result size



risch \(\frac {3 x}{x^{2}-2 x +2}+3 \ln \relax (x )+4 \,{\mathrm e}^{x}\) \(23\)
norman \(\frac {3 x -8 \,{\mathrm e}^{x} x +4 \,{\mathrm e}^{x} x^{2}+8 \,{\mathrm e}^{x}}{x^{2}-2 x +2}+3 \ln \relax (x )\) \(37\)
default \(3 \ln \relax (x )-\frac {9 \left (2 x -2\right )}{2 \left (x^{2}-2 x +2\right )}+\frac {12 x -24}{x^{2}-2 x +2}+\frac {15}{x^{2}-2 x +2}+4 \,{\mathrm e}^{x}-\frac {16 \,{\mathrm e}^{x} \left (x -2\right )}{x^{2}-2 x +2}-\frac {32 \,{\mathrm e}^{x}}{x^{2}-2 x +2}+\frac {16 \,{\mathrm e}^{x} x}{x^{2}-2 x +2}\) \(102\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((4*x^5-16*x^4+32*x^3-32*x^2+16*x)*exp(x)+3*x^4-15*x^3+24*x^2-18*x+12)/(x^5-4*x^4+8*x^3-8*x^2+4*x),x,metho
d=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.65, size = 51, normalized size = 1.65 \begin {gather*} -\frac {9 \, {\left (x - 1\right )}}{x^{2} - 2 \, x + 2} + \frac {12 \, {\left (x - 2\right )}}{x^{2} - 2 \, x + 2} + \frac {15}{x^{2} - 2 \, x + 2} + 4 \, e^{x} + 3 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((4*x^5-16*x^4+32*x^3-32*x^2+16*x)*exp(x)+3*x^4-15*x^3+24*x^2-18*x+12)/(x^5-4*x^4+8*x^3-8*x^2+4*x),x
, algorithm="maxima")

[Out]

-9*(x - 1)/(x^2 - 2*x + 2) + 12*(x - 2)/(x^2 - 2*x + 2) + 15/(x^2 - 2*x + 2) + 4*e^x + 3*log(x)

________________________________________________________________________________________

mupad [B]  time = 1.60, size = 22, normalized size = 0.71 \begin {gather*} 4\,{\mathrm {e}}^x+3\,\ln \relax (x)+\frac {3\,x}{x^2-2\,x+2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((exp(x)*(16*x - 32*x^2 + 32*x^3 - 16*x^4 + 4*x^5) - 18*x + 24*x^2 - 15*x^3 + 3*x^4 + 12)/(4*x - 8*x^2 + 8*
x^3 - 4*x^4 + x^5),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 20, normalized size = 0.65 \begin {gather*} \frac {3 x}{x^{2} - 2 x + 2} + 4 e^{x} + 3 \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((4*x**5-16*x**4+32*x**3-32*x**2+16*x)*exp(x)+3*x**4-15*x**3+24*x**2-18*x+12)/(x**5-4*x**4+8*x**3-8*
x**2+4*x),x)

[Out]

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

________________________________________________________________________________________