sqrt question
04-26-2017, 03:08 AM
Post: #21
 Claudio L. Senior Member Posts: 1,822 Joined: Dec 2013
RE: sqrt question
(04-24-2017 09:36 PM)David Hayden Wrote:
(04-09-2017 03:59 AM)Claudio L. Wrote:  sqrt(1) = 1
sqrt( (-1)*(-1) ) = sqrt(-1)*sqrt(-1) = i*i = -1
Isn't it:
sqrt(1) = 1 or -1.
sqrt( (-1)*(-1) ) = sqrt(-1)*sqrt(-1) = (+/-i)*(+/-i) = -1 or 1

The fact that we usually mean "the positive answer" when we say "sqrt(x)" doesn't negate the fact that there is also a negative answer.

That post was intended as proof that even when selecting always the positive root as "the one true answer", it is possible to arrive to the other root by using trivial algebraic manipulations.
Otherwise, I agree with you and Han that both answers are correct and valid, one is not better than the other.
04-28-2017, 06:09 PM
Post: #22
 Han Senior Member Posts: 1,881 Joined: Dec 2013
RE: sqrt question
(04-09-2017 03:59 AM)Claudio L. Wrote:
(04-07-2017 10:54 PM)Han Wrote:  Is this due to the sqrt() function, though? This seems like a consequence of assuming factorization properties of 1 and -1 that may not still hold true for complex numbers.

The factorization properties hold true for complex numbers. The problem is more about the interaction between the sqrt() function and its argument because of mapping to the principal branch.
For example:

sqrt(1) = 1
sqrt( (-1)*(-1) ) = sqrt(-1)*sqrt(-1) = i*i = -1

What happened here? we replaced 1 (in polar coordinates, its argument is zero), with two numbers with an argument of 180 degrees. The multiplication of these 2 numbers (-1) would give you an argument of 360 degrees. The convention for sqrt is to halve the argument, so the result of sqrt(1*exp(i*2pi)) is 1*exp(i*pi) = -1
while sqrt(1*exp(i*0)) = 1*exp(i*0) = 1

Now the value 1*exp(i*2pi) should've been reduced to 1*exp(i*0) prior to performing the sqrt(). However, when you distribute the sqrt doing sqrt(-1)*sqrt(-1), you are not allowing that reduction to take place. Both arguments of 180 degree get halved, then added together by the multiplication resulting in 180 degree again (hence the negative result).

So this is a consequence that 1 = (-1)*(-1), while mathematically true and correct, gets treated differently by the sqrt() when you split it. But there's nothing wrong, the result is correct, just that you've been pushed to the other solution. There's no way around it that I know of.

It is not clear to me what you mean by the factorization holds true for complex numbers.

I agree that $$\sqrt{ab} = \sqrt{a} \sqrt{b}$$ provided that $$a$$, $$b$$, and $$ab$$ are non-negative. However, I question whether the definition of $$\sqrt{x}$$ has been implicitly changed when you allow $$a$$ and $$b$$ to be negative.

For complex numbers, which can be represented as $$re^{i\theta}$$, (where $$r$$ is a non-negative real number and $$-\pi < \theta \le \pi$$ ), we have the "principal root"
$\sqrt{z} = \sqrt{re^{i\theta}} = \sqrt{r} e^{i\theta/2}$

The reason your example produces two outcomes is because you did not define the square root function (over the complex plane) to be one-to-one (unless you are restricting $$\theta$$ to be strictly positive and less than or equal to $$2\pi$$ ). My point here is that it is mathematically possible to define the square root function for a complex number without obtaining ambiguous results.

Graph 3D | QPI | SolveSys
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)