Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ private static bool IsAnIndeterminateQuotient(Entity dividend, Entity divisor)
// definite integral's bounds left the bounds none, and the integral unevaluated.
if (Functions.Algebra.LimitFunctional.UnderALimitBudget)
return null;
// Nor of the whole question, which the path that began the descent asks the rest of the
// machinery of once the descent has nothing to say. Asked here as well, it descended
// again and simplified the same expression twice: (1 - tanh(x)^2) * x * (1 + x^2) / tanh(x)
// at 0 from the right spent nine seconds on each before l'Hopital's rule answered 1.
if (Functions.Algebra.LimitFunctional.IsTheWholeQuestion(quotient))
return null;
quotientsAskedWhole ??= new();
if (quotientsAskedWhole.Count > 0 || !quotientsAskedWhole.Add(quotient))
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ bool PositiveOnBothSides(Entity node)
internal static bool MayReadAPowerThroughItsExponent(Entity power)
=> !comparingSides && !ReferenceEquals(power, descentRoot);

/// <summary>
/// Whether <paramref name="expr"/> is the whole of the question whose descent is under
/// way. The path that began the descent asks the rest of the machinery of it once the
/// descent has nothing to say, so the descent does not ask its whole limit as well.
/// </summary>
internal static bool IsTheWholeQuestion(Entity expr) => ReferenceEquals(expr, descentRoot);

/// <summary>
/// A logarithm to a base other than e as a quotient of natural logarithms.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public sealed class AContinuousFactorIsNotDifferentiatedTest
[InlineData("sin(x)^tanh(x)")]
[InlineData("tan(x)^sin(tanh(x))")]
[InlineData("tan(2*x)^sin(tanh(x))")]
// The 1 - tanh(x)^2 the derivative of tanh brings, taken out at 0. The descent of the quotient
// asked its whole limit again from inside, which simplified the quotient moved out to infinity
// a second time before l'Hopital's rule answered.
[InlineData("(1 - tanh(x)^2) * x / tanh(x)")]
public void IsOneFromTheRight(string input)
=> Assert.Equal(MathS.FromString("1"), MathS.FromString(input).Limit("x", 0, ApproachFrom.Right));

Expand Down
Loading