Skip to content

The arcsecant beside a root of x^2 - 1 is integrated right below -1 too - #1722

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
the-arcsecant-substitution-carries-the-sign-of-the-argument
Oct 4, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
the-arcsecant-substitution-carries-the-sign-of-the-argument

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

Under x = sec(u), the substitution that undoes the arcsecant, sqrt(x^2 - 1) is |tan(u)|, and on the arcsecant's range the tangent has the sign of x. It was written tan(u), so these were answered right for x > 1 and wrong for every x < -1, where they are as real -- the derivative of the answer was the integrand's negative there:

integrand master 51cb049a this
x arcsec(x)/sqrt(x^2 - 1) wrong for x < -1 right on both intervals
arcsec(x)/(x^2 sqrt(x^2 - 1)) wrong for x < -1 right on both intervals
arcsec(x)^2/(x sqrt(x^2 - 1)) wrong for x < -1 right on both intervals
arcsec(x + 3)^2/((x + 3) sqrt((x + 3)^2 - 1)) wrong for x < -4 right on both intervals

Checked with the library's own settings, the first three at x = -2.7, -1.9, -1.3, 1.3, 2.6 and the fourth at x = -6, -4.5, -1.5, -0.5, 0.5, 1.5: on master the derivative is the integrand's negative at every point below -1 for the first three and below -4 for the fourth, and right at the rest; here it is right at all of them.

What changes. The secant's root carries a sign, tan(u) sgn, as the cosecant's and the cotangent's already did, and a first power of the arcsecant beside it is left to parts as theirs is. The sign is written back as the argument's. The other two wrote theirs back as the sign of x, which is the argument's only for a positive slope and no constant: arcsec(x + 3) has the sign of x + 3, and at x = -1.5, where the fourth row is checked, the two differ. On 2.5.0 these were declined.

Tests: InverseSecantIntegralTest.BesideARootOnBothIntervals, nine rows -- Timofeev's, Charlwood's and the linear argument -- each differentiated back on both intervals. All nine fail on master.

Measured first with work/intbench's IB_BOTHSIDES=1, which also compares at the negatives of its sample points, on the 314 problems with an arcsecant, an arccosecant or an arccotangent in them, against master 8f3757cd, the branch's base:

master this
solved 291 301
wrong 8 0

The eight are the arcsecant beside its root, Timofeev's and Charlwood's.

Measured then on the Rubi corpus against master 8f3757cd:

master this
family 0, independent suites (1814) 1766 1766
family 1, 40 a file (1381) 1296 1296
families 2 to 8, sampled (2410) 2215 2219

No answer is wrong in the sample on either build. Of the eight problems the two builds disagreed on, run again one build at a time, three ran out of time on master and are answered here -- 5.5.1's (a + b asec(c x))/(d + e x)^2 and its cube, and one of 6.6.1's -- and one went the other way: sqrt(g sin(e + f x))/((c + d sin(e + f x)) sqrt(a + a sin(e + f x))), which has no arcsecant in it and takes 23 to 35 s on either build without a budget, at the edge of the corpus's. The other four are answered on both.

The suite passes on the commit measured, 14893b8a, 14,600 tests, and so does the allocation gate. Master 51cb049a is merged in since, without conflicts; the calculus tests pass on the merge, 3,992 of them, and the four rows above are right at every point on it.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits October 3, 2026 18:08
Under x = sec(u), sqrt(x^2 - 1) is |tan(u)|, and on the arcsecant's range the tangent has the
sign of x. It was written tan(u), so x arcsec(x)/sqrt(x^2 - 1) and its kin were answered right
for x > 1 and with the integrand's negative for a derivative at every x < -1. The root carries
the sign now, as the cosecant's and the cotangent's do, and a first power of the arcsecant beside
it is left to parts as theirs is. The sign is written back as the argument's, which is the sign
of x only for a positive slope and no constant.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 3, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 4d1f3b7 into master Oct 4, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant