Skip to content

Commit 88f5f3c

Browse files
Ask a vanishing factor times an infinity as a whole once, read as a part (#2389)
Record the whole-product answers 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 <noreply@anthropic.com>
1 parent 1c543f1 commit 88f5f3c

3 files changed

Lines changed: 63 additions & 1 deletion

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ one inside another was answered with the empty set, a claim that it has no solut
147147
| `"1/(2 + p^(-3)) = 1/3".Solve("p")` | `{ }` | `{ 1, -1/2 + i * 1/2 * sqrt(3), -1/2 + i * -1/2 * sqrt(3) }` |
148148
| `"1/(1 + x^(-2)) = y".Solve("x")` | `{ }` | `{ ((-1) / (-y) - 1) ^ (-1/2), -((-1) / (-y) - 1) ^ (-1/2) }` |
149149

150+
### A vanishing factor times an infinity is asked as a whole when read as a part
151+
152+
**Silent: a limit with, somewhere inside it, a product of a factor tending to 0 and one tending to an infinity is
153+
answered where that product's own limit is.** Read as a part, the product came back as `0 * oo`, a form with no value,
154+
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
155+
side only, as for a quotient's divisor and a sum's terms. Found by limitcheck; no issue was filed.
156+
157+
| Input | Was (2.6.0) | Now |
158+
|---|---|---|
159+
| `"x^pi * ln(x) / 2".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(x ^ pi * ln(x) / 2, x, 0)` | `0` |
160+
| `"sin(x^(3/2) * ln(x))".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(sin(x ^ (3/2) * ln(x)), x, 0)` | `0` |
161+
| `"x^pi / log(x, -1) - 2".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(x ^ pi / log(x, -1) - 2, x, 0)` | `-2` |
162+
| `"sin(ln(x) * x)".ToEntity().Limit("x", 0, ApproachFrom.Left)` | `limitleft(sin(ln(x) * x), x, 0)` | `0` |
163+
150164
### Two fractions over a shared factor are added over their least common denominator
151165

152166
**Silent: where the denominators of two fractions share a factor, `Simplify` adds them over the least common

‎Sources/AngouriMath/Functions/Continuous/Limits/Solvers/Limit.Classes.cs‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,20 @@ partial record Mulf
127127
({ } bas, { IsFinite: true } lim2) => (bas, lim2),
128128
_ => (Multiplier, Multiplicand)
129129
};
130-
return ComputeLimitImpl(New(mp, md), x, dist, side);
130+
var substituted = ComputeLimitImpl(New(mp, md), x, dist, side);
131+
// Any other 0 * oo, read off the parts, is a form with no value, which says there is
132+
// no limit where the descent only cannot tell. Its whole limit is asked once, as a
133+
// quotient's is: x^pi ln(x) at 0 from the right is 0, and the whole limit says so,
134+
// but the descent handed on 0 * (-oo), and x^pi ln(x) / 2 and sin(x^pi ln(x)) were
135+
// left unevaluated. Under the gates above, and only a value is taken.
136+
if ((substituted is null || substituted.Evaled == MathS.NaN)
137+
&& side is not ApproachFrom.BothSides && !IsComparingSides
138+
&& multiplierLimit is { } zeroOrInfinity5 && multiplicandLimit is { } zeroOrInfinity6
139+
&& IsZeroTimesAnInfinity(zeroOrInfinity5, zeroOrInfinity6)
140+
&& AsTheWholeLimit(this, x, dist, side) is { } asked && asked.Evaled is Number { IsNaN: false } value)
141+
return asked.InnerSimplified is var folded && folded.Nodes.Any(static node => node is Number { IsFinite: false })
142+
? value : folded;
143+
return substituted;
131144
}
132145
}
133146
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 System;
9+
using System.Threading.Tasks;
10+
using AngouriMath.Core;
11+
using Xunit;
12+
13+
namespace AngouriMath.Tests.Calculus
14+
{
15+
/// <summary>
16+
/// A product tending to 0 times an infinity, read inside something else, is asked as a whole once.
17+
/// <c>x^pi ln(x)</c> at 0 from the right is 0, and its own limit says so, but read as a part of a
18+
/// quotient or a sine it came back as <c>0 * (-oo)</c>, a form with no value, and the whole was left
19+
/// unevaluated. Found by limitcheck; no issue was filed.
20+
/// </summary>
21+
[Trait("Area", "Calculus")]
22+
public sealed class AVanishingPowerTimesALogarithmTest
23+
{
24+
[Theory]
25+
[InlineData("x^pi * ln(x) / 2", "0")]
26+
[InlineData("sin(x^pi * ln(x))", "0")]
27+
[InlineData("sin(x^(3/2) * ln(x))", "0")]
28+
public void IsAnsweredFromTheRight(string input, string expected)
29+
{
30+
var limit = Task.Run(() => MathS.FromString(input).Limit("x", 0, ApproachFrom.Right));
31+
Assert.True(limit.Wait(TimeSpan.FromSeconds(30)), $"{input} did not finish");
32+
Assert.Equal(MathS.FromString(expected), limit.Result);
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)