From 7bf54b253825200d7822a8b05c1bc29d420b5ec2 Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Sun, 8 Nov 2026 08:58:33 +0000 Subject: [PATCH 1/2] Ask a vanishing factor times an infinity as a whole once, read as a part In the descent, a product whose factors tend to 0 and to an infinity, with neither a quotient nor a sum for a factor, came back as 0 * oo, a form with no value. x^pi ln(x) at 0 from the right is 0, and its own limit says so, but read as a part of x^pi ln(x) / 2 or sin(x^pi ln(x)) it was that form, and the whole was left unevaluated. Its whole limit is now asked once, as a quotient's already is, under the same gates as the regroup and the distribution: one side only, and not while the sides are being compared. Only a value is taken. x^pi / log(x, -1) - 2 at 0 from the right is -2, where it was left unevaluated after 14 s. Co-Authored-By: Claude Opus 5.5 --- .../Limits/Solvers/Limit.Classes.cs | 15 +++++++- .../AVanishingPowerTimesALogarithmTest.cs | 35 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Sources/Tests/UnitTests/Calculus/AVanishingPowerTimesALogarithmTest.cs diff --git a/Sources/AngouriMath/Functions/Continuous/Limits/Solvers/Limit.Classes.cs b/Sources/AngouriMath/Functions/Continuous/Limits/Solvers/Limit.Classes.cs index 3e928830a..f1381d6bb 100644 --- a/Sources/AngouriMath/Functions/Continuous/Limits/Solvers/Limit.Classes.cs +++ b/Sources/AngouriMath/Functions/Continuous/Limits/Solvers/Limit.Classes.cs @@ -127,7 +127,20 @@ partial record Mulf ({ } bas, { IsFinite: true } lim2) => (bas, lim2), _ => (Multiplier, Multiplicand) }; - return ComputeLimitImpl(New(mp, md), x, dist, side); + var substituted = ComputeLimitImpl(New(mp, md), x, dist, side); + // Any other 0 * oo, read off the parts, is a form with no value, which says there is + // no limit where the descent only cannot tell. Its whole limit is asked once, as a + // quotient's is: x^pi ln(x) at 0 from the right is 0, and the whole limit says so, + // but the descent handed on 0 * (-oo), and x^pi ln(x) / 2 and sin(x^pi ln(x)) were + // left unevaluated. Under the gates above, and only a value is taken. + if ((substituted is null || substituted.Evaled == MathS.NaN) + && side is not ApproachFrom.BothSides && !IsComparingSides + && multiplierLimit is { } zeroOrInfinity5 && multiplicandLimit is { } zeroOrInfinity6 + && IsZeroTimesAnInfinity(zeroOrInfinity5, zeroOrInfinity6) + && AsTheWholeLimit(this, x, dist, side) is { } asked && asked.Evaled is Number { IsNaN: false } value) + return asked.InnerSimplified is var folded && folded.Nodes.Any(static node => node is Number { IsFinite: false }) + ? value : folded; + return substituted; } } } diff --git a/Sources/Tests/UnitTests/Calculus/AVanishingPowerTimesALogarithmTest.cs b/Sources/Tests/UnitTests/Calculus/AVanishingPowerTimesALogarithmTest.cs new file mode 100644 index 000000000..0f6bf1a0c --- /dev/null +++ b/Sources/Tests/UnitTests/Calculus/AVanishingPowerTimesALogarithmTest.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) 2019-2026 Angouri. +// AngouriMath is licensed under MIT. +// Details: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md. +// Website: https://am.angouri.org. +// + +using System; +using System.Threading.Tasks; +using AngouriMath.Core; +using Xunit; + +namespace AngouriMath.Tests.Calculus +{ + /// + /// A product tending to 0 times an infinity, read inside something else, is asked as a whole once. + /// x^pi ln(x) at 0 from the right is 0, and its own limit says so, but read as a part of a + /// quotient or a sine it came back as 0 * (-oo), a form with no value, and the whole was left + /// unevaluated. Found by limitcheck; no issue was filed. + /// + [Trait("Area", "Calculus")] + public sealed class AVanishingPowerTimesALogarithmTest + { + [Theory] + [InlineData("x^pi * ln(x) / 2", "0")] + [InlineData("sin(x^pi * ln(x))", "0")] + [InlineData("sin(x^(3/2) * ln(x))", "0")] + public void IsAnsweredFromTheRight(string input, string expected) + { + var limit = Task.Run(() => MathS.FromString(input).Limit("x", 0, ApproachFrom.Right)); + Assert.True(limit.Wait(TimeSpan.FromSeconds(30)), $"{input} did not finish"); + Assert.Equal(MathS.FromString(expected), limit.Result); + } + } +} From 83938723a367d56e55674d1f48ea5836ad549537 Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Sun, 8 Nov 2026 10:25:06 +0000 Subject: [PATCH 2/2] Record the whole-product answers Co-Authored-By: Claude Opus 5.5 --- BREAKING-CHANGES.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BREAKING-CHANGES.md b/BREAKING-CHANGES.md index dc76cfa18..486f2ab03 100644 --- a/BREAKING-CHANGES.md +++ b/BREAKING-CHANGES.md @@ -147,6 +147,20 @@ one inside another was answered with the empty set, a claim that it has no solut | `"1/(2 + p^(-3)) = 1/3".Solve("p")` | `{ }` | `{ 1, -1/2 + i * 1/2 * sqrt(3), -1/2 + i * -1/2 * sqrt(3) }` | | `"1/(1 + x^(-2)) = y".Solve("x")` | `{ }` | `{ ((-1) / (-y) - 1) ^ (-1/2), -((-1) / (-y) - 1) ^ (-1/2) }` | +### A vanishing factor times an infinity is asked as a whole when read as a part + +**Silent: a limit with, somewhere inside it, a product of a factor tending to 0 and one tending to an infinity is +answered where that product's own limit is.** Read as a part, the product came back as `0 * oo`, a form with no value, +and the whole was left unevaluated; `x^pi ln(x)` at 0 from the right is 0, but `x^pi ln(x) / 2` was not answered. One +side only, as for a quotient's divisor and a sum's terms. Found by limitcheck; no issue was filed. + +| Input | Was (2.6.0) | Now | +|---|---|---| +| `"x^pi * ln(x) / 2".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(x ^ pi * ln(x) / 2, x, 0)` | `0` | +| `"sin(x^(3/2) * ln(x))".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(sin(x ^ (3/2) * ln(x)), x, 0)` | `0` | +| `"x^pi / log(x, -1) - 2".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(x ^ pi / log(x, -1) - 2, x, 0)` | `-2` | +| `"sin(ln(x) * x)".ToEntity().Limit("x", 0, ApproachFrom.Left)` | `limitleft(sin(ln(x) * x), x, 0)` | `0` | + ### Two fractions over a shared factor are added over their least common denominator **Silent: where the denominators of two fractions share a factor, `Simplify` adds them over the least common