3.1.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\) [11]

Optimal. Leaf size=138 \[ -\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}} \]

[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.05, 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 = {745, 739, 212} \begin {gather*} -\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}} \end {gather*}

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

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 ) \text {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 ) \text {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 = 3.73, size = 126, normalized size = 0.91 \begin {gather*} -\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) \left (i \sqrt {-i+x^2}+\sqrt {i+x^2}+\frac {2 (1+x) \tan ^{-1}\left (\sqrt {-\frac {1}{2}-\frac {i}{2}} \left (1+x-\sqrt {-i+x^2}\right )\right )}{\sqrt {1-i}}+(1+i)^{3/2} (1+x) \tan ^{-1}\left (\sqrt {-\frac {1}{2}+\frac {i}{2}} \left (1+x-\sqrt {i+x^2}\right )\right )\right )}{\sqrt {2} (1+x)} \end {gather*}

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]

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

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: Invalid comparison of non-real I} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

cought exception: Invalid comparison of non-real I

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (101 ) = 202\).
time = 0.12, size = 278, normalized size = 2.01

method result size
default \(-\frac {\sqrt {2}\, \sqrt {\left (1+x \right )^{2}-2 x -1-i}}{4 \left (1+x \right )}-\frac {i \sqrt {2}\, \sqrt {\left (1+x \right )^{2}-2 x -1-i}}{4 \left (1+x \right )}-\frac {\sqrt {2}\, \ln \left (\frac {-2 i-2 x +2 \sqrt {1-i}\, \sqrt {\left (1+x \right )^{2}-2 x -1-i}}{1+x}\right )}{4 \sqrt {1-i}}-\frac {i \sqrt {2}\, \ln \left (\frac {-2 i-2 x +2 \sqrt {1-i}\, \sqrt {\left (1+x \right )^{2}-2 x -1-i}}{1+x}\right )}{4 \sqrt {1-i}}-\frac {\sqrt {2}\, \sqrt {\left (1+x \right )^{2}-2 x -1+i}}{4 \left (1+x \right )}+\frac {i \sqrt {2}\, \sqrt {\left (1+x \right )^{2}-2 x -1+i}}{4+4 x}-\frac {\sqrt {2}\, \ln \left (\frac {2 i-2 x +2 \sqrt {1+i}\, \sqrt {\left (1+x \right )^{2}-2 x -1+i}}{1+x}\right )}{4 \sqrt {1+i}}+\frac {i \sqrt {2}\, \ln \left (\frac {2 i-2 x +2 \sqrt {1+i}\, \sqrt {\left (1+x \right )^{2}-2 x -1+i}}{1+x}\right )}{4 \sqrt {1+i}}\) \(278\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 161, normalized size = 1.17 \begin {gather*} \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 {gather*}

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.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

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 [A]
time = 0.01, size = 213, normalized size = 1.54 \begin {gather*} -\frac {4}{2} \sqrt {2} \left (\frac {\sqrt {-I+x^{2}}-x-I}{\left (2 I-2\right ) \left (\left (\sqrt {-I+x^{2}}-x\right )^{2}-2 \left (\sqrt {-I+x^{2}}-x\right )+I\right )}+\frac {\arctan \left (\frac {\sqrt {-I+x^{2}}-x-1}{\sqrt {I-1}}\right )}{2 \left (I-1\right ) \sqrt {I-1}}\right )-\frac {4}{2} \sqrt {2} \left (\frac {-\sqrt {I+x^{2}}+x-I}{\left (2 I+2\right ) \left (\left (\sqrt {I+x^{2}}-x\right )^{2}-2 \left (\sqrt {I+x^{2}}-x\right )-I\right )}-\frac {\arctan \left (\frac {\sqrt {I+x^{2}}-x-1}{\sqrt {-I-1}}\right )}{2 \left (I+1\right ) \sqrt {-I-1}}\right ) \end {gather*}

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]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \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 \end {gather*}

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)

________________________________________________________________________________________