3.3.83 \(\int \frac {1+x^4}{(1+x+x^2) \sqrt {2+x+x^2}} \, dx\) [283]

Optimal. Leaf size=87 \[ -\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}-\frac {1}{8} \sinh ^{-1}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right ) \]

[Out]

-1/8*arcsinh(1/7*(1+2*x)*7^(1/2))-arctanh((x^2+x+2)^(1/2))+1/3*arctan(1/3*(1+2*x)*3^(1/2)/(x^2+x+2)^(1/2))*3^(
1/2)-7/4*(x^2+x+2)^(1/2)+1/2*x*(x^2+x+2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.15, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 10, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {6860, 654, 633, 221, 756, 1039, 996, 210, 1038, 212} \begin {gather*} \frac {\text {ArcTan}\left (\frac {2 x+1}{\sqrt {3} \sqrt {x^2+x+2}}\right )}{\sqrt {3}}+\frac {1}{2} \sqrt {x^2+x+2} x-\frac {7}{4} \sqrt {x^2+x+2}-\tanh ^{-1}\left (\sqrt {x^2+x+2}\right )-\frac {1}{8} \sinh ^{-1}\left (\frac {2 x+1}{\sqrt {7}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + x^4)/((1 + x + x^2)*Sqrt[2 + x + x^2]),x]

[Out]

(-7*Sqrt[2 + x + x^2])/4 + (x*Sqrt[2 + x + x^2])/2 - ArcSinh[(1 + 2*x)/Sqrt[7]]/8 + ArcTan[(1 + 2*x)/(Sqrt[3]*
Sqrt[2 + x + x^2])]/Sqrt[3] - ArcTanh[Sqrt[2 + x + x^2]]

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 212

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

Rule 221

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

Rule 633

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[1/(2*c*(-4*(c/(b^2 - 4*a*c)))^p), Subst[Int[Si
mp[1 - x^2/(b^2 - 4*a*c), x]^p, x], x, b + 2*c*x], x] /; FreeQ[{a, b, c, p}, x] && GtQ[4*a - b^2/c, 0]

Rule 654

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

Rule 756

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*
((a + b*x + c*x^2)^(p + 1)/(c*(m + 2*p + 1))), x] + Dist[1/(c*(m + 2*p + 1)), Int[(d + e*x)^(m - 2)*Simp[c*d^2
*(m + 2*p + 1) - e*(a*e*(m - 1) + b*d*(p + 1)) + e*(2*c*d - b*e)*(m + p)*x, x]*(a + b*x + c*x^2)^p, x], x] /;
FreeQ[{a, b, c, d, e, m, p}, 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]
 && If[RationalQ[m], GtQ[m, 1], SumSimplerQ[m, -2]] && NeQ[m + 2*p + 1, 0] && IntQuadraticQ[a, b, c, d, e, m,
p, x]

Rule 996

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

Rule 1038

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

Rule 1039

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

Rule 6860

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx &=\int \left (-\frac {x}{\sqrt {2+x+x^2}}+\frac {x^2}{\sqrt {2+x+x^2}}+\frac {1+x}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}}\right ) \, dx\\ &=-\int \frac {x}{\sqrt {2+x+x^2}} \, dx+\int \frac {x^2}{\sqrt {2+x+x^2}} \, dx+\int \frac {1+x}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx\\ &=-\sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}+\frac {1}{2} \int \frac {1}{\sqrt {2+x+x^2}} \, dx+\frac {1}{2} \int \frac {-2-\frac {3 x}{2}}{\sqrt {2+x+x^2}} \, dx+\frac {1}{2} \int \frac {1}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx+\frac {1}{2} \int \frac {1+2 x}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx\\ &=-\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}-\frac {5}{8} \int \frac {1}{\sqrt {2+x+x^2}} \, dx+\frac {\text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{7}}} \, dx,x,1+2 x\right )}{2 \sqrt {7}}-\text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,\frac {1+2 x}{\sqrt {2+x+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {2+x+x^2}\right )\\ &=-\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}+\frac {1}{2} \sinh ^{-1}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right )-\frac {5 \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{7}}} \, dx,x,1+2 x\right )}{8 \sqrt {7}}\\ &=-\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}-\frac {1}{8} \sinh ^{-1}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.37, size = 95, normalized size = 1.09 \begin {gather*} -\frac {\tan ^{-1}\left (\frac {2+2 x+2 x^2-(1+2 x) \sqrt {2+x+x^2}}{\sqrt {3}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right )+\frac {1}{8} \left (2 (-7+2 x) \sqrt {2+x+x^2}+\log \left (-1-2 x+2 \sqrt {2+x+x^2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + x^4)/((1 + x + x^2)*Sqrt[2 + x + x^2]),x]

[Out]

-(ArcTan[(2 + 2*x + 2*x^2 - (1 + 2*x)*Sqrt[2 + x + x^2])/Sqrt[3]]/Sqrt[3]) - ArcTanh[Sqrt[2 + x + x^2]] + (2*(
-7 + 2*x)*Sqrt[2 + x + x^2] + Log[-1 - 2*x + 2*Sqrt[2 + x + x^2]])/8

________________________________________________________________________________________

Maple [A]
time = 1.54, size = 69, normalized size = 0.79

method result size
risch \(\frac {\left (2 x -7\right ) \sqrt {x^{2}+x +2}}{4}-\frac {\arcsinh \left (\frac {2 \sqrt {7}\, \left (x +\frac {1}{2}\right )}{7}\right )}{8}-\arctanh \left (\sqrt {x^{2}+x +2}\right )+\frac {\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3 \sqrt {x^{2}+x +2}}\right ) \sqrt {3}}{3}\) \(63\)
default \(\frac {x \sqrt {x^{2}+x +2}}{2}-\frac {7 \sqrt {x^{2}+x +2}}{4}-\frac {\arcsinh \left (\frac {2 \sqrt {7}\, \left (x +\frac {1}{2}\right )}{7}\right )}{8}-\arctanh \left (\sqrt {x^{2}+x +2}\right )+\frac {\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3 \sqrt {x^{2}+x +2}}\right ) \sqrt {3}}{3}\) \(69\)
trager \(\text {Expression too large to display}\) \(1101\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^4+1)/(x^2+x+1)/(x^2+x+2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*x*(x^2+x+2)^(1/2)-7/4*(x^2+x+2)^(1/2)-1/8*arcsinh(2/7*7^(1/2)*(x+1/2))-arctanh((x^2+x+2)^(1/2))+1/3*arctan
(1/3*(1+2*x)*3^(1/2)/(x^2+x+2)^(1/2))*3^(1/2)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^4+1)/(x^2+x+1)/(x^2+x+2)^(1/2),x, algorithm="maxima")

[Out]

integrate((x^4 + 1)/(sqrt(x^2 + x + 2)*(x^2 + x + 1)), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (70) = 140\).
time = 0.58, size = 147, normalized size = 1.69 \begin {gather*} \frac {1}{4} \, \sqrt {x^{2} + x + 2} {\left (2 \, x - 7\right )} - \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 3\right )} + \frac {2}{3} \, \sqrt {3} \sqrt {x^{2} + x + 2}\right ) + \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )} + \frac {2}{3} \, \sqrt {3} \sqrt {x^{2} + x + 2}\right ) + \frac {1}{2} \, \log \left (2 \, x^{2} - \sqrt {x^{2} + x + 2} {\left (2 \, x + 3\right )} + 4 \, x + 5\right ) - \frac {1}{2} \, \log \left (2 \, x^{2} - \sqrt {x^{2} + x + 2} {\left (2 \, x - 1\right )} + 3\right ) + \frac {1}{8} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 2} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^4+1)/(x^2+x+1)/(x^2+x+2)^(1/2),x, algorithm="fricas")

[Out]

1/4*sqrt(x^2 + x + 2)*(2*x - 7) - 1/3*sqrt(3)*arctan(-1/3*sqrt(3)*(2*x + 3) + 2/3*sqrt(3)*sqrt(x^2 + x + 2)) +
 1/3*sqrt(3)*arctan(-1/3*sqrt(3)*(2*x - 1) + 2/3*sqrt(3)*sqrt(x^2 + x + 2)) + 1/2*log(2*x^2 - sqrt(x^2 + x + 2
)*(2*x + 3) + 4*x + 5) - 1/2*log(2*x^2 - sqrt(x^2 + x + 2)*(2*x - 1) + 3) + 1/8*log(-2*x + 2*sqrt(x^2 + x + 2)
 - 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^{4} + 1}{\left (x^{2} + x + 1\right ) \sqrt {x^{2} + x + 2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**4+1)/(x**2+x+1)/(x**2+x+2)**(1/2),x)

[Out]

Integral((x**4 + 1)/((x**2 + x + 1)*sqrt(x**2 + x + 2)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 148 vs. \(2 (70) = 140\).
time = 0.84, size = 148, normalized size = 1.70 \begin {gather*} \frac {1}{4} \, \sqrt {x^{2} + x + 2} {\left (2 \, x - 7\right )} - \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 2 \, \sqrt {x^{2} + x + 2} + 3\right )}\right ) + \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 2 \, \sqrt {x^{2} + x + 2} - 1\right )}\right ) + \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + x + 2}\right )}^{2} + 3 \, x - 3 \, \sqrt {x^{2} + x + 2} + 3\right ) - \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + x + 2}\right )}^{2} - x + \sqrt {x^{2} + x + 2} + 1\right ) + \frac {1}{8} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 2} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^4+1)/(x^2+x+1)/(x^2+x+2)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(x^2 + x + 2)*(2*x - 7) - 1/3*sqrt(3)*arctan(-1/3*sqrt(3)*(2*x - 2*sqrt(x^2 + x + 2) + 3)) + 1/3*sqrt(
3)*arctan(-1/3*sqrt(3)*(2*x - 2*sqrt(x^2 + x + 2) - 1)) + 1/2*log((x - sqrt(x^2 + x + 2))^2 + 3*x - 3*sqrt(x^2
 + x + 2) + 3) - 1/2*log((x - sqrt(x^2 + x + 2))^2 - x + sqrt(x^2 + x + 2) + 1) + 1/8*log(-2*x + 2*sqrt(x^2 +
x + 2) - 1)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^4+1}{\left (x^2+x+1\right )\,\sqrt {x^2+x+2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^4 + 1)/((x + x^2 + 1)*(x + x^2 + 2)^(1/2)),x)

[Out]

int((x^4 + 1)/((x + x^2 + 1)*(x + x^2 + 2)^(1/2)), x)

________________________________________________________________________________________