\(\int \frac {1+2 x}{\sqrt {-1+6 x+x^2} (4+4 x+3 x^2)} \, dx\) [247]

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

Optimal result

Integrand size = 30, antiderivative size = 70 \[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=-\frac {5 \arctan \left (\frac {\sqrt {\frac {7}{2}} (2-x)}{2 \sqrt {-1+6 x+x^2}}\right )}{6 \sqrt {14}}-\frac {\text {arctanh}\left (\frac {\sqrt {7} (1+x)}{\sqrt {-1+6 x+x^2}}\right )}{3 \sqrt {7}} \] Output:

-1/21*arctanh((1+x)*7^(1/2)/(x^2+6*x-1)^(1/2))*7^(1/2)-5/84*arctan(1/4*(2- 
x)*7^(1/2)*2^(1/2)/(x^2+6*x-1)^(1/2))*14^(1/2)
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 0.16 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.76 \[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=\text {RootSum}\left [171-104 \text {$\#$1}+46 \text {$\#$1}^2-8 \text {$\#$1}^3+3 \text {$\#$1}^4\&,\frac {4 \log \left (-x+\sqrt {-1+6 x+x^2}-\text {$\#$1}\right )-\log \left (-x+\sqrt {-1+6 x+x^2}-\text {$\#$1}\right ) \text {$\#$1}+\log \left (-x+\sqrt {-1+6 x+x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{-26+23 \text {$\#$1}-6 \text {$\#$1}^2+3 \text {$\#$1}^3}\&\right ] \] Input:

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

Output:

RootSum[171 - 104*#1 + 46*#1^2 - 8*#1^3 + 3*#1^4 & , (4*Log[-x + Sqrt[-1 + 
 6*x + x^2] - #1] - Log[-x + Sqrt[-1 + 6*x + x^2] - #1]*#1 + Log[-x + Sqrt 
[-1 + 6*x + x^2] - #1]*#1^2)/(-26 + 23*#1 - 6*#1^2 + 3*#1^3) & ]
 

Rubi [A] (verified)

Time = 0.23 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1368, 27, 1362, 216, 220}

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+1}{\sqrt {x^2+6 x-1} \left (3 x^2+4 x+4\right )} \, dx\)

\(\Big \downarrow \) 1368

\(\displaystyle \frac {1}{42} \int -\frac {14 (2-x)}{\sqrt {x^2+6 x-1} \left (3 x^2+4 x+4\right )}dx-\frac {1}{42} \int -\frac {70 (x+1)}{\sqrt {x^2+6 x-1} \left (3 x^2+4 x+4\right )}dx\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {5}{3} \int \frac {x+1}{\sqrt {x^2+6 x-1} \left (3 x^2+4 x+4\right )}dx-\frac {1}{3} \int \frac {2-x}{\sqrt {x^2+6 x-1} \left (3 x^2+4 x+4\right )}dx\)

\(\Big \downarrow \) 1362

\(\displaystyle \frac {40}{3} \int \frac {1}{\frac {112 (2-x)^2}{x^2+6 x-1}+128}d\left (-\frac {2 (2-x)}{\sqrt {x^2+6 x-1}}\right )+\frac {64}{3} \int \frac {1}{\frac {7168 (x+1)^2}{x^2+6 x-1}-1024}d\frac {16 (x+1)}{\sqrt {x^2+6 x-1}}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {64}{3} \int \frac {1}{\frac {7168 (x+1)^2}{x^2+6 x-1}-1024}d\frac {16 (x+1)}{\sqrt {x^2+6 x-1}}-\frac {5 \arctan \left (\frac {\sqrt {\frac {7}{2}} (2-x)}{2 \sqrt {x^2+6 x-1}}\right )}{6 \sqrt {14}}\)

\(\Big \downarrow \) 220

\(\displaystyle -\frac {5 \arctan \left (\frac {\sqrt {\frac {7}{2}} (2-x)}{2 \sqrt {x^2+6 x-1}}\right )}{6 \sqrt {14}}-\frac {\text {arctanh}\left (\frac {\sqrt {7} (x+1)}{\sqrt {x^2+6 x-1}}\right )}{3 \sqrt {7}}\)

Input:

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

Output:

(-5*ArcTan[(Sqrt[7/2]*(2 - x))/(2*Sqrt[-1 + 6*x + x^2])])/(6*Sqrt[14]) - A 
rcTanh[(Sqrt[7]*(1 + x))/Sqrt[-1 + 6*x + x^2]]/(3*Sqrt[7])
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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

rule 220
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 1362
Int[((g_.) + (h_.)*(x_))/(((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + 
(e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> Simp[-2*g*(g*b - 2*a*h)   Subst[I 
nt[1/Simp[g*(g*b - 2*a*h)*(b^2 - 4*a*c) - (b*d - a*e)*x^2, x], x], x, Simp[ 
g*b - 2*a*h - (b*h - 2*g*c)*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] && Ne 
Q[b*d - a*e, 0] && EqQ[h^2*(b*d - a*e) - 2*g*h*(c*d - a*f) + g^2*(c*e - b*f 
), 0]
 

rule 1368
Int[((g_.) + (h_.)*(x_))/(((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + 
(e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q = Rt[(c*d - a*f)^2 - (b*d 
 - a*e)*(c*e - b*f), 2]}, Simp[1/(2*q)   Int[Simp[h*(b*d - a*e) - g*(c*d - 
a*f - q) - (g*(c*e - b*f) - h*(c*d - a*f + q))*x, x]/((a + b*x + c*x^2)*Sqr 
t[d + e*x + f*x^2]), x], x] - Simp[1/(2*q)   Int[Simp[h*(b*d - a*e) - g*(c* 
d - a*f + q) - (g*(c*e - b*f) - h*(c*d - a*f - q))*x, 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] && N 
eQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && NeQ[b*d - a*e, 0] && NegQ[b^2 
- 4*a*c]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(157\) vs. \(2(53)=106\).

Time = 1.12 (sec) , antiderivative size = 158, normalized size of antiderivative = 2.26

method result size
default \(\frac {\sqrt {-\frac {6 \left (-2+x \right )^{2}}{\left (-1-x \right )^{2}}+15}\, \left (5 \sqrt {14}\, \arctan \left (\frac {\sqrt {14}\, \sqrt {-\frac {6 \left (-2+x \right )^{2}}{\left (-1-x \right )^{2}}+15}\, \left (-2+x \right )}{4 \left (\frac {2 \left (-2+x \right )^{2}}{\left (-1-x \right )^{2}}-5\right ) \left (-1-x \right )}\right )-4 \sqrt {7}\, \operatorname {arctanh}\left (\frac {\sqrt {-\frac {6 \left (-2+x \right )^{2}}{\left (-1-x \right )^{2}}+15}\, \sqrt {7}}{21}\right )\right )}{84 \sqrt {-\frac {3 \left (\frac {2 \left (-2+x \right )^{2}}{\left (-1-x \right )^{2}}-5\right )}{\left (\frac {-2+x}{-1-x}+1\right )^{2}}}\, \left (\frac {-2+x}{-1-x}+1\right )}\) \(158\)
trager \(-\operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right ) \ln \left (\frac {1568802816 x \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{5}+6019776 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3} x +39686976 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3}-3171168 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{2} \sqrt {x^{2}+6 x -1}+5768 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right ) x +73542 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )-50611 \sqrt {x^{2}+6 x -1}}{2016 x \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{2}-3 x -40}\right )-\frac {672 \ln \left (\frac {159860736 x \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{5}+2221632 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3} x -4044096 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3}+352352 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{2} \sqrt {x^{2}+6 x -1}-2340 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right ) x +3978 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )+319 \sqrt {x^{2}+6 x -1}}{2016 x \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{2}+37 x +40}\right ) \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3}}{11}-\frac {34 \ln \left (\frac {159860736 x \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{5}+2221632 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3} x -4044096 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{3}+352352 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{2} \sqrt {x^{2}+6 x -1}-2340 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right ) x +3978 \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )+319 \sqrt {x^{2}+6 x -1}}{2016 x \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )^{2}+37 x +40}\right ) \operatorname {RootOf}\left (451584 \textit {\_Z}^{4}+7616 \textit {\_Z}^{2}+121\right )}{33}\) \(502\)

Input:

int((1+2*x)/(3*x^2+4*x+4)/(x^2+6*x-1)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

1/84*(-6*(-2+x)^2/(-1-x)^2+15)^(1/2)*(5*14^(1/2)*arctan(1/4*14^(1/2)*(-6*( 
-2+x)^2/(-1-x)^2+15)^(1/2)/(2*(-2+x)^2/(-1-x)^2-5)*(-2+x)/(-1-x))-4*7^(1/2 
)*arctanh(1/21*(-6*(-2+x)^2/(-1-x)^2+15)^(1/2)*7^(1/2)))/(-3*(2*(-2+x)^2/( 
-1-x)^2-5)/((-2+x)/(-1-x)+1)^2)^(1/2)/((-2+x)/(-1-x)+1)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 178 vs. \(2 (51) = 102\).

Time = 0.07 (sec) , antiderivative size = 178, normalized size of antiderivative = 2.54 \[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=\frac {5}{84} \, \sqrt {14} \arctan \left (\frac {1}{56} \, \sqrt {14} \sqrt {x^{2} + 6 \, x - 1} {\left (\sqrt {7} + 7\right )} - \frac {1}{56} \, \sqrt {14} {\left (\sqrt {7} {\left (x + 3\right )} + 7 \, x + 7\right )}\right ) - \frac {5}{84} \, \sqrt {14} \arctan \left (\frac {1}{56} \, \sqrt {14} \sqrt {x^{2} + 6 \, x - 1} {\left (\sqrt {7} - 7\right )} - \frac {1}{56} \, \sqrt {14} {\left (\sqrt {7} {\left (x + 3\right )} - 7 \, x - 7\right )}\right ) + \frac {1}{42} \, \sqrt {7} \log \left (3 \, x^{2} - \sqrt {x^{2} + 6 \, x - 1} {\left (3 \, x + \sqrt {7} + 2\right )} + \sqrt {7} {\left (x - 2\right )} + 11 \, x + 11\right ) - \frac {1}{42} \, \sqrt {7} \log \left (3 \, x^{2} - \sqrt {x^{2} + 6 \, x - 1} {\left (3 \, x - \sqrt {7} + 2\right )} - \sqrt {7} {\left (x - 2\right )} + 11 \, x + 11\right ) \] Input:

integrate((1+2*x)/(3*x^2+4*x+4)/(x^2+6*x-1)^(1/2),x, algorithm="fricas")
 

Output:

5/84*sqrt(14)*arctan(1/56*sqrt(14)*sqrt(x^2 + 6*x - 1)*(sqrt(7) + 7) - 1/5 
6*sqrt(14)*(sqrt(7)*(x + 3) + 7*x + 7)) - 5/84*sqrt(14)*arctan(1/56*sqrt(1 
4)*sqrt(x^2 + 6*x - 1)*(sqrt(7) - 7) - 1/56*sqrt(14)*(sqrt(7)*(x + 3) - 7* 
x - 7)) + 1/42*sqrt(7)*log(3*x^2 - sqrt(x^2 + 6*x - 1)*(3*x + sqrt(7) + 2) 
 + sqrt(7)*(x - 2) + 11*x + 11) - 1/42*sqrt(7)*log(3*x^2 - sqrt(x^2 + 6*x 
- 1)*(3*x - sqrt(7) + 2) - sqrt(7)*(x - 2) + 11*x + 11)
 

Sympy [F]

\[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=\int \frac {2 x + 1}{\sqrt {x^{2} + 6 x - 1} \cdot \left (3 x^{2} + 4 x + 4\right )}\, dx \] Input:

integrate((1+2*x)/(3*x**2+4*x+4)/(x**2+6*x-1)**(1/2),x)
 

Output:

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

Maxima [F]

\[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=\int { \frac {2 \, x + 1}{{\left (3 \, x^{2} + 4 \, x + 4\right )} \sqrt {x^{2} + 6 \, x - 1}} \,d x } \] Input:

integrate((1+2*x)/(3*x^2+4*x+4)/(x^2+6*x-1)^(1/2),x, algorithm="maxima")
 

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 257 vs. \(2 (51) = 102\).

Time = 0.15 (sec) , antiderivative size = 257, normalized size of antiderivative = 3.67 \[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=-\frac {5}{84} \, \sqrt {7} \sqrt {2} {\left (\arctan \left (2\right ) + \arctan \left (\frac {1}{8} \, {\left (x - \sqrt {x^{2} + 6 \, x - 1}\right )} {\left (\sqrt {14} + \sqrt {2}\right )} + \frac {1}{8} \, \sqrt {14} + \frac {3}{8} \, \sqrt {2}\right )\right )} + \frac {5}{84} \, \sqrt {7} \sqrt {2} {\left (\arctan \left (\frac {1}{2}\right ) + \arctan \left (-\frac {1}{8} \, {\left (x - \sqrt {x^{2} + 6 \, x - 1}\right )} {\left (\sqrt {14} - \sqrt {2}\right )} - \frac {1}{8} \, \sqrt {14} + \frac {3}{8} \, \sqrt {2}\right )\right )} + \frac {1}{42} \, \sqrt {7} \log \left (4 \, {\left (4 \, \sqrt {7} \sqrt {2} + 3 \, x + \sqrt {7} - 4 \, \sqrt {2} - 3 \, \sqrt {x^{2} + 6 \, x - 1} + 2\right )}^{2} + 16 \, {\left (\sqrt {7} \sqrt {2} - 3 \, x - \sqrt {7} - \sqrt {2} + 3 \, \sqrt {x^{2} + 6 \, x - 1} - 2\right )}^{2}\right ) - \frac {1}{42} \, \sqrt {7} \log \left (4 \, {\left (4 \, \sqrt {7} \sqrt {2} + 3 \, x - \sqrt {7} + 4 \, \sqrt {2} - 3 \, \sqrt {x^{2} + 6 \, x - 1} + 2\right )}^{2} + 16 \, {\left (\sqrt {7} \sqrt {2} - 3 \, x + \sqrt {7} + \sqrt {2} + 3 \, \sqrt {x^{2} + 6 \, x - 1} - 2\right )}^{2}\right ) \] Input:

integrate((1+2*x)/(3*x^2+4*x+4)/(x^2+6*x-1)^(1/2),x, algorithm="giac")
 

Output:

-5/84*sqrt(7)*sqrt(2)*(arctan(2) + arctan(1/8*(x - sqrt(x^2 + 6*x - 1))*(s 
qrt(14) + sqrt(2)) + 1/8*sqrt(14) + 3/8*sqrt(2))) + 5/84*sqrt(7)*sqrt(2)*( 
arctan(1/2) + arctan(-1/8*(x - sqrt(x^2 + 6*x - 1))*(sqrt(14) - sqrt(2)) - 
 1/8*sqrt(14) + 3/8*sqrt(2))) + 1/42*sqrt(7)*log(4*(4*sqrt(7)*sqrt(2) + 3* 
x + sqrt(7) - 4*sqrt(2) - 3*sqrt(x^2 + 6*x - 1) + 2)^2 + 16*(sqrt(7)*sqrt( 
2) - 3*x - sqrt(7) - sqrt(2) + 3*sqrt(x^2 + 6*x - 1) - 2)^2) - 1/42*sqrt(7 
)*log(4*(4*sqrt(7)*sqrt(2) + 3*x - sqrt(7) + 4*sqrt(2) - 3*sqrt(x^2 + 6*x 
- 1) + 2)^2 + 16*(sqrt(7)*sqrt(2) - 3*x + sqrt(7) + sqrt(2) + 3*sqrt(x^2 + 
 6*x - 1) - 2)^2)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=\int \frac {2\,x+1}{\sqrt {x^2+6\,x-1}\,\left (3\,x^2+4\,x+4\right )} \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {1+2 x}{\sqrt {-1+6 x+x^2} \left (4+4 x+3 x^2\right )} \, dx=2 \left (\int \frac {x}{3 \sqrt {x^{2}+6 x -1}\, x^{2}+4 \sqrt {x^{2}+6 x -1}\, x +4 \sqrt {x^{2}+6 x -1}}d x \right )+\int \frac {1}{3 \sqrt {x^{2}+6 x -1}\, x^{2}+4 \sqrt {x^{2}+6 x -1}\, x +4 \sqrt {x^{2}+6 x -1}}d x \] Input:

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

Output:

2*int(x/(3*sqrt(x**2 + 6*x - 1)*x**2 + 4*sqrt(x**2 + 6*x - 1)*x + 4*sqrt(x 
**2 + 6*x - 1)),x) + int(1/(3*sqrt(x**2 + 6*x - 1)*x**2 + 4*sqrt(x**2 + 6* 
x - 1)*x + 4*sqrt(x**2 + 6*x - 1)),x)