Skip to content

arctan and arccot are undefined at their poles - #2304

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
arctan-and-arccot-are-undefined-at-their-poles
Oct 31, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
arctan-and-arccot-are-undefined-at-their-poles

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

arctan and arccot have poles at i and -i, where they evaluate to an infinity, as ln(0) does. Their condition is now not 1 + x^2 = 0, as the tangent's excludes its poles.

master and 2.6.0 now
arctan(x) - arctan(x) simplified 0, which has a value at i 0 provided not 1 + x ^ 2 = 0
arccot(x) - arccot(x) simplified 0 0 provided not 1 + x ^ 2 = 0
arctan(x).DomainCondition True not 1 + x ^ 2 = 0
  • This was held because ten integration tests gained a redundant provided. Nine of them came from one place. The linear-over-quadratic integral wrote 0 * arctan(2x/2) when the numerator was a multiple of the derivative, and that zero kept the poles: x/(x^2 + 1) was answered with provided not 1 + (2x/2)^2 = 0. It now leaves the part out, as the higher powers of the quadratic already did.
  • The tenth keeps two arctangents and lists their poles among the points it has no value at. They say nothing new, but Simplify spells the condition and the argument differently, so the redundant-condition step can't see that. Its raw answer went from 1,128 characters to 1,382, against a bound of 1,300 that was meant to catch a 3,577-character split, so the bound is now 1,400.
  • 6 of ArctangentPolesTest's 11 cases fail on master. The suite, the trio, F#, AOT and the eight harnesses pass.

Fixes #2256, whose other four items landed in #2260, #2261, #2262 and #2263.

🤖 Generated with Claude Code

arctan(z) is (i/2)(ln(1 - iz) - ln(1 + iz)), with poles where
1 + z^2 = 0, at i and -i, where it evaluates to an infinity as ln(0)
does. arccot(z) is arctan(1/z) and has the same two. Both conditions
said True, so arctan(x) - arctan(x) simplified to 0, which has a value
at i. They are now not 1 + x^2 = 0, as the tangent's excludes its own
poles.

The linear-over-quadratic integral wrote its arctangent part even when
the numerator was a multiple of the denominator's derivative and left
no constant for it, 0 * arctan(2x/2). With the poles in arctan's
condition that zero kept them, and x/(x^2 + 1) was answered with
provided not 1 + (2x/2)^2 = 0 beside a logarithm that has no value
there either: ten tests, through the substitution u = tan(c + dx) as
well. It now leaves the part out, as the higher powers of the
quadratic already did.

An antiderivative that keeps an arctangent can list its poles among
the points it has no value at. They say nothing new, and the
redundant-condition step cannot see that, since Simplify spells the
condition and the arctangent's argument differently.
x^2 coth(a + 2 ln(x))^2 is the one test that notices: 1,128 characters
of raw answer went to 1,382, against a bound of 1,300 meant to catch
the 3,577 of a split on a symbol's sign, so the bound is 1,400.

ArctangentPolesTest checks the condition at both poles and off them,
and that the two differences have no value at i. The suite, the trio,
F#, AOT and the eight harnesses pass.

Fixes #2256.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 31, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 31, 2026
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.77%. Comparing base (c633c41) to head (5757714).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2304      +/-   ##
==========================================
+ Coverage   86.74%   86.77%   +0.03%     
==========================================
  Files         310      310              
  Lines       67973    67974       +1     
  Branches    19744    19737       -7     
==========================================
+ Hits        58961    58985      +24     
+ Misses       4880     4868      -12     
+ Partials     4132     4121      -11     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.32% <100.00%> (+0.03%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nctions/Continuous/Integration/IntegralPatterns.cs 95.42% <100.00%> (ø)
...uous/Evaluation.Continuous.Trigonometry.Classes.cs 96.91% <100.00%> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit c920408 into master Oct 31, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 31, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the arctan-and-arccot-are-undefined-at-their-poles branch October 31, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

DomainCondition disagrees with the value for five nodes

1 participant