Skip to content

A power of the secant beside a power of a + i a tan is integrated in the sum, whatever the powers - #1812

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-power-of-the-secant-beside-a-power-of-an-imaginary-tangent-sum-is-integrated-in-the-sum
Oct 6, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-power-of-the-secant-beside-a-power-of-an-imaginary-tangent-sum-is-integrated-in-the-sum

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Part of #718.

sec(c + d x)^3 sqrt(a + i a tan(c + d x)) was declined, with most of Rubi's 4.3.1.2: a power of the secant or the cosine beside a power of a + i a tan, the powers adding up to no whole number, which #1796's rule, integrating in e^(i z), does not take.

integrand 2.5.0 master db33ae1b this
sec(x)^3 sqrt(a + i a tan(x)) declined declined 495 characters
sec(x)^5/(a + i a tan(x))^(3/2) declined declined 399 characters
(k cos(x))^(3/2) sqrt(a + i a tan(x)) declined declined 763 characters
(m sec(x))^(2/3) (a + i a tan(x))^(5/3) declined declined 501 characters
cos(x)^9 (a + i a tan(x))^(7/2) declined an answer provided 1 + i tan(x) >= 0 1,067 characters, unconditional

Each is differentiated back and compared with the integrand as a complex number at real points with the symbols pinned. Of the 56 rows of 4.3.1.2 this answers that master does not, the longest answer is 1,511 characters and the median 779.

What changes. Under u = A + i A tan(z), du = i A sec(z)^2 dz and sec(z)^2 = (u/A) ((2 A - u)/A), the product of the principal powers of 1 + i tan(z) and 1 - i tan(z) being (sec(z)^2)^r exactly, since their arguments are opposite and less than a right angle. So sec(z)^s u^n dz is u^n (u/A)^r ((2 A - u)/A)^r du/(i A) with r = (s - 2)/2, up to a factor constant wherever it is continuous: a power of u beside a power of 2 A - u, which the integrator reads. SolveAPowerOfTheSecantBesideAPowerOfAnImaginaryTangentSumInTheSum asks that, and answers with the integrand times the antiderivative in u over what that antiderivative differentiates back to, as #1796's rule does, so the constant is never written. Two things it does not leave to chance:

  • The antiderivative in u is found for a real u, and its conditions say so: a radicand at least zero. On the path u is not real, the conditions hold nowhere, and the first version of this answered nothing on 58 of the rows. They are dropped, each piecewise is taken arm by arm, and an answer is kept only where its derivative is the integrand at the sampled points. cos(x)^9 (a + i a tan(x))^(7/2)'s answer on master carries exactly such a condition, 1 + i tan(x) >= 0, which no real x but the tangent's zeros meets; checked at 50, 300 and 2,000 digits, its derivative has no value at a real point.
  • Whole powers on both are declined: a rational function of the sine and the cosine, which the rules for those answer in a fraction of a second where in u they ran past five, and five of the pocket's rows were lost that way before the rule was told so.

Tests: SecantBesideAnImaginaryTangentSumIntegralTest, the five rows above, each differentiated back and compared as a complex number at six real points, with its answer under 5,000 characters.

Measured first on every corpus problem with i in its integrand, 2,253 of them, at the corpus's 5-second budget, against master db33ae1b:

master this
solved 1928 1978
unevaluated 119 72
unverifiable on the reals 63 59
wrong 1 1
past the budget 136 137

The one counted wrong on both is the known 6.1.5 1/(a + i a sinh(c + d x))^(1/2), the harness's own. Fifty problems are answered here and not on master, all of 4.3.1.2, and none the other way; on the 1,928 both answer the time goes from 1,878 seconds to 1,791.

Measured then on the Rubi corpus against master db33ae1b:

master this
family 0, independent suites (1814) 1782 1782
family 1, 40 a file (1381) 1341 1341
families 2 to 8, sampled (2410) 2328 2328

The harness counts no answer wrong in either.

The 55 problems the two builds disagreed on, pocket and sample together, run again one build at a time: master answers none of them, and this answers 50. Four of the other five, cos(c + d x)^4/(a + i a tan(c + d x))^(3/2) and three like it, are unverifiable to the harness on master and past its budget here: the harness simplifies an answer it cannot check on the reals within the same five seconds, and an integrand that is nowhere real is never checkable there. Probed alone, both builds' answers to the four differentiate back to the integrand, this one's in 0.3 to 1.2 seconds against master's 1.3 to 19.

The suite passes on the head here, 664ac579, which is master db33ae1b and this change: 15,130 tests, every one reported, the test host peaking at 4.9 GB against master's 5.1. Two earlier runs of it were stopped by the machine's memory guard at 8 GB; the peak varies by gigabytes between runs of one tree -- the half of the suite outside the calculus tests peaked at 5.4 GB and then 3.2 GB here, and at 3.2 GB and then 3.8 GB on master -- and run whole again it stayed below master's. The allocation gate passes: every gated benchmark allocates what the baseline says. The library builds for every target.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…the sum, whatever the powers

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 6, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit b3ac1e8 into master Oct 6, 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