TITLE: Splitting the square root of complex function into real and imaginary parts
QUESTION [5 upvotes]: I have these functions below: $$\sqrt{(x+iy)^2-a^2}$$
$$\frac{b(x+iy)}{\sqrt{(x+iy)^2-a^2}}$$
How do I split these to get the real and imaginary parts of these functions?
If anyone could help me out, that really would be helpful!!!!
It will help me with the method of manufactured solutions for my fracture problem that has the Westergaard solution (as the analytical solution)!!!
Thank you very much,
Mousumi

REPLY [10 votes]: Let $\sqrt{(x+iy)^2-a^2}=c+id$
$\implies (x+iy)^2-a^2=(c+id)^2$
Comparing the real & the imaginary parts
$\implies c^2-d^2=x^2-y^2-a^2\  \ \ \ (1)$
$2cd=2xy$
$(c^2+d^2)^2=(c^2-d^2)^2+(2cd)^2=(x^2-y^2-a^2)^2+(2xy)^2=(x^2+y^2)^2+a^4-2a^2(x^2-y^2)$
$c^2+d^2=\sqrt{(x^2+y^2)^2+a^4-2a^2(x^2-y^2)}\  \ \ \ (2)$
Use $(1),(2)$
Observe that $cd$ will have the same sign as $xy$

REPLY [3 votes]: Basically we need a complex number $A+ib$ such that its square equals $(x+iy)^2-a^2=(x^2-a^2-y^2)+i(2xy)$.
We have: $$(A+ib)^2=(A^2-b^2)+i(2Ab)=(x^2-a^2-y^2)+i(2xy)$$ giving us: $A^2-b^2=x^2-a^2-y^2$ and $Ab=xy$.
Now, we will get, $$A^2+b^2 = \sqrt{(A^2+b^2)^2} = \sqrt{(A^2-b^2)^2+4A^2b^2}=\sqrt{(x^2-a^2-y^2)^2+4x^2y^2}$$
Thus, $A^2=\frac{1}{2}[(x^2-a^2-y^2)+\sqrt{(x^2-a^2-y^2)^2+4x^2y^2}]$ and $b^2=\frac{1}{2}[\sqrt{(x^2-a^2-y^2)^2+4x^2y^2}-(x^2-a^2-y^2)]$.
Can you take it from here?