3.1.6 \(\int \frac {\sqrt {-1+x^2}}{(-i+x)^2} \, dx\) [6]

Optimal. Leaf size=64 \[ \frac {\sqrt {-1+x^2}}{i-x}-\frac {i \tan ^{-1}\left (\frac {1-i x}{\sqrt {2} \sqrt {-1+x^2}}\right )}{\sqrt {2}}+\tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right ) \]

[Out]

arctanh(x/(x^2-1)^(1/2))-1/2*I*arctan(1/2*(1-I*x)*2^(1/2)/(x^2-1)^(1/2))*2^(1/2)+(x^2-1)^(1/2)/(I-x)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {747, 858, 223, 212, 739, 210} \begin {gather*} \frac {\sqrt {x^2-1}}{-x+i}-\frac {i \tan ^{-1}\left (\frac {1-i x}{\sqrt {2} \sqrt {x^2-1}}\right )}{\sqrt {2}}+\tanh ^{-1}\left (\frac {x}{\sqrt {x^2-1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[-1 + x^2]/(-I + x)^2,x]

[Out]

Sqrt[-1 + x^2]/(I - x) - (I*ArcTan[(1 - I*x)/(Sqrt[2]*Sqrt[-1 + x^2])])/Sqrt[2] + ArcTanh[x/Sqrt[-1 + 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 223

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

Rule 739

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rule 747

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(d + e*x)^(m + 1)*((a + c*x^2)^p/(e
*(m + 1))), x] - Dist[2*c*(p/(e*(m + 1))), Int[x*(d + e*x)^(m + 1)*(a + c*x^2)^(p - 1), x], x] /; FreeQ[{a, c,
 d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[p, 0] && (IntegerQ[p] || LtQ[m, -1]) && NeQ[m, -1] &&  !ILtQ[m +
 2*p + 1, 0] && IntQuadraticQ[a, 0, c, d, e, m, p, x]

Rule 858

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.18, size = 66, normalized size = 1.03 \begin {gather*} \frac {\sqrt {-1+x^2}}{i-x}+\tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {1+i x-i \sqrt {-1+x^2}}{\sqrt {2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[-1 + x^2]/(-I + x)^2,x]

[Out]

Sqrt[-1 + x^2]/(I - x) + ArcTanh[x/Sqrt[-1 + x^2]] - Sqrt[2]*ArcTanh[(1 + I*x - I*Sqrt[-1 + x^2])/Sqrt[2]]

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded while calling a Python object} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Sqrt[x^2 - 1]/(x - I)^2,x]')

[Out]

cought exception: maximum recursion depth exceeded while calling a Python object

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (52 ) = 104\).
time = 0.12, size = 150, normalized size = 2.34

method result size
risch \(-\frac {\sqrt {x^{2}-1}}{x -i}+\ln \left (x +\sqrt {x^{2}-1}\right )+\frac {i \sqrt {2}\, \arctan \left (\frac {\left (-4+2 i \left (x -i\right )\right ) \sqrt {2}}{4 \sqrt {\left (x -i\right )^{2}+2 i \left (x -i\right )-2}}\right )}{2}\) \(65\)
default \(\frac {\left (\left (x -i\right )^{2}+2 i \left (x -i\right )-2\right )^{\frac {3}{2}}}{2 x -2 i}-\frac {i \left (\sqrt {\left (x -i\right )^{2}+2 i \left (x -i\right )-2}+i \ln \left (x +\sqrt {\left (x -i\right )^{2}+2 i \left (x -i\right )-2}\right )-\sqrt {2}\, \arctan \left (\frac {\left (-4+2 i \left (x -i\right )\right ) \sqrt {2}}{4 \sqrt {\left (x -i\right )^{2}+2 i \left (x -i\right )-2}}\right )\right )}{2}-\frac {x \sqrt {\left (x -i\right )^{2}+2 i \left (x -i\right )-2}}{2}+\frac {\ln \left (x +\sqrt {\left (x -i\right )^{2}+2 i \left (x -i\right )-2}\right )}{2}\) \(150\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-1)^(1/2)/(x-I)^2,x,method=_RETURNVERBOSE)

[Out]

1/2/(x-I)*((x-I)^2+2*I*(x-I)-2)^(3/2)-1/2*I*(((x-I)^2+2*I*(x-I)-2)^(1/2)+I*ln(x+((x-I)^2+2*I*(x-I)-2)^(1/2))-2
^(1/2)*arctan(1/4*(-4+2*I*(x-I))*2^(1/2)/((x-I)^2+2*I*(x-I)-2)^(1/2)))-1/2*x*((x-I)^2+2*I*(x-I)-2)^(1/2)+1/2*l
n(x+((x-I)^2+2*I*(x-I)-2)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.33, size = 53, normalized size = 0.83 \begin {gather*} \frac {1}{2} i \, \sqrt {2} \arcsin \left (\frac {i \, x}{{\left | x - i \right |}} - \frac {1}{{\left | x - i \right |}}\right ) - \frac {\sqrt {x^{2} - 1}}{x - i} + \log \left (2 \, x + 2 \, \sqrt {x^{2} - 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*I*sqrt(2)*arcsin(I*x/abs(x - I) - 1/abs(x - I)) - sqrt(x^2 - 1)/(x - I) + log(2*x + 2*sqrt(x^2 - 1))

________________________________________________________________________________________

Fricas [A]
time = 0.60, size = 89, normalized size = 1.39 \begin {gather*} -\frac {\sqrt {2} {\left (x - i\right )} \log \left (-x + i \, \sqrt {2} + \sqrt {x^{2} - 1} + i\right ) - \sqrt {2} {\left (x - i\right )} \log \left (-x - i \, \sqrt {2} + \sqrt {x^{2} - 1} + i\right ) + 2 \, {\left (x - i\right )} \log \left (-x + \sqrt {x^{2} - 1}\right ) + 2 \, x + 2 \, \sqrt {x^{2} - 1} - 2 i}{2 \, {\left (x - i\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(sqrt(2)*(x - I)*log(-x + I*sqrt(2) + sqrt(x^2 - 1) + I) - sqrt(2)*(x - I)*log(-x - I*sqrt(2) + sqrt(x^2
- 1) + I) + 2*(x - I)*log(-x + sqrt(x^2 - 1)) + 2*x + 2*sqrt(x^2 - 1) - 2*I)/(x - I)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-1)**(1/2)/(-I+x)**2,x)

[Out]

Integral(sqrt((x - 1)*(x + 1))/(x - I)**2, x)

________________________________________________________________________________________

Giac [A]
time = 0.01, size = 114, normalized size = 1.78 \begin {gather*} 2 \left (-\frac {\ln \left |\sqrt {x^{2}-1}-x\right |}{2}+\frac {2 I \arctan \left (\frac {I+\sqrt {x^{2}-1}-x}{\sqrt {-I^{2}+1}}\right )}{2 \sqrt {-I^{2}+1}}+\frac {\left (\sqrt {x^{2}-1}-x\right ) I+1}{-\left (\sqrt {x^{2}-1}-x\right )^{2}-2 \left (\sqrt {x^{2}-1}-x\right ) I-1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)^(1/2)/(-I+x)^2,x)

[Out]

I*sqrt(2)*arctan(-1/2*sqrt(2)*(x - sqrt(x^2 - 1) - I)) - 2*(-I*x + I*sqrt(x^2 - 1) + 1)/((x - sqrt(x^2 - 1))^2
 - 2*I*x + 2*I*sqrt(x^2 - 1) + 1) - log(abs(-x + sqrt(x^2 - 1)))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 - 1)^(1/2)/(x - 1i)^2,x)

[Out]

int((x^2 - 1)^(1/2)/(x - 1i)^2, x)

________________________________________________________________________________________