Skip to content

Commit 0f2f41d

Browse files
Ask the descent's own question once (#2383)
The descent of a quotient asks the quotient's whole limit when its parts read as 0/0 or oo/oo. At the root of the descent that is the question being asked: the path that began the descent asks the indeterminate power, l'Hopital's rule and, at an infinity, the rewrites and Gruntz, the moment the descent has nothing to say. Asked from inside the descent as well, it descended again and repeated every step of it, including simplifying the expression moved out to infinity. (1 - tanh(x)^2) * x * (1 + x^2) / tanh(x) at 0 from the right simplified it twice, nine seconds each, before l'Hopital's rule answered 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2e2bf9d commit 0f2f41d

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ private static bool IsAnIndeterminateQuotient(Entity dividend, Entity divisor)
218218
// definite integral's bounds left the bounds none, and the integral unevaluated.
219219
if (Functions.Algebra.LimitFunctional.UnderALimitBudget)
220220
return null;
221+
// Nor of the whole question, which the path that began the descent asks the rest of the
222+
// machinery of once the descent has nothing to say. Asked here as well, it descended
223+
// again and simplified the same expression twice: (1 - tanh(x)^2) * x * (1 + x^2) / tanh(x)
224+
// at 0 from the right spent nine seconds on each before l'Hopital's rule answered 1.
225+
if (Functions.Algebra.LimitFunctional.IsTheWholeQuestion(quotient))
226+
return null;
221227
quotientsAskedWhole ??= new();
222228
if (quotientsAskedWhole.Count > 0 || !quotientsAskedWhole.Add(quotient))
223229
return null;

‎Sources/AngouriMath/Functions/Continuous/Limits/Solvers/Solvers.Definition.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ bool PositiveOnBothSides(Entity node)
298298
internal static bool MayReadAPowerThroughItsExponent(Entity power)
299299
=> !comparingSides && !ReferenceEquals(power, descentRoot);
300300

301+
/// <summary>
302+
/// Whether <paramref name="expr"/> is the whole of the question whose descent is under
303+
/// way. The path that began the descent asks the rest of the machinery of it once the
304+
/// descent has nothing to say, so the descent does not ask its whole limit as well.
305+
/// </summary>
306+
internal static bool IsTheWholeQuestion(Entity expr) => ReferenceEquals(expr, descentRoot);
307+
301308
/// <summary>
302309
/// A logarithm to a base other than e as a quotient of natural logarithms.
303310
/// </summary>

‎Sources/Tests/UnitTests/Calculus/AContinuousFactorIsNotDifferentiatedTest.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public sealed class AContinuousFactorIsNotDifferentiatedTest
2626
[InlineData("sin(x)^tanh(x)")]
2727
[InlineData("tan(x)^sin(tanh(x))")]
2828
[InlineData("tan(2*x)^sin(tanh(x))")]
29+
// The 1 - tanh(x)^2 the derivative of tanh brings, taken out at 0. The descent of the quotient
30+
// asked its whole limit again from inside, which simplified the quotient moved out to infinity
31+
// a second time before l'Hopital's rule answered.
32+
[InlineData("(1 - tanh(x)^2) * x / tanh(x)")]
2933
public void IsOneFromTheRight(string input)
3034
=> Assert.Equal(MathS.FromString("1"), MathS.FromString(input).Limit("x", 0, ApproachFrom.Right));
3135

0 commit comments

Comments
 (0)