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*arctanh((I+x)/(1-I)^(1/2)/(-I+x^2)^(1/2))/(1-I)^(3/2)*2^(1/2)-1/2*arctanh((I-x)/(1+I)^(1/2)/(I+x^2)^(1/2))
/(1+I)^(3/2)*2^(1/2)-(1/4+1/4*I)*(-I+x^2)^(1/2)/(1+x)*2^(1/2)+(-1/4+1/4*I)*(I+x^2)^(1/2)/(1+x)*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 138, normalized size of antiderivative = 1.00, 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 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])

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 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]

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.20, 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))

________________________________________________________________________________________

fricas [A]  time = 1.06, size = 161, normalized size = 1.17 \[ \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} \]

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)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

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 >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, replacing 0 by ` u`, a substitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a sub
stitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a substitution variable should perha
ps be purged.

________________________________________________________________________________________

maple [B]  time = 0.03, size = 278, normalized size = 2.01 \[ -\frac {\sqrt {2}\, \ln \left (\frac {-2 x -2 i+2 \sqrt {1-i}\, \sqrt {-2 x +\left (x +1\right )^{2}-1-i}}{x +1}\right )}{4 \sqrt {1-i}}-\frac {i \sqrt {2}\, \ln \left (\frac {-2 x -2 i+2 \sqrt {1-i}\, \sqrt {-2 x +\left (x +1\right )^{2}-1-i}}{x +1}\right )}{4 \sqrt {1-i}}-\frac {\sqrt {2}\, \ln \left (\frac {-2 x +2 i+2 \sqrt {1+i}\, \sqrt {-2 x +\left (x +1\right )^{2}-1+i}}{x +1}\right )}{4 \sqrt {1+i}}+\frac {i \sqrt {2}\, \ln \left (\frac {-2 x +2 i+2 \sqrt {1+i}\, \sqrt {-2 x +\left (x +1\right )^{2}-1+i}}{x +1}\right )}{4 \sqrt {1+i}}-\frac {\sqrt {2}\, \sqrt {-2 x +\left (x +1\right )^{2}-1-i}}{4 \left (x +1\right )}-\frac {i \sqrt {2}\, \sqrt {-2 x +\left (x +1\right )^{2}-1-i}}{4 \left (x +1\right )}-\frac {\sqrt {2}\, \sqrt {-2 x +\left (x +1\right )^{2}-1+i}}{4 \left (x +1\right )}+\frac {i \sqrt {2}\, \sqrt {-2 x +\left (x +1\right )^{2}-1+i}}{4 x +4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

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 >> ECL says: In function CAR, the value of the first argument is  1which is not
 of the expected type LIST

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {\sqrt {2}}{2\,\sqrt {x^2-\mathrm {i}}\,{\left (x+1\right )}^2}+\frac {\sqrt {2}}{2\,\sqrt {x^2+1{}\mathrm {i}}\,{\left (x+1\right )}^2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

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

________________________________________________________________________________________