ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 18 Apr 2020 11:36:45 +0200Unexpected result in calculating limitshttps://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/Limit of `sqrt(x-3)` when `x` approaches `3` doesn't exist but the sage returns `0`. Why is that?
sage:
sage: limit(sqrt(x-3), x=3)
0
sage:
Wed, 15 Apr 2020 13:43:24 +0200https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/Answer by Sébastien for <p>Limit of <code>sqrt(x-3)</code> when <code>x</code> approaches <code>3</code> doesn't exist but the sage returns <code>0</code>. Why is that?</p>
<pre><code>sage:
sage: limit(sqrt(x-3), x=3)
0
sage:
</code></pre>
https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?answer=50771#post-id-50771Maybe because the square root function is defined for negative numbers and the square root of small negative numbers converges to zero as well (on the Complex plane):
sage: sqrt(-.00000001)
0.000100000000000000*I
Wed, 15 Apr 2020 20:24:43 +0200https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?answer=50771#post-id-50771Comment by gg for <p>Maybe because the square root function is defined for negative numbers and the square root of small negative numbers converges to zero as well (on the Complex plane):</p>
<pre><code>sage: sqrt(-.00000001)
0.000100000000000000*I
</code></pre>
https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50828#post-id-50828BTW, I don't quite understand the term "complex plane" and how the square root converges to 0. Where I can read more about it?Sat, 18 Apr 2020 08:19:52 +0200https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50828#post-id-50828Comment by Sébastien for <p>Maybe because the square root function is defined for negative numbers and the square root of small negative numbers converges to zero as well (on the Complex plane):</p>
<pre><code>sage: sqrt(-.00000001)
0.000100000000000000*I
</code></pre>
https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50832#post-id-50832You may learn about the complex plane here https://en.wikipedia.org/wiki/Complex_number and there is a section on the square root of negative number in the wikipedia page of the square root: https://en.wikipedia.org/wiki/Square_root#Square_roots_of_negative_and_complex_numbersSat, 18 Apr 2020 11:36:45 +0200https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50832#post-id-50832Comment by gg for <p>Maybe because the square root function is defined for negative numbers and the square root of small negative numbers converges to zero as well (on the Complex plane):</p>
<pre><code>sage: sqrt(-.00000001)
0.000100000000000000*I
</code></pre>
https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50810#post-id-50810is there any way to alter this behavior?Fri, 17 Apr 2020 13:35:34 +0200https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50810#post-id-50810Comment by Sébastien for <p>Maybe because the square root function is defined for negative numbers and the square root of small negative numbers converges to zero as well (on the Complex plane):</p>
<pre><code>sage: sqrt(-.00000001)
0.000100000000000000*I
</code></pre>
https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50817#post-id-50817I don't know. Sympy behaves the same:
sage: from sympy import limit, sqrt
sage: from sympy.abc import x
sage: limit(sqrt(x-3), x, 3)
0
sage: limit(sqrt(x-3), x, 3, dir="+")
0
sage: limit(sqrt(x-3), x, 3, dir="-")
0Fri, 17 Apr 2020 20:40:09 +0200https://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/?comment=50817#post-id-50817