\(\int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} (18-12 x^2+2 x^4)}{18-12 x^2+2 x^4} \, dx\) [6359]

   Optimal result
   Rubi [B] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 48, antiderivative size = 19 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=-7+e^{2+x}+\frac {5 x}{2}+\frac {1}{-3+x^2} \]

[Out]

1/(x^2-3)+5/2*x-7+exp(2+x)

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(52\) vs. \(2(19)=38\).

Time = 0.12 (sec) , antiderivative size = 52, normalized size of antiderivative = 2.74, number of steps used = 12, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {28, 6874, 2225, 205, 213, 267, 294, 327} \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=-\frac {15 x}{4 \left (3-x^2\right )}-\frac {1}{3-x^2}+\frac {5 x^3}{4 \left (3-x^2\right )}+\frac {15 x}{4}+e^{x+2} \]

[In]

Int[(45 - 4*x - 30*x^2 + 5*x^4 + E^(2 + x)*(18 - 12*x^2 + 2*x^4))/(18 - 12*x^2 + 2*x^4),x]

[Out]

E^(2 + x) + (15*x)/4 - (3 - x^2)^(-1) - (15*x)/(4*(3 - x^2)) + (5*x^3)/(4*(3 - x^2))

Rule 28

Int[(u_.)*((a_) + (c_.)*(x_)^(n2_.) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Dist[1/c^p, Int[u*(b/2 + c*x^n)^(2*
p), x], x] /; FreeQ[{a, b, c, n}, x] && EqQ[n2, 2*n] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 213

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

Rule 267

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a + b*x^n)^(p + 1)/(b*n*(p + 1)), x] /; FreeQ
[{a, b, m, n, p}, x] && EqQ[m, n - 1] && NeQ[p, -1]

Rule 294

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^
n)^(p + 1)/(b*n*(p + 1))), x] - Dist[c^n*((m - n + 1)/(b*n*(p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, x]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2225

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 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = 2 \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{\left (-6+2 x^2\right )^2} \, dx \\ & = 2 \int \left (\frac {e^{2+x}}{2}+\frac {45}{4 \left (-3+x^2\right )^2}-\frac {x}{\left (-3+x^2\right )^2}-\frac {15 x^2}{2 \left (-3+x^2\right )^2}+\frac {5 x^4}{4 \left (-3+x^2\right )^2}\right ) \, dx \\ & = -\left (2 \int \frac {x}{\left (-3+x^2\right )^2} \, dx\right )+\frac {5}{2} \int \frac {x^4}{\left (-3+x^2\right )^2} \, dx-15 \int \frac {x^2}{\left (-3+x^2\right )^2} \, dx+\frac {45}{2} \int \frac {1}{\left (-3+x^2\right )^2} \, dx+\int e^{2+x} \, dx \\ & = e^{2+x}-\frac {1}{3-x^2}-\frac {15 x}{4 \left (3-x^2\right )}+\frac {5 x^3}{4 \left (3-x^2\right )}-\frac {15}{4} \int \frac {1}{-3+x^2} \, dx+\frac {15}{4} \int \frac {x^2}{-3+x^2} \, dx-\frac {15}{2} \int \frac {1}{-3+x^2} \, dx \\ & = e^{2+x}+\frac {15 x}{4}-\frac {1}{3-x^2}-\frac {15 x}{4 \left (3-x^2\right )}+\frac {5 x^3}{4 \left (3-x^2\right )}+\frac {15}{4} \sqrt {3} \tanh ^{-1}\left (\frac {x}{\sqrt {3}}\right )+\frac {45}{4} \int \frac {1}{-3+x^2} \, dx \\ & = e^{2+x}+\frac {15 x}{4}-\frac {1}{3-x^2}-\frac {15 x}{4 \left (3-x^2\right )}+\frac {5 x^3}{4 \left (3-x^2\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.45 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.26 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=\frac {1}{2} \left (2 e^{2+x}+5 x+\frac {2}{-3+x^2}\right ) \]

[In]

Integrate[(45 - 4*x - 30*x^2 + 5*x^4 + E^(2 + x)*(18 - 12*x^2 + 2*x^4))/(18 - 12*x^2 + 2*x^4),x]

[Out]

(2*E^(2 + x) + 5*x + 2/(-3 + x^2))/2

Maple [A] (verified)

Time = 0.73 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.84

method result size
risch \(\frac {5 x}{2}+\frac {1}{x^{2}-3}+{\mathrm e}^{2+x}\) \(16\)
parts \(\frac {5 x}{2}+\frac {1}{x^{2}-3}+{\mathrm e}^{2+x}\) \(16\)
norman \(\frac {x^{2} {\mathrm e}^{2+x}-\frac {15 x}{2}+\frac {5 x^{3}}{2}-3 \,{\mathrm e}^{2+x}+1}{x^{2}-3}\) \(33\)
parallelrisch \(\frac {2 x^{2} {\mathrm e}^{2+x}+5 x^{3}-6 \,{\mathrm e}^{2+x}-15 x +2}{2 x^{2}-6}\) \(35\)
derivativedivides \(-\frac {13 x}{12 \left (\left (2+x \right )^{2}-7-4 x \right )}+\frac {\frac {22 x}{3}+11}{\left (2+x \right )^{2}-7-4 x}+\frac {-90-\frac {105 x}{2}}{\left (2+x \right )^{2}-7-4 x}-\frac {20 \left (-\frac {15}{2}-\frac {13 x}{3}\right )}{\left (2+x \right )^{2}-7-4 x}+5+\frac {5 x}{2}+\frac {-70-\frac {485 x}{12}}{\left (2+x \right )^{2}-7-4 x}-\frac {{\mathrm e}^{2+x} x}{6 \left (\left (2+x \right )^{2}-7-4 x \right )}+\frac {4 \,{\mathrm e}^{2+x} \left (3+2 x \right )}{3 \left (\left (2+x \right )^{2}-7-4 x \right )}-\frac {3 \,{\mathrm e}^{2+x} \left (12+7 x \right )}{\left (2+x \right )^{2}-7-4 x}+\frac {4 \,{\mathrm e}^{2+x} \left (45+26 x \right )}{3 \left (\left (2+x \right )^{2}-7-4 x \right )}+{\mathrm e}^{2+x}-\frac {{\mathrm e}^{2+x} \left (168+97 x \right )}{6 \left (\left (2+x \right )^{2}-7-4 x \right )}\) \(212\)
default \(-\frac {13 x}{12 \left (\left (2+x \right )^{2}-7-4 x \right )}+\frac {\frac {22 x}{3}+11}{\left (2+x \right )^{2}-7-4 x}+\frac {-90-\frac {105 x}{2}}{\left (2+x \right )^{2}-7-4 x}-\frac {20 \left (-\frac {15}{2}-\frac {13 x}{3}\right )}{\left (2+x \right )^{2}-7-4 x}+5+\frac {5 x}{2}+\frac {-70-\frac {485 x}{12}}{\left (2+x \right )^{2}-7-4 x}-\frac {{\mathrm e}^{2+x} x}{6 \left (\left (2+x \right )^{2}-7-4 x \right )}+\frac {4 \,{\mathrm e}^{2+x} \left (3+2 x \right )}{3 \left (\left (2+x \right )^{2}-7-4 x \right )}-\frac {3 \,{\mathrm e}^{2+x} \left (12+7 x \right )}{\left (2+x \right )^{2}-7-4 x}+\frac {4 \,{\mathrm e}^{2+x} \left (45+26 x \right )}{3 \left (\left (2+x \right )^{2}-7-4 x \right )}+{\mathrm e}^{2+x}-\frac {{\mathrm e}^{2+x} \left (168+97 x \right )}{6 \left (\left (2+x \right )^{2}-7-4 x \right )}\) \(212\)

[In]

int(((2*x^4-12*x^2+18)*exp(2+x)+5*x^4-30*x^2-4*x+45)/(2*x^4-12*x^2+18),x,method=_RETURNVERBOSE)

[Out]

5/2*x+1/(x^2-3)+exp(2+x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.58 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=\frac {5 \, x^{3} + 2 \, {\left (x^{2} - 3\right )} e^{\left (x + 2\right )} - 15 \, x + 2}{2 \, {\left (x^{2} - 3\right )}} \]

[In]

integrate(((2*x^4-12*x^2+18)*exp(2+x)+5*x^4-30*x^2-4*x+45)/(2*x^4-12*x^2+18),x, algorithm="fricas")

[Out]

1/2*(5*x^3 + 2*(x^2 - 3)*e^(x + 2) - 15*x + 2)/(x^2 - 3)

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=\frac {5 x}{2} + e^{x + 2} + \frac {1}{x^{2} - 3} \]

[In]

integrate(((2*x**4-12*x**2+18)*exp(2+x)+5*x**4-30*x**2-4*x+45)/(2*x**4-12*x**2+18),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=\frac {5}{2} \, x + \frac {1}{x^{2} - 3} + e^{\left (x + 2\right )} \]

[In]

integrate(((2*x^4-12*x^2+18)*exp(2+x)+5*x^4-30*x^2-4*x+45)/(2*x^4-12*x^2+18),x, algorithm="maxima")

[Out]

5/2*x + 1/(x^2 - 3) + e^(x + 2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (16) = 32\).

Time = 0.27 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=\frac {5 \, x^{3} + 2 \, x^{2} e^{\left (x + 2\right )} - 15 \, x - 6 \, e^{\left (x + 2\right )} + 2}{2 \, {\left (x^{2} - 3\right )}} \]

[In]

integrate(((2*x^4-12*x^2+18)*exp(2+x)+5*x^4-30*x^2-4*x+45)/(2*x^4-12*x^2+18),x, algorithm="giac")

[Out]

1/2*(5*x^3 + 2*x^2*e^(x + 2) - 15*x - 6*e^(x + 2) + 2)/(x^2 - 3)

Mupad [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {45-4 x-30 x^2+5 x^4+e^{2+x} \left (18-12 x^2+2 x^4\right )}{18-12 x^2+2 x^4} \, dx=\frac {5\,x}{2}+{\mathrm {e}}^{x+2}+\frac {2}{2\,x^2-6} \]

[In]

int((exp(x + 2)*(2*x^4 - 12*x^2 + 18) - 4*x - 30*x^2 + 5*x^4 + 45)/(2*x^4 - 12*x^2 + 18),x)

[Out]

(5*x)/2 + exp(x + 2) + 2/(2*x^2 - 6)