Skip to content

Commit 17cd9da

Browse files
An infinity over a vanishing divisor is the infinity of the signs (#2295)
limit(ln(x^2) / (cos(x) - 1), x, 0) was NaN, the claim that there is no limit, where it is +oo from both sides. Each side's descent put the parts' limits in place of the parts and read (-oo) / 0, which says nothing about the side the divisor vanishes from and is NaN, and DivergesAtAVanishingDivisor, which reads that side, asked for a finite dividend. An infinity with a sign over a divisor vanishing from one side is no more indeterminate than a number is: it is the infinity of the two signs' product. The rule now takes one. AnInfinityOverAVanishingDivisorTest takes four two-sided limits that were NaN, four one-sided and two-sided ones that were answered and are unchanged, and three that have no limit and stay NaN, x^x at 0 among them; the four fail on master. The suite, the trio, F#, AOT and the eight harnesses pass. #2275's entry for ln(x^2) / ln(cos(x)) now reads +oo. The issue put the cause at WhereBothSidesAgree's real-codomain gate. Opening the gate changed nothing: each side was still (-oo) / 0. Fixes #2274. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 2c9dceb commit 17cd9da

4 files changed

Lines changed: 66 additions & 4 deletions

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ and some are left unevaluated ([#2267](https://github.com/asc-community/AngouriM
8585
|---|---|---|
8686
| `"limitright(ln(x) / ln(cos(x)), x, 0)".ToEntity().Simplify()` | `-oo` | `+oo` |
8787
| `"limitright(ln(sin(x)) / ln(cos(x)), x, 0)".ToEntity().Simplify()` | `-oo` | `+oo` |
88-
| `"limit(ln(x^2) / ln(cos(x)), x, 0)".ToEntity().Simplify()` | `-oo` | `NaN`, which is wrong too: both sides are `+oo` ([#2274](https://github.com/asc-community/AngouriMath/issues/2274)) |
88+
| `"limit(ln(x^2) / ln(cos(x)), x, 0)".ToEntity().Simplify()` | `-oo` | `+oo`, by [#2274](https://github.com/asc-community/AngouriMath/issues/2274) |
8989

9090
### A value put in for a derivative's variable is where it is evaluated
9191

@@ -544,6 +544,20 @@ the expression's own domain as its condition ([#2142](https://github.com/asc-com
544544
| `"(1 - cos(a))/(1 + cos(a))/tan(a/2)^2".Simplify()` | `(1 - cos(a)) / ((cos(a) + 1) * tan(a / 2) ^ 2)` | `1 provided not cos(a) + 1 = 0 and not tan(a / 2) = 0 and not cos(a / 2) = 0` |
545545
| `"(cos(2*x) - 1)^2 + sin(2*x)^2 - 4*sin(x)^2".Simplify()` ([#2133](https://github.com/asc-community/AngouriMath/issues/2133)) | `2 + (-2) * cos(2 * x) + (-4) * sin(x) ^ 2` | `0` |
546546

547+
### An infinity over a vanishing divisor is the infinity of the signs
548+
549+
**Silent: a limit of a quotient whose dividend tends to an infinity and whose divisor vanishes from one side is that
550+
infinity times the divisor's sign, where a two-sided one was `NaN`.** The quotient of the parts' limits, `(-oo) / 0`, says
551+
nothing about the side the divisor vanishes from, and the rule that reads the side asked for a finite dividend. So each
552+
side of `ln(x^2) / (cos(x) - 1)` at 0 came back undecided, and the two-sided limit, `+oo` from both, was `NaN`
553+
([#2274](https://github.com/asc-community/AngouriMath/issues/2274)).
554+
555+
| Input | Was (2.6.0) | Now |
556+
|---|---|---|
557+
| `"limit(ln(x^2) / (cos(x) - 1), x, 0)".ToEntity().Simplify()` | `NaN` | `+oo` |
558+
| `"limit(ln(x^2) / ln(1 - x^2/2), x, 0)".ToEntity().Simplify()` | `NaN` | `+oo` |
559+
| `"limit(ln(abs(x)) / ln(cos(x)), x, 0)".ToEntity().Simplify()` | `NaN` | `+oo` |
560+
547561
### The double factorial is the postfix `n!!`
548562

549563
**Not silent: `n!!` is now the double factorial, where it was a parse error.** It is the product of the positive integers

‎Sources/.editorconfig‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed
185185
[Tests/UnitTests/Calculus/BoundNameTest.cs]
186186
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
187187

188+
[Tests/UnitTests/Calculus/AnInfinityOverAVanishingDivisorTest.cs]
189+
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
190+
188191
[Tests/UnitTests/Core/BinderShadowingTest.cs]
189192
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
190193

‎Sources/AngouriMath/Functions/Continuous/Limits/Transformations.cs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,9 +1056,11 @@ internal static bool IsDeterminate(Entity combined, Variable x)
10561056
if (EvalAssumingContinuous(divisor.Limit(x, dest, side)) is not Real { IsZero: true })
10571057
return null;
10581058
// A dividend that vanishes too makes the quotient indeterminate rather than
1059-
// divergent, and one that diverges is a different question again. Only a dividend
1060-
// with a definite non-zero size leaves the divisor to decide the answer.
1061-
if (EvalAssumingContinuous(dividend.Limit(x, dest, side)) is not Real { IsFinite: true, IsZero: false } dividendLimit)
1059+
// divergent. One with a definite sign that does not vanish, a finite one or an
1060+
// infinity, leaves the divisor to decide the answer: -oo over a divisor vanishing from
1061+
// below is +oo, and ln(x^2) / (cos(x) - 1) at 0 was left as (-oo) / 0, which is NaN.
1062+
// https://github.com/asc-community/AngouriMath/issues/2274
1063+
if (EvalAssumingContinuous(dividend.Limit(x, dest, side)) is not Real { IsZero: false, IsNaN: false } dividendLimit)
10621064
return null;
10631065
if (SignFromVanishingOrder(divisor, x, dest, side) is not { } divisorSign)
10641066
return null;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// Copyright (c) 2019-2026 Angouri.
3+
// AngouriMath is licensed under MIT.
4+
// Details: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.
5+
// Website: https://am.angouri.org.
6+
//
7+
8+
using AngouriMath.Extensions;
9+
using Xunit;
10+
11+
namespace AngouriMath.Tests.Calculus
12+
{
13+
/// <summary>
14+
/// A quotient whose dividend tends to an infinity and whose divisor vanishes from one side tends to the infinity of
15+
/// the two signs' product. The quotient of the parts' limits, (-oo) / 0, says nothing about the divisor's side and is
16+
/// NaN, and the rule that reads the side asked for a finite dividend: ln(x^2) / (cos(x) - 1) at 0, +oo from both
17+
/// sides, was NaN, the claim that it has no limit.
18+
/// <a href="https://github.com/asc-community/AngouriMath/issues/2274">#2274</a>
19+
/// </summary>
20+
[Trait("Area", "Calculus")]
21+
public sealed class AnInfinityOverAVanishingDivisorTest
22+
{
23+
[Theory]
24+
[InlineData("limit(ln(x^2) / ln(1 - x^2/2), x, 0)", "+oo")]
25+
[InlineData("limit(ln(x^2) / (cos(x) - 1), x, 0)", "+oo")]
26+
[InlineData("limit(ln(abs(x)) / ln(cos(x)), x, 0)", "+oo")]
27+
[InlineData("limit(ln(x^2) / ln(cos(x)), x, 0)", "+oo")]
28+
[InlineData("limitright(ln(x) / sin(x), x, 0)", "-oo")]
29+
[InlineData("limitleft(ln(-x) / sin(x), x, 0)", "+oo")]
30+
[InlineData("limitright((1/x) / sin(x), x, 0)", "+oo")]
31+
[InlineData("limit(1/x^2, x, 0)", "+oo")]
32+
public void ItIsTheInfinityOfTheSigns(string limit, string value)
33+
=> Assert.Equal(value.ToEntity(), limit.ToEntity().Simplify());
34+
35+
/// <summary>Where the sides disagree, or one has no real value, there is still no limit.</summary>
36+
[Theory]
37+
[InlineData("limit(1/x, x, 0)")]
38+
[InlineData("limit(x^x, x, 0)")]
39+
[InlineData("limit(ln(x) / x, x, 0)")]
40+
public void WhereTheSidesDoNotAgreeThereIsNone(string limit)
41+
=> Assert.Equal(MathS.NaN, limit.ToEntity().Simplify());
42+
}
43+
}

0 commit comments

Comments
 (0)