Integrand size = 18, antiderivative size = 62 \[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=\frac {\sqrt {4+2 x+x^2}}{1-x}+\text {arcsinh}\left (\frac {1+x}{\sqrt {3}}\right )-\frac {2 \text {arctanh}\left (\frac {5+2 x}{\sqrt {7} \sqrt {4+2 x+x^2}}\right )}{\sqrt {7}} \]
arcsinh(1/3*(1+x)*3^(1/2))-2/7*arctanh(1/7*(5+2*x)*7^(1/2)/(x^2+2*x+4)^(1/ 2))*7^(1/2)+(x^2+2*x+4)^(1/2)/(1-x)
Time = 0.27 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.15 \[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=-\frac {\sqrt {4+2 x+x^2}}{-1+x}-\frac {4 \text {arctanh}\left (\frac {1-x+\sqrt {4+2 x+x^2}}{\sqrt {7}}\right )}{\sqrt {7}}-\log \left (-1-x+\sqrt {4+2 x+x^2}\right ) \]
-(Sqrt[4 + 2*x + x^2]/(-1 + x)) - (4*ArcTanh[(1 - x + Sqrt[4 + 2*x + x^2]) /Sqrt[7]])/Sqrt[7] - Log[-1 - x + Sqrt[4 + 2*x + x^2]]
Time = 0.23 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.08, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.389, Rules used = {1161, 27, 1269, 1090, 222, 1154, 219}
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 {\sqrt {x^2+2 x+4}}{(x-1)^2} \, dx\) |
\(\Big \downarrow \) 1161 |
\(\displaystyle \frac {1}{2} \int -\frac {2 (x+1)}{(1-x) \sqrt {x^2+2 x+4}}dx+\frac {\sqrt {x^2+2 x+4}}{1-x}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\sqrt {x^2+2 x+4}}{1-x}-\int \frac {x+1}{(1-x) \sqrt {x^2+2 x+4}}dx\) |
\(\Big \downarrow \) 1269 |
\(\displaystyle \int \frac {1}{\sqrt {x^2+2 x+4}}dx-2 \int \frac {1}{(1-x) \sqrt {x^2+2 x+4}}dx+\frac {\sqrt {x^2+2 x+4}}{1-x}\) |
\(\Big \downarrow \) 1090 |
\(\displaystyle -2 \int \frac {1}{(1-x) \sqrt {x^2+2 x+4}}dx+\frac {\int \frac {1}{\sqrt {\frac {1}{12} (2 x+2)^2+1}}d(2 x+2)}{2 \sqrt {3}}+\frac {\sqrt {x^2+2 x+4}}{1-x}\) |
\(\Big \downarrow \) 222 |
\(\displaystyle -2 \int \frac {1}{(1-x) \sqrt {x^2+2 x+4}}dx+\text {arcsinh}\left (\frac {2 x+2}{2 \sqrt {3}}\right )+\frac {\sqrt {x^2+2 x+4}}{1-x}\) |
\(\Big \downarrow \) 1154 |
\(\displaystyle 4 \int \frac {1}{28-\frac {4 (2 x+5)^2}{x^2+2 x+4}}d\left (-\frac {2 (2 x+5)}{\sqrt {x^2+2 x+4}}\right )+\text {arcsinh}\left (\frac {2 x+2}{2 \sqrt {3}}\right )+\frac {\sqrt {x^2+2 x+4}}{1-x}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \text {arcsinh}\left (\frac {2 x+2}{2 \sqrt {3}}\right )-\frac {2 \text {arctanh}\left (\frac {2 x+5}{\sqrt {7} \sqrt {x^2+2 x+4}}\right )}{\sqrt {7}}+\frac {\sqrt {x^2+2 x+4}}{1-x}\) |
Sqrt[4 + 2*x + x^2]/(1 - x) + ArcSinh[(2 + 2*x)/(2*Sqrt[3])] - (2*ArcTanh[ (5 + 2*x)/(Sqrt[7]*Sqrt[4 + 2*x + x^2])])/Sqrt[7]
3.3.80.3.1 Defintions of rubi rules used
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[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
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]
Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[1/(2*c*(-4* (c/(b^2 - 4*a*c)))^p) Subst[Int[Simp[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]
Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Sym bol] :> Simp[-2 Subst[Int[1/(4*c*d^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, ( 2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c , d, e}, x]
Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_S ymbol] :> Simp[(d + e*x)^(m + 1)*((a + b*x + c*x^2)^p/(e*(m + 1))), x] - Si mp[p/(e*(m + 1)) Int[(d + e*x)^(m + 1)*(b + 2*c*x)*(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && GtQ[p, 0] && (IntegerQ[p] || LtQ[m, -1]) && NeQ[m, -1] && !ILtQ[m + 2*p + 1, 0] && IntQuadraticQ[a, b, c, d, e, m, p, x]
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c _.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g/e Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Simp[(e*f - d*g)/e Int[(d + e*x)^m*(a + b*x + c*x^2)^ p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && !IGtQ[m, 0]
Time = 0.48 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.90
method | result | size |
risch | \(-\frac {\sqrt {x^{2}+2 x +4}}{-1+x}+\operatorname {arcsinh}\left (\frac {\left (1+x \right ) \sqrt {3}}{3}\right )-\frac {2 \sqrt {7}\, \operatorname {arctanh}\left (\frac {\left (10+4 x \right ) \sqrt {7}}{14 \sqrt {\left (-1+x \right )^{2}+3+4 x}}\right )}{7}\) | \(56\) |
trager | \(-\frac {\sqrt {x^{2}+2 x +4}}{-1+x}+\ln \left (1+x +\sqrt {x^{2}+2 x +4}\right )+\frac {2 \operatorname {RootOf}\left (\textit {\_Z}^{2}-7\right ) \ln \left (-\frac {-2 \operatorname {RootOf}\left (\textit {\_Z}^{2}-7\right ) x +7 \sqrt {x^{2}+2 x +4}-5 \operatorname {RootOf}\left (\textit {\_Z}^{2}-7\right )}{-1+x}\right )}{7}\) | \(79\) |
default | \(-\frac {\left (\left (-1+x \right )^{2}+3+4 x \right )^{\frac {3}{2}}}{7 \left (-1+x \right )}+\frac {2 \sqrt {\left (-1+x \right )^{2}+3+4 x}}{7}+\operatorname {arcsinh}\left (\frac {\left (1+x \right ) \sqrt {3}}{3}\right )-\frac {2 \sqrt {7}\, \operatorname {arctanh}\left (\frac {\left (10+4 x \right ) \sqrt {7}}{14 \sqrt {\left (-1+x \right )^{2}+3+4 x}}\right )}{7}+\frac {\left (2 x +2\right ) \sqrt {\left (-1+x \right )^{2}+3+4 x}}{14}\) | \(91\) |
-1/(-1+x)*(x^2+2*x+4)^(1/2)+arcsinh(1/3*(1+x)*3^(1/2))-2/7*7^(1/2)*arctanh (1/14*(10+4*x)*7^(1/2)/((-1+x)^2+3+4*x)^(1/2))
Time = 0.25 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.48 \[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=\frac {2 \, \sqrt {7} {\left (x - 1\right )} \log \left (\frac {\sqrt {7} {\left (2 \, x + 5\right )} + \sqrt {x^{2} + 2 \, x + 4} {\left (2 \, \sqrt {7} - 7\right )} - 4 \, x - 10}{x - 1}\right ) - 7 \, {\left (x - 1\right )} \log \left (-x + \sqrt {x^{2} + 2 \, x + 4} - 1\right ) - 7 \, x - 7 \, \sqrt {x^{2} + 2 \, x + 4} + 7}{7 \, {\left (x - 1\right )}} \]
1/7*(2*sqrt(7)*(x - 1)*log((sqrt(7)*(2*x + 5) + sqrt(x^2 + 2*x + 4)*(2*sqr t(7) - 7) - 4*x - 10)/(x - 1)) - 7*(x - 1)*log(-x + sqrt(x^2 + 2*x + 4) - 1) - 7*x - 7*sqrt(x^2 + 2*x + 4) + 7)/(x - 1)
\[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=\int \frac {\sqrt {x^{2} + 2 x + 4}}{\left (x - 1\right )^{2}}\, dx \]
Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.98 \[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=-\frac {2}{7} \, \sqrt {7} \operatorname {arsinh}\left (\frac {2 \, \sqrt {3} x}{3 \, {\left | x - 1 \right |}} + \frac {5 \, \sqrt {3}}{3 \, {\left | x - 1 \right |}}\right ) - \frac {\sqrt {x^{2} + 2 \, x + 4}}{x - 1} + \operatorname {arsinh}\left (\frac {1}{3} \, \sqrt {3} x + \frac {1}{3} \, \sqrt {3}\right ) \]
-2/7*sqrt(7)*arcsinh(2/3*sqrt(3)*x/abs(x - 1) + 5/3*sqrt(3)/abs(x - 1)) - sqrt(x^2 + 2*x + 4)/(x - 1) + arcsinh(1/3*sqrt(3)*x + 1/3*sqrt(3))
Leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (53) = 106\).
Time = 0.35 (sec) , antiderivative size = 149, normalized size of antiderivative = 2.40 \[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=-\frac {2}{7} \, \sqrt {7} \log \left (\sqrt {7} {\left (\sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} + \frac {\sqrt {7}}{x - 1}\right )} + 2\right ) \mathrm {sgn}\left (\frac {1}{x - 1}\right ) + \log \left (\sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} + \frac {\sqrt {7}}{x - 1} + 1\right ) \mathrm {sgn}\left (\frac {1}{x - 1}\right ) - \log \left ({\left | \sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} + \frac {\sqrt {7}}{x - 1} - 1 \right |}\right ) \mathrm {sgn}\left (\frac {1}{x - 1}\right ) - \sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} \mathrm {sgn}\left (\frac {1}{x - 1}\right ) \]
-2/7*sqrt(7)*log(sqrt(7)*(sqrt(4/(x - 1) + 7/(x - 1)^2 + 1) + sqrt(7)/(x - 1)) + 2)*sgn(1/(x - 1)) + log(sqrt(4/(x - 1) + 7/(x - 1)^2 + 1) + sqrt(7) /(x - 1) + 1)*sgn(1/(x - 1)) - log(abs(sqrt(4/(x - 1) + 7/(x - 1)^2 + 1) + sqrt(7)/(x - 1) - 1))*sgn(1/(x - 1)) - sqrt(4/(x - 1) + 7/(x - 1)^2 + 1)* sgn(1/(x - 1))
Timed out. \[ \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx=\int \frac {\sqrt {x^2+2\,x+4}}{{\left (x-1\right )}^2} \,d x \]