:
Actually, it depends on your definition of sqrt() function, so the answer might be no. The key words you should google are "branch of square root".
The most conceptually correct way of defining square root function is using the complex numbers. One of the clean way: set
z^{1/2}= e^{1/2 ln(z)}
, where ln stands for natural logarithm. The reason this definition is clean is that
e^w = 1 + w/1! + w^2/2! + w^3/3! + ...
is a well defined power series, easy to handle. So is the natural logarithm:
ln(1+z) = z/1 - z^2/2 + z^3/3 - z^4/4 + ...
If you plug in
w= 1/2 ln(1+(z-1))
in
e^w
and uncover the infinite brackets you will get one power series expansion of
z^{1/2}
(for z close enough to 1).
The problem with the
sqrt()
function: in the above expression,
1 2 3 4
|
ln(1+z) = z/1 - z^2/2 + z^3/3 - z^4/4 + ...
ln(1+z) = 2i\pi+ z/1 - z^2/2 + z^3/3 - z^4/4 + ...
ln(1+z) = 4i\pi+ z/1 - z^2/2 + z^3/3 - z^4/4 + ...
ln(1+z) = 6i\pi+ z/1 - z^2/2 + z^3/3 - z^4/4 + ...
|
are all equally good definitions of the logarithm function (because e^{2i\pi}=1). The even multiples of 2i\pi will give you the positive square root, and the odd multiples - the negative.