Skip to content

A rational function of the tangent beside a power of a + i a tan is integrated in that sum - #1779

Merged
Rafael-SOWNet merged 4 commits into
masterfrom
a-rational-function-of-the-tangent-beside-a-power-of-a-plus-i-a-tan
Oct 5, 2026
Merged

Rafael-SOWNet merged 4 commits into
masterfrom
a-rational-function-of-the-tangent-beside-a-power-of-a-plus-i-a-tan

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

(A + B tan(c + d x))/sqrt(a + i a tan(c + d x)) ran past the budget, with the rest of Rubi's 4.3.3.1 that put a whole power of the tangent or cotangent and A + B tan over a power of a + i a tan, whole or half-odd. 2.5.0 declined them, and the unreleased master runs past half a minute on them:

integrand 2.5.0 master 092b2815 this
(k + q tan(c + d x))/sqrt(a + i a tan(c + d x)) declined past 30 s in 2.2 s; 3,607 characters
tan(c + d x)^2 (k + q tan(c + d x))/sqrt(a + i a tan(c + d x)) declined past 30 s in 1.6 s; 1,543 characters
cot(c + d x)^2 (k + q tan(c + d x))/(a + i a tan(c + d x))^4 declined, in 13 s past 30 s in 0.5 s; 1,190 characters
(a + i a tan(c + d x))/(q - i q tan(c + d x))^(3/2) declined past 30 s in 0.08 s; 92 characters
(a + i a tan(c + d x))^2/sqrt(q - i q tan(c + d x)) declined past 30 s in 0.1 s; 150 characters

Each answer is compared with the integrand as complex numbers, differentiated back at six points; the times include that.

What changes. With S = a + c tan(z) and c = ±i a, tan(z) is (S - a)/c and, since c^2 = -a^2, dS/dz = c sec(z)^2 = S (S - 2a)/c, so dz = c dS/(S (S - 2a)). A rational function of the tangent and cotangent of z beside a power of S that stands below the bar or is not whole is a rational function of S beside a power of it, over the factors S, S - 2a and, from a cotangent, S - a -- none with an imaginary root -- and it is asked in S. Under u = tan(z) the same integrand is a rational function over 1 + i u and 1 - i u with symbols in every coefficient, which is where the search spent the budget. Exact: the substitution is sec(z)^2 = 1 + tan(z)^2 read in S, and the power of S is the integrand's own. Only whole powers of the tangent and cotangent beside it: a root of (S - a)/c, taken apart over the imaginary constant, changes its branch. Beside a second such sum of the same argument, q - i q tan(z) -- Rubi's 4.3.2.1 has them in pairs -- each sum is linear in the other, and the one under a power that is not whole is the variable, so that the other is a whole power of a linear in it rather than the root of one; where both or neither are, the rule declines.

Tests: RationalInTheTangentBesideAnImaginarySumIntegralTest, seven rows compared as complex numbers; master answers none of them within the budget.

Measured first on the 1,480 problems of family 4 with a ± i a tan or a ± i a cot in them, 1,480 run, at the corpus's 5-second budget, against master 287c69a7, the branch's base:

master this
solved 1023 1096
wrong 0 0
past the budget 291 223

Measured then on the Rubi corpus against master 287c69a7:

master this
family 0, independent suites (1814) 1772 1772
family 1, 40 a file (1381) 1308 1307
families 2 to 8, sampled (2410) 2301 2299

The harness counts no answer wrong in either. The 96 problems the two builds disagreed on, pocket and sample together, run again one build at a time: master answers 8 and this 82. One of master's this does not answer within the budget: 4.3.2.1:349, tan(z)^4/(a + i a tan(z))^(4/3), which master answers in 1.3 s and this takes 44 s for, the cube root of S making a rational function of high degree in its variable; ten of this branch's gains are thirds and two-thirds, so the rule keeps them. Eight more that master answers quickly in a form the harness cannot check on the reals came back past the budget here in the chain, and alone they are answered in 0.1 to 2 s, each differentiating back to the integrand compared as complex numbers -- the time was the harness's, simplifying an answer it could not check. Where master also answers, the answers here are shorter on six of those eight and longer on two, one by much: tan(z)^3/(a + i a tan(z))^(5/2), 6,423 characters where master's exponential form is 374. The figures above were measured with three other corpus runs on the machine.

After the chain, the second sum of a conjugate pair is written as the linear in the variable it is, (c'/c)(S - r) with its root spelled 2a where it is that, so that it cancels the S - 2a of dz: (a + i a tan(z))^2/sqrt(q - i q tan(z)) was fourteen thousand characters and is a hundred and fifty. On the 338 problems of family 4 with two such sums, run with the measured head and with this, 256 and 259 are answered, none lost.

The suite on the commit measured, 04521cd0, passed, 12,874 tests, and the allocation gate passed. The head here, 65f27163, adds the conjugate-pair commit bfb36559 and merges master 092b2815; the calculus and corpus tests pass on it and the library builds for netstandard2.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 4 commits October 4, 2026 19:12
…ntegrated in that sum

With S = a + c tan(z) and c = +-i a, tan(z) is (S - a)/c and, since
c^2 = -a^2, dS/dz = c sec(z)^2 = S (S - 2a)/c. A rational function of
the tangent and cotangent of z beside a power of S, below the bar or not
whole, is a rational function of S beside a power of it, over the
factors S, S - 2a and S - a, with no imaginary root among them. Rubi's
4.3.3.1 rows with a power of the tangent beside A + B tan over a power
of a + i a tan ran past the budget under u = tan(z), where the factors
are 1 + i u and 1 - i u with symbols in every coefficient. Whole powers
of the tangent only: a root of (S - a)/c, taken apart over the imaginary
constant, changed its branch.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…e is the variable

a + i a tan(z) and q - i q tan(z) are each linear in the other: in the one under
a power that is not whole the other is a whole power of a linear, where in the
other it would be the root of one. (a + i a tan(z))/(q - i q tan(z))^(3/2) and
the rest of Rubi's 4.3.2.1 with the two sums ran past the budget.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…e variable it is

Beside a second imaginary sum q + c' tan(z), written as q + c' (S - a)/c in
the variable S = a + c tan(z), nothing cancelled the S - 2a of dz against the
same factor in the other sum, and the pole left over made the answers
piecewise and long: (a + i a tan(z))^2/sqrt(q - i q tan(z)) was fourteen
thousand characters. The other sum is written as (c'/c)(S - r) for
r = a - q c/c', its root spelled 2a where it is that, and the answer is a
hundred and fifty.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…-of-the-tangent-beside-a-power-of-a-plus-i-a-tan
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 5, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit b945b21 into master Oct 5, 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