3.283 \(\int \frac{1+x^4}{(1+x+x^2) \sqrt{2+x+x^2}} \, dx\)

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

[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]]

________________________________________________________________________________________

Rubi [A]  time = 0.209347, antiderivative size = 87, normalized size of antiderivative = 1., 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 = {6728, 640, 619, 215, 742, 1025, 982, 204, 1024, 206} \[ \frac{1}{2} \sqrt{x^2+x+2} x-\frac{7}{4} \sqrt{x^2+x+2}+\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3} \sqrt{x^2+x+2}}\right )}{\sqrt{3}}-\tanh ^{-1}\left (\sqrt{x^2+x+2}\right )-\frac{1}{8} \sinh ^{-1}\left (\frac{2 x+1}{\sqrt{7}}\right ) \]

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 6728

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]

Rule 640

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 619

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 215

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 742

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 1025

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 982

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 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 1024

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 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 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{\operatorname{Subst}\left (\int \frac{1}{\sqrt{1+\frac{x^2}{7}}} \, dx,x,1+2 x\right )}{2 \sqrt{7}}-\operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,\frac{1+2 x}{\sqrt{2+x+x^2}}\right )-\operatorname{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 \operatorname{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 [C]  time = 0.146555, size = 134, normalized size = 1.54 \[ \frac{1}{24} \left (6 \sqrt{x^2+x+2} (2 x-7)-4 i \left (\sqrt{3}-3 i\right ) \tanh ^{-1}\left (\frac{-2 i \sqrt{3} x-i \sqrt{3}+7}{4 \sqrt{x^2+x+2}}\right )+4 i \left (\sqrt{3}+3 i\right ) \tanh ^{-1}\left (\frac{2 i \sqrt{3} x+i \sqrt{3}+7}{4 \sqrt{x^2+x+2}}\right )-3 \sinh ^{-1}\left (\frac{2 x+1}{\sqrt{7}}\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(6*(-7 + 2*x)*Sqrt[2 + x + x^2] - 3*ArcSinh[(1 + 2*x)/Sqrt[7]] - (4*I)*(-3*I + Sqrt[3])*ArcTanh[(7 - I*Sqrt[3]
 - (2*I)*Sqrt[3]*x)/(4*Sqrt[2 + x + x^2])] + (4*I)*(3*I + Sqrt[3])*ArcTanh[(7 + I*Sqrt[3] + (2*I)*Sqrt[3]*x)/(
4*Sqrt[2 + x + x^2])])/24

________________________________________________________________________________________

Maple [A]  time = 0.017, size = 69, normalized size = 0.8 \begin{align*}{\frac{x}{2}\sqrt{{x}^{2}+x+2}}-{\frac{7}{4}\sqrt{{x}^{2}+x+2}}-{\frac{1}{8}{\it Arcsinh} \left ({\frac{2\,\sqrt{7}}{7} \left ( x+{\frac{1}{2}} \right ) } \right ) }-{\it Artanh} \left ( \sqrt{{x}^{2}+x+2} \right ) +{\frac{\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}{\frac{1}{\sqrt{{x}^{2}+x+2}}}} \right ) } \end{align*}

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)

[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., size = 0, normalized size = 0. \begin{align*} \int \frac{x^{4} + 1}{\sqrt{x^{2} + x + 2}{\left (x^{2} + x + 1\right )}}\,{d x} \end{align*}

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]  time = 1.86978, size = 455, normalized size = 5.23 \begin{align*} \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{align*}

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., size = 0, normalized size = 0. \begin{align*} \int \frac{x^{4} + 1}{\left (x^{2} + x + 1\right ) \sqrt{x^{2} + x + 2}}\, dx \end{align*}

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]  time = 1.08002, size = 200, normalized size = 2.3 \begin{align*} \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{align*}

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)