3.11 \(\int (\frac{1}{\sqrt{2} (1+x)^2 \sqrt{-i+x^2}}+\frac{1}{\sqrt{2} (1+x)^2 \sqrt{i+x^2}}) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0750856, antiderivative size = 138, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 3, integrand size = 45, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {731, 725, 206} \[ -\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) \sqrt{x^2-i}}{\sqrt{2} (x+1)}-\frac{\left (\frac{1}{2}-\frac{i}{2}\right ) \sqrt{x^2+i}}{\sqrt{2} (x+1)}+\frac{\tanh ^{-1}\left (\frac{x+i}{\sqrt{1-i} \sqrt{x^2-i}}\right )}{(1-i)^{3/2} \sqrt{2}}-\frac{\tanh ^{-1}\left (\frac{-x+i}{\sqrt{1+i} \sqrt{x^2+i}}\right )}{(1+i)^{3/2} \sqrt{2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 731

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(e*(d + e*x)^(m + 1)*(a + c*x^2)^(p
 + 1))/((m + 1)*(c*d^2 + a*e^2)), x] + Dist[(c*d)/(c*d^2 + a*e^2), Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x]
 /; FreeQ[{a, c, d, e, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ[m + 2*p + 3, 0]

Rule 725

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 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 \left (\frac{1}{\sqrt{2} (1+x)^2 \sqrt{-i+x^2}}+\frac{1}{\sqrt{2} (1+x)^2 \sqrt{i+x^2}}\right ) \, dx &=\frac{\int \frac{1}{(1+x)^2 \sqrt{-i+x^2}} \, dx}{\sqrt{2}}+\frac{\int \frac{1}{(1+x)^2 \sqrt{i+x^2}} \, dx}{\sqrt{2}}\\ &=-\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) \sqrt{-i+x^2}}{\sqrt{2} (1+x)}-\frac{\left (\frac{1}{2}-\frac{i}{2}\right ) \sqrt{i+x^2}}{\sqrt{2} (1+x)}+\frac{\left (\frac{1}{2}-\frac{i}{2}\right ) \int \frac{1}{(1+x) \sqrt{i+x^2}} \, dx}{\sqrt{2}}+\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) \int \frac{1}{(1+x) \sqrt{-i+x^2}} \, dx}{\sqrt{2}}\\ &=-\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) \sqrt{-i+x^2}}{\sqrt{2} (1+x)}-\frac{\left (\frac{1}{2}-\frac{i}{2}\right ) \sqrt{i+x^2}}{\sqrt{2} (1+x)}+-\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) \operatorname{Subst}\left (\int \frac{1}{(1-i)-x^2} \, dx,x,\frac{-i-x}{\sqrt{-i+x^2}}\right )}{\sqrt{2}}+-\frac{\left (\frac{1}{2}-\frac{i}{2}\right ) \operatorname{Subst}\left (\int \frac{1}{(1+i)-x^2} \, dx,x,\frac{i-x}{\sqrt{i+x^2}}\right )}{\sqrt{2}}\\ &=-\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) \sqrt{-i+x^2}}{\sqrt{2} (1+x)}-\frac{\left (\frac{1}{2}-\frac{i}{2}\right ) \sqrt{i+x^2}}{\sqrt{2} (1+x)}+\frac{\tanh ^{-1}\left (\frac{i+x}{\sqrt{1-i} \sqrt{-i+x^2}}\right )}{(1-i)^{3/2} \sqrt{2}}-\frac{\tanh ^{-1}\left (\frac{i-x}{\sqrt{1+i} \sqrt{i+x^2}}\right )}{(1+i)^{3/2} \sqrt{2}}\\ \end{align*}

Mathematica [A]  time = 0.19884, size = 125, normalized size = 0.91 \[ \frac{i \left ((1+i) \left (i \sqrt{x^2-i}+\sqrt{x^2+i}\right )+\sqrt{1-i} (x+1) \tanh ^{-1}\left (\frac{x+i}{\sqrt{1-i} \sqrt{x^2-i}}\right )+\sqrt{1+i} (x+1) \tanh ^{-1}\left (\frac{(1+i)^{3/2} (1+i x)}{2 \sqrt{x^2+i}}\right )\right )}{2 \sqrt{2} (x+1)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.02, size = 278, normalized size = 2. \begin{align*} -{\frac{\sqrt{2}}{4+4\,x}\sqrt{ \left ( 1+x \right ) ^{2}-1-i-2\,x}}-{\frac{{\frac{i}{4}}\sqrt{2}}{1+x}\sqrt{ \left ( 1+x \right ) ^{2}-1-i-2\,x}}-{\frac{\sqrt{2}}{4\,\sqrt{1-i}}\ln \left ({\frac{1}{1+x} \left ( -2\,i-2\,x+2\,\sqrt{1-i}\sqrt{ \left ( 1+x \right ) ^{2}-1-i-2\,x} \right ) } \right ) }-{\frac{{\frac{i}{4}}\sqrt{2}}{\sqrt{1-i}}\ln \left ({\frac{1}{1+x} \left ( -2\,i-2\,x+2\,\sqrt{1-i}\sqrt{ \left ( 1+x \right ) ^{2}-1-i-2\,x} \right ) } \right ) }-{\frac{\sqrt{2}}{4+4\,x}\sqrt{ \left ( 1+x \right ) ^{2}-1+i-2\,x}}+{\frac{{\frac{i}{4}}\sqrt{2}}{1+x}\sqrt{ \left ( 1+x \right ) ^{2}-1+i-2\,x}}-{\frac{\sqrt{2}}{4\,\sqrt{1+i}}\ln \left ({\frac{1}{1+x} \left ( 2\,i-2\,x+2\,\sqrt{1+i}\sqrt{ \left ( 1+x \right ) ^{2}-1+i-2\,x} \right ) } \right ) }+{\frac{{\frac{i}{4}}\sqrt{2}}{\sqrt{1+i}}\ln \left ({\frac{1}{1+x} \left ( 2\,i-2\,x+2\,\sqrt{1+i}\sqrt{ \left ( 1+x \right ) ^{2}-1+i-2\,x} \right ) } \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/2/(1+x)^2*2^(1/2)/(-I+x^2)^(1/2)+1/2/(1+x)^2*2^(1/2)/(I+x^2)^(1/2),x)

[Out]

-1/4*2^(1/2)/(1+x)*((1+x)^2-1-I-2*x)^(1/2)-1/4*I*2^(1/2)/(1+x)*((1+x)^2-1-I-2*x)^(1/2)-1/4*2^(1/2)/(1-I)^(1/2)
*ln((-2*I-2*x+2*(1-I)^(1/2)*((1+x)^2-1-I-2*x)^(1/2))/(1+x))-1/4*I*2^(1/2)/(1-I)^(1/2)*ln((-2*I-2*x+2*(1-I)^(1/
2)*((1+x)^2-1-I-2*x)^(1/2))/(1+x))-1/4*2^(1/2)/(1+x)*((1+x)^2-1+I-2*x)^(1/2)+1/4*I*2^(1/2)/(1+x)*((1+x)^2-1+I-
2*x)^(1/2)-1/4*2^(1/2)/(1+I)^(1/2)*ln((2*I-2*x+2*(1+I)^(1/2)*((1+x)^2-1+I-2*x)^(1/2))/(1+x))+1/4*I*2^(1/2)/(1+
I)^(1/2)*ln((2*I-2*x+2*(1+I)^(1/2)*((1+x)^2-1+I-2*x)^(1/2))/(1+x))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.28061, size = 678, normalized size = 4.91 \begin{align*} \frac{\sqrt{-\frac{1}{2} i + \frac{1}{2}}{\left (-\left (i - 1\right ) \, x - i + 1\right )} \log \left (\sqrt{2} \sqrt{-\frac{1}{2} i + \frac{1}{2}} - x + \sqrt{x^{2} - i} - 1\right ) + \sqrt{-\frac{1}{2} i + \frac{1}{2}}{\left (\left (i - 1\right ) \, x + i - 1\right )} \log \left (-\sqrt{2} \sqrt{-\frac{1}{2} i + \frac{1}{2}} - x + \sqrt{x^{2} - i} - 1\right ) + \sqrt{-\frac{1}{2} i - \frac{1}{2}}{\left (-\left (i + 1\right ) \, x - i - 1\right )} \log \left (i \, \sqrt{2} \sqrt{-\frac{1}{2} i - \frac{1}{2}} - x + \sqrt{x^{2} + i} - 1\right ) + \sqrt{-\frac{1}{2} i - \frac{1}{2}}{\left (\left (i + 1\right ) \, x + i + 1\right )} \log \left (-i \, \sqrt{2} \sqrt{-\frac{1}{2} i - \frac{1}{2}} - x + \sqrt{x^{2} + i} - 1\right ) + \sqrt{2}{\left (-\left (i + 1\right ) \, x - i - 1\right )} - \sqrt{2} \sqrt{x^{2} + i} - i \, \sqrt{2} \sqrt{x^{2} - i}}{\left (2 i + 2\right ) \, x + 2 i + 2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: TypeError