To evaluate the square root (and in general any root) of a complex number I would first convert it into trigonometric form:
z=r[cos(theta)+isin(theta)]z=r[cos(θ)+isin(θ)]
and then use the fact that:
z^n=r^n[cos(n*theta)+isin(n*theta)]zn=rn[cos(n⋅θ)+isin(n⋅θ)]
Where, in our case, n=1/2n=12 (remembering that sqrt(x)=x^(1/2)√x=x12).
To evaluate the nthnth root of a complex number I would write:
nsqrt(z)=z^(1/n)=r^(1/n)*[cos((theta+2kpi)/n)+isin((theta+2kpi)/n)]n√z=z1n=r1n⋅[cos(θ+2kπn)+isin(θ+2kπn)]
Where k=0..n-1k=0..n−1
For example: consider z=2+3.46iz=2+3.46i and let us try sqrt(z)√z;
zz can be written as:
z=4[cos(pi/3)+isin(pi/3)]z=4[cos(π3)+isin(π3)]
So:
k=0k=0
sqrt(z)=z^(1/2)=4^(1/2)[cos((pi/3+0)/2)+isin((pi/3+0)/2)]=√z=z12=412[cos(π3+02)+isin(π3+02)]=
=2[cos(pi/6)+isin(pi/6))]=2[cos(π6)+isin(π6))]
And:
k=n-1=2-1=1k=n−1=2−1=1
sqrt(z)=z^(1/2)=4^(1/2)[cos((pi/3+2pi)/2)+isin((pi/3+2pi)/2)]=√z=z12=412[cos(π3+2π2)+isin(π3+2π2)]=
=2[cos(7pi/6)+isin(7pi/6))]=2[cos(7π6)+isin(7π6))]
Which gives, in total, two solutions.