Integrand size = 23, antiderivative size = 71 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=-\frac {1}{6} \left (15+8 \sqrt {3}\right ) \arctan \left (\sqrt {3}-2 x\right )+\frac {1}{6} \left (15-8 \sqrt {3}\right ) \arctan \left (\sqrt {3}+2 x\right )+\frac {\text {arctanh}\left (\frac {\sqrt {3} x}{1+x^2}\right )}{2 \sqrt {3}} \] Output:
1/6*(15+8*3^(1/2))*arctan(-3^(1/2)+2*x)+1/6*(15-8*3^(1/2))*arctan(3^(1/2)+ 2*x)+1/6*arctanh(3^(1/2)*x/(x^2+1))*3^(1/2)
Result contains complex when optimal does not.
Time = 0.28 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.61 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=\frac {1}{6} \left (\sqrt {-2-2 i \sqrt {3}} \left (3+4 i \sqrt {3}\right ) \arctan \left (\frac {1}{2} \left (x-i \sqrt {3} x\right )\right )+\sqrt {-2+2 i \sqrt {3}} \left (3-4 i \sqrt {3}\right ) \arctan \left (\frac {1}{2} \left (x+i \sqrt {3} x\right )\right )-8 \sqrt {3} \arctan \left (\frac {1-2 x^2}{\sqrt {3}}\right )\right ) \] Input:
Integrate[(3 + 4*x + 2*x^2)/(1 - x^2 + x^4),x]
Output:
(Sqrt[-2 - (2*I)*Sqrt[3]]*(3 + (4*I)*Sqrt[3])*ArcTan[(x - I*Sqrt[3]*x)/2] + Sqrt[-2 + (2*I)*Sqrt[3]]*(3 - (4*I)*Sqrt[3])*ArcTan[(x + I*Sqrt[3]*x)/2] - 8*Sqrt[3]*ArcTan[(1 - 2*x^2)/Sqrt[3]])/6
Time = 0.36 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.56, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.478, Rules used = {2202, 27, 1432, 1083, 217, 1483, 1142, 25, 1083, 217, 1103}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {2 x^2+4 x+3}{x^4-x^2+1} \, dx\) |
\(\Big \downarrow \) 2202 |
\(\displaystyle \int \frac {4 x}{x^4-x^2+1}dx+\int \frac {2 x^2+3}{x^4-x^2+1}dx\) |
\(\Big \downarrow \) 27 |
\(\displaystyle 4 \int \frac {x}{x^4-x^2+1}dx+\int \frac {2 x^2+3}{x^4-x^2+1}dx\) |
\(\Big \downarrow \) 1432 |
\(\displaystyle 2 \int \frac {1}{x^4-x^2+1}dx^2+\int \frac {2 x^2+3}{x^4-x^2+1}dx\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \int \frac {2 x^2+3}{x^4-x^2+1}dx-4 \int \frac {1}{-x^4-3}d\left (2 x^2-1\right )\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \int \frac {2 x^2+3}{x^4-x^2+1}dx+\frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}\) |
\(\Big \downarrow \) 1483 |
\(\displaystyle \frac {\int \frac {3 \sqrt {3}-x}{x^2-\sqrt {3} x+1}dx}{2 \sqrt {3}}+\frac {\int \frac {x+3 \sqrt {3}}{x^2+\sqrt {3} x+1}dx}{2 \sqrt {3}}+\frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}\) |
\(\Big \downarrow \) 1142 |
\(\displaystyle \frac {\frac {5}{2} \sqrt {3} \int \frac {1}{x^2-\sqrt {3} x+1}dx-\frac {1}{2} \int -\frac {\sqrt {3}-2 x}{x^2-\sqrt {3} x+1}dx}{2 \sqrt {3}}+\frac {\frac {5}{2} \sqrt {3} \int \frac {1}{x^2+\sqrt {3} x+1}dx+\frac {1}{2} \int \frac {2 x+\sqrt {3}}{x^2+\sqrt {3} x+1}dx}{2 \sqrt {3}}+\frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\frac {5}{2} \sqrt {3} \int \frac {1}{x^2-\sqrt {3} x+1}dx+\frac {1}{2} \int \frac {\sqrt {3}-2 x}{x^2-\sqrt {3} x+1}dx}{2 \sqrt {3}}+\frac {\frac {5}{2} \sqrt {3} \int \frac {1}{x^2+\sqrt {3} x+1}dx+\frac {1}{2} \int \frac {2 x+\sqrt {3}}{x^2+\sqrt {3} x+1}dx}{2 \sqrt {3}}+\frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {\frac {1}{2} \int \frac {\sqrt {3}-2 x}{x^2-\sqrt {3} x+1}dx-5 \sqrt {3} \int \frac {1}{-\left (2 x-\sqrt {3}\right )^2-1}d\left (2 x-\sqrt {3}\right )}{2 \sqrt {3}}+\frac {\frac {1}{2} \int \frac {2 x+\sqrt {3}}{x^2+\sqrt {3} x+1}dx-5 \sqrt {3} \int \frac {1}{-\left (2 x+\sqrt {3}\right )^2-1}d\left (2 x+\sqrt {3}\right )}{2 \sqrt {3}}+\frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {\frac {1}{2} \int \frac {\sqrt {3}-2 x}{x^2-\sqrt {3} x+1}dx-5 \sqrt {3} \arctan \left (\sqrt {3}-2 x\right )}{2 \sqrt {3}}+\frac {\frac {1}{2} \int \frac {2 x+\sqrt {3}}{x^2+\sqrt {3} x+1}dx+5 \sqrt {3} \arctan \left (2 x+\sqrt {3}\right )}{2 \sqrt {3}}+\frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}\) |
\(\Big \downarrow \) 1103 |
\(\displaystyle \frac {4 \arctan \left (\frac {2 x^2-1}{\sqrt {3}}\right )}{\sqrt {3}}+\frac {-5 \sqrt {3} \arctan \left (\sqrt {3}-2 x\right )-\frac {1}{2} \log \left (x^2-\sqrt {3} x+1\right )}{2 \sqrt {3}}+\frac {5 \sqrt {3} \arctan \left (2 x+\sqrt {3}\right )+\frac {1}{2} \log \left (x^2+\sqrt {3} x+1\right )}{2 \sqrt {3}}\) |
Input:
Int[(3 + 4*x + 2*x^2)/(1 - x^2 + x^4),x]
Output:
(4*ArcTan[(-1 + 2*x^2)/Sqrt[3]])/Sqrt[3] + (-5*Sqrt[3]*ArcTan[Sqrt[3] - 2* x] - Log[1 - Sqrt[3]*x + x^2]/2)/(2*Sqrt[3]) + (5*Sqrt[3]*ArcTan[Sqrt[3] + 2*x] + Log[1 + Sqrt[3]*x + x^2]/2)/(2*Sqrt[3])
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[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]
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[(2*c*d - b*e)/(2*c) Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
Int[(x_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Simp[1/2 Subst[Int[(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, p}, x]
Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] : > With[{q = Rt[a/c, 2]}, With[{r = Rt[2*q - b/c, 2]}, Simp[1/(2*c*q*r) In t[(d*r - (d - e*q)*x)/(q - r*x + x^2), x], x] + Simp[1/(2*c*q*r) Int[(d*r + (d - e*q)*x)/(q + r*x + x^2), x], x]]] /; FreeQ[{a, b, c, d, e}, x] && N eQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NegQ[b^2 - 4*a*c]
Int[(Pn_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{n = Expon[Pn, x], k}, Int[Sum[Coeff[Pn, x, 2*k]*x^(2*k), {k, 0, n/2}]*(a + b *x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pn, x, 2*k + 1]*x^(2*k), {k, 0, (n - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pn, x] && !PolyQ[Pn, x^2]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.06 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.63
method | result | size |
risch | \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}-\textit {\_Z}^{2}+1\right )}{\sum }\frac {\left (2 \textit {\_R}^{2}+4 \textit {\_R} +3\right ) \ln \left (x -\textit {\_R} \right )}{2 \textit {\_R}^{3}-\textit {\_R}}\right )}{2}\) | \(45\) |
default | \(-\frac {\sqrt {3}\, \ln \left (x^{2}-\sqrt {3}\, x +1\right )}{12}-\frac {\left (-\frac {15}{2}-4 \sqrt {3}\right ) \arctan \left (2 x -\sqrt {3}\right )}{3}+\frac {\sqrt {3}\, \ln \left (x^{2}+\sqrt {3}\, x +1\right )}{12}+\frac {\left (\frac {15}{2}-4 \sqrt {3}\right ) \arctan \left (2 x +\sqrt {3}\right )}{3}\) | \(71\) |
Input:
int((2*x^2+4*x+3)/(x^4-x^2+1),x,method=_RETURNVERBOSE)
Output:
1/2*sum((2*_R^2+4*_R+3)/(2*_R^3-_R)*ln(x-_R),_R=RootOf(_Z^4-_Z^2+1))
Time = 0.08 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.96 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=-\frac {1}{6} \, {\left (8 \, \sqrt {3} - 15\right )} \arctan \left (2 \, x + \sqrt {3}\right ) - \frac {1}{6} \, {\left (8 \, \sqrt {3} + 15\right )} \arctan \left (-2 \, x + \sqrt {3}\right ) + \frac {1}{12} \, \sqrt {3} \log \left (x^{2} + \sqrt {3} x + 1\right ) - \frac {1}{12} \, \sqrt {3} \log \left (x^{2} - \sqrt {3} x + 1\right ) \] Input:
integrate((2*x^2+4*x+3)/(x^4-x^2+1),x, algorithm="fricas")
Output:
-1/6*(8*sqrt(3) - 15)*arctan(2*x + sqrt(3)) - 1/6*(8*sqrt(3) + 15)*arctan( -2*x + sqrt(3)) + 1/12*sqrt(3)*log(x^2 + sqrt(3)*x + 1) - 1/12*sqrt(3)*log (x^2 - sqrt(3)*x + 1)
Leaf count of result is larger than twice the leaf count of optimal. 1185 vs. \(2 (63) = 126\).
Time = 0.50 (sec) , antiderivative size = 1185, normalized size of antiderivative = 16.69 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=\text {Too large to display} \] Input:
integrate((2*x**2+4*x+3)/(x**4-x**2+1),x)
Output:
sqrt(3)*log(x**2 + x*(-5744/2717 - 777*sqrt(3)/2090 + 471*sqrt(3)*sqrt(80* sqrt(3) + 4801)/27170 + 92*sqrt(80*sqrt(3) + 4801)/2717) - 221660*sqrt(3)* sqrt(80*sqrt(3) + 4801)/7382089 - 1139267*sqrt(80*sqrt(3) + 4801)/28392650 + 60350184*sqrt(3)/36910445 + 155806811/33554950)/12 - sqrt(3)*log(x**2 + x*(-92*sqrt(4801 - 80*sqrt(3))/2717 - 5744/2717 + 777*sqrt(3)/2090 + 471* sqrt(3)*sqrt(4801 - 80*sqrt(3))/27170) - 221660*sqrt(3)*sqrt(4801 - 80*sqr t(3))/7382089 - 60350184*sqrt(3)/36910445 + 1139267*sqrt(4801 - 80*sqrt(3) )/28392650 + 155806811/33554950)/12 - 2*sqrt(sqrt(4801 - 80*sqrt(3))/24 + 47/16)*atan(54340*x/(-12193*sqrt(3)*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141) + 920*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141) + 157*sqrt(3)*sqrt(4801 - 80*s qrt(3))*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141)) + 471*sqrt(3)*sqrt(4801 - 8 0*sqrt(3))/(-12193*sqrt(3)*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141) + 920*sqr t(2*sqrt(4801 - 80*sqrt(3)) + 141) + 157*sqrt(3)*sqrt(4801 - 80*sqrt(3))*s qrt(2*sqrt(4801 - 80*sqrt(3)) + 141)) + 10101*sqrt(3)/(-12193*sqrt(3)*sqrt (2*sqrt(4801 - 80*sqrt(3)) + 141) + 920*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 1 41) + 157*sqrt(3)*sqrt(4801 - 80*sqrt(3))*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141)) - 57440/(-12193*sqrt(3)*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141) + 920 *sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141) + 157*sqrt(3)*sqrt(4801 - 80*sqrt(3 ))*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141)) - 920*sqrt(4801 - 80*sqrt(3))/(- 12193*sqrt(3)*sqrt(2*sqrt(4801 - 80*sqrt(3)) + 141) + 920*sqrt(2*sqrt(4...
\[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=\int { \frac {2 \, x^{2} + 4 \, x + 3}{x^{4} - x^{2} + 1} \,d x } \] Input:
integrate((2*x^2+4*x+3)/(x^4-x^2+1),x, algorithm="maxima")
Output:
integrate((2*x^2 + 4*x + 3)/(x^4 - x^2 + 1), x)
Time = 0.13 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.99 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=-\frac {1}{6} \, {\left (8 \, \sqrt {3} - 15\right )} \arctan \left (2 \, x + \sqrt {3}\right ) + \frac {1}{6} \, {\left (8 \, \sqrt {3} + 15\right )} \arctan \left (2 \, x - \sqrt {3}\right ) + \frac {1}{12} \, \sqrt {3} \log \left (x^{2} + \sqrt {3} x + 1\right ) - \frac {1}{12} \, \sqrt {3} \log \left (x^{2} - \sqrt {3} x + 1\right ) \] Input:
integrate((2*x^2+4*x+3)/(x^4-x^2+1),x, algorithm="giac")
Output:
-1/6*(8*sqrt(3) - 15)*arctan(2*x + sqrt(3)) + 1/6*(8*sqrt(3) + 15)*arctan( 2*x - sqrt(3)) + 1/12*sqrt(3)*log(x^2 + sqrt(3)*x + 1) - 1/12*sqrt(3)*log( x^2 - sqrt(3)*x + 1)
Time = 0.21 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.24 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=\sum _{k=1}^4\ln \left (-\mathrm {root}\left (z^4+\frac {23\,z^2}{4}-\frac {5\,z}{3}+\frac {25}{144},z,k\right )\,\left (84\,x+\mathrm {root}\left (z^4+\frac {23\,z^2}{4}-\frac {5\,z}{3}+\frac {25}{144},z,k\right )\,\left (-48\,x+\mathrm {root}\left (z^4+\frac {23\,z^2}{4}-\frac {5\,z}{3}+\frac {25}{144},z,k\right )\,x\,24+36\right )+112\right )+10\right )\,\mathrm {root}\left (z^4+\frac {23\,z^2}{4}-\frac {5\,z}{3}+\frac {25}{144},z,k\right ) \] Input:
int((4*x + 2*x^2 + 3)/(x^4 - x^2 + 1),x)
Output:
symsum(log(10 - root(z^4 + (23*z^2)/4 - (5*z)/3 + 25/144, z, k)*(84*x + ro ot(z^4 + (23*z^2)/4 - (5*z)/3 + 25/144, z, k)*(24*root(z^4 + (23*z^2)/4 - (5*z)/3 + 25/144, z, k)*x - 48*x + 36) + 112))*root(z^4 + (23*z^2)/4 - (5* z)/3 + 25/144, z, k), k, 1, 4)
Time = 0.17 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.99 \[ \int \frac {3+4 x+2 x^2}{1-x^2+x^4} \, dx=-\frac {4 \sqrt {3}\, \mathit {atan} \left (\sqrt {3}-2 x \right )}{3}-\frac {5 \mathit {atan} \left (\sqrt {3}-2 x \right )}{2}-\frac {4 \sqrt {3}\, \mathit {atan} \left (\sqrt {3}+2 x \right )}{3}+\frac {5 \mathit {atan} \left (\sqrt {3}+2 x \right )}{2}-\frac {\sqrt {3}\, \mathrm {log}\left (-\sqrt {3}\, x +x^{2}+1\right )}{12}+\frac {\sqrt {3}\, \mathrm {log}\left (\sqrt {3}\, x +x^{2}+1\right )}{12} \] Input:
int((2*x^2+4*x+3)/(x^4-x^2+1),x)
Output:
( - 16*sqrt(3)*atan(sqrt(3) - 2*x) - 30*atan(sqrt(3) - 2*x) - 16*sqrt(3)*a tan(sqrt(3) + 2*x) + 30*atan(sqrt(3) + 2*x) - sqrt(3)*log( - sqrt(3)*x + x **2 + 1) + sqrt(3)*log(sqrt(3)*x + x**2 + 1))/12