Skip to content

Commit a7785bc

Browse files
Leave a limit on the arctangent's cut unevaluated (#2334)
The arctangent's cut is the imaginary axis past i and -i, and its principal value there is the limit from one side only. A limit whose arctan argument arrived on the cut was read off that value without asking which side the argument came from: log(2, x) comes to i pi / ln(2) from the left half-plane as x comes up to -1, so arctan(log(2, x)) tends to -pi/2 + 0.224i there, and the answer was pi/2 + 0.224i. arctan(2i + x) at 0- was arctan(2i), pi/2 + 0.549i, where the values tend to -pi/2. Such a limit is now declined, as one on the logarithm's cut is (#2266), from the side where the principal value is right as well. limitcheck at seeds 1 and 7: the findings and counts are master's. At seed 11 the arctan row is gone, and 8 more limits are declined. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d2fc4dc commit a7785bc

3 files changed

Lines changed: 59 additions & 0 deletions

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,19 @@ mentions answers it as a parameter, as a short system does, where it was `null`
417417
| `MathS.Equations("x - 1", "x^2 - 1").Solve("x", "y")` | `null` | `[[1, t_1]]` |
418418
| `MathS.Equations("a - 1", "b * 0").Solve("a", "b")` | `null` | `[[1, t_1]]` |
419419

420+
### A limit on an arctangent's cut is not read off the principal value
421+
422+
**Silent: a limit of `arctan` whose argument arrives on the arctangent's cut, the imaginary axis past `i` and `-i`, is
423+
left unevaluated, where it was the principal value there.** That value is the limit from one side of the cut only, and
424+
which side the argument comes from was not asked. `log(2, x)` comes to `i pi / ln(2)` from the left half-plane as x comes
425+
up to -1, so `arctan(log(2, x))` tends to `-pi/2 + 0.224i` there, and the answer was `pi/2 + 0.224i`. A limit from the
426+
side where the principal value is right is declined as well, as it is for the logarithm.
427+
428+
| Input | Was (2.6.0) | Now |
429+
|---|---|---|
430+
| `"arctan(log(2, x))".ToEntity().Limit("x", -1, ApproachFrom.Right)` | `arctan(ln(-1) / ln(2))`, `pi/2 + 0.224i` | unevaluated |
431+
| `"arctan(2i + x)".ToEntity().Limit("x", 0, ApproachFrom.Left)` | `arctan(2i)`, `pi/2 + 0.549i` | unevaluated |
432+
420433
### A limit on a logarithm's cut is not read off the principal value
421434

422435
**Silent: a limit of a logarithm, or of a power to an exponent that is not whole, whose argument arrives on the negative

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,13 @@ internal static bool TakesItsValueOnACut(Entity node, Variable x, Entity dest)
889889
{
890890
Logf(var @base, var antilogarithm) => OnTheCut(@base) || OnTheCut(antilogarithm),
891891
Powf(var @base, var exponent) => exponent.Substitute(x, dest).Evaled is not Integer && OnTheCut(@base),
892+
// The arctangent's cut is the imaginary axis past i and -i, which no argument real on
893+
// the approach reaches, and its value there is the limit from one side only:
894+
// arctan(log(2, x)) at -1+ has its argument arriving at i pi / ln(2) from the left
895+
// half-plane, and tends to -pi/2 + 0.224i, where the value there is pi/2 + 0.224i.
896+
Arctanf(var argument) => argument.ContainsNode(x)
897+
&& argument.Substitute(x, dest).Evaled is Complex { RealPart.IsZero: true, ImaginaryPart: var imaginary }
898+
&& imaginary.EDecimal.Abs().CompareTo(PeterO.Numbers.EDecimal.One) > 0,
892899
_ => false
893900
};
894901
bool OnTheCut(Entity argument) => ArrivesOnTheCutOffTheRealLine(argument, argument.Substitute(x, dest), x, dest);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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.Linq;
9+
using AngouriMath;
10+
using AngouriMath.Core;
11+
using AngouriMath.Extensions;
12+
using Xunit;
13+
14+
namespace AngouriMath.Tests.Calculus
15+
{
16+
/// <summary>
17+
/// The arctangent's cut is the imaginary axis past <c>i</c> and <c>-i</c>, and its principal value there is the limit
18+
/// from one side only. <c>arctan(log(2, x))</c> at -1+ has its argument arriving at <c>i pi / ln(2)</c> from the left
19+
/// half-plane and tends to <c>-pi/2 + 0.224i</c>, and it answered the principal value, <c>pi/2 + 0.224i</c>. Such a
20+
/// limit is now left unevaluated. No issue was filed; found by work/limitcheck at seed 11.
21+
/// </summary>
22+
[Trait("Area", "Calculus")]
23+
public sealed class LimitOnAnArctangentsCutTest
24+
{
25+
[Theory]
26+
[InlineData("arctan(log(2, x))", "-1", ApproachFrom.Right)]
27+
[InlineData("arctan(2i + x)", "0", ApproachFrom.Left)]
28+
public void IsNotThePrincipalValue(string expression, string destination, ApproachFrom side)
29+
{
30+
var limit = expression.ToEntity().Limit("x", destination, side);
31+
Assert.True(limit.Nodes.Any(node => node is Entity.Limitf), $"{expression} at {destination} from {side} was {limit}");
32+
}
33+
34+
// Off the cut it is still read off.
35+
[Fact]
36+
public void OffTheCutIsTheValue()
37+
=> Assert.Equal("arctan(1 + 2i)".ToEntity().Evaled, "arctan(x + 2i)".ToEntity().Limit("x", 1).Evaled);
38+
}
39+
}

0 commit comments

Comments
 (0)