You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A two-sided limit is NaN where both one-sided limits are the same infinity #2274
A two-sided limit comes back NaN where both one-sided limits exist and agree. NaN claims there is no limit. 2.6.0 and master:
Input
Answered
Left
Right
limit(ln(x^2) / ln(1 - x^2/2), x, 0)
NaN
+oo
+oo
limit(ln(x^2) / (cos(x) - 1), x, 0)
NaN
+oo
+oo
limit(ln(abs(x)) / ln(cos(x)), x, 0)
NaN
+oo
+oo
The two-sided branch of ComputeLimit (Solvers.Definition.cs) compares the bare descent from each side. When those disagree or are NaN, and l'Hopital's rule finds nothing, it asks WhereBothSidesAgree, which runs the full one-sided machinery and would answer +oo here. WhereBothSidesAgree runs only under a real codomain, so the branch returns NaN instead.
The gate is there on purpose (#719): over the complex plane a one-sided limit can come from the continuation, so x^x at 0- answers 1. That is not the case here, where each expression is real on both sides of 0. A fix needs a decision on which expressions may be asked side by side. For example, those that are real near the destination with the destination itself removed: ln(x^2) is real for every x != 0 but has no value at 0, and neither TreeAnalyzer.IsRealValued nor a reading at the destination says so today.
Found while fixing #2267, which moves limit(ln(x^2) / ln(cos(x)), x, 0) from a wrong -oo to this NaN.
A correction to the cause above: it isn't WhereBothSidesAgree's real-codomain gate. With the gate opened for expressions that are real on each side, nothing changed, because each one-sided limit came back as (-oo) / 0, which evaluates to NaN. The cause is DivergesAtAVanishingDivisor, which reads the side the divisor vanishes from but accepted only a finite dividend. #2295 extends it to an infinite one and leaves the gate alone.
Activity
A quotient of logarithms is differentiated only where both diverge (#…
Rafael-SOWNet commentedon Oct 31, 2026
A correction to the cause above: it isn't
WhereBothSidesAgree's real-codomain gate. With the gate opened for expressions that are real on each side, nothing changed, because each one-sided limit came back as(-oo) / 0, which evaluates to NaN. The cause isDivergesAtAVanishingDivisor, which reads the side the divisor vanishes from but accepted only a finite dividend. #2295 extends it to an infinite one and leaves the gate alone.An infinity over a vanishing divisor is the infinity of the signs (AS…