Skip to content

a + i a tan below the bar is integrated beside a root of the tangent, and beside q - i q tan above it - #1778

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
a-root-of-the-tangent-is-not-written-in-exponentials
Oct 5, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
a-root-of-the-tangent-is-not-written-in-exponentials

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

sqrt(tan(c + d x)) (A + B tan(c + d x))/(a + i a tan(c + d x)) ran past the budget, with the rest of Rubi's 4.3.3.1 beside a root of the tangent or the cotangent, and so did (a + i a tan(z))^2 (A + B tan(z))/(q - i q tan(z))^4 and the other whole powers of the two conjugate sums on the two sides of the bar. 2.5.0 declined them, or ran past the budget too:

integrand 2.5.0 master 4105b3bf this
sqrt(tan(c + d x))/(a + i a tan(c + d x)) declined in 7.1 s in 0.6 s, the same answer; 1,035 characters
sqrt(tan(c + d x)) (A + B tan(c + d x))/(a + i a tan(c + d x)) declined past 30 s in 0.7 s; 2,071 characters
tan(c + d x)^(3/2) (A + B tan(c + d x))/(a + i a tan(c + d x))^2 declined past 30 s in 1.8 s; 2,247 characters
(A + B tan(c + d x))/(sqrt(cot(c + d x)) (a + i a tan(c + d x))) declined past 30 s in 0.9 s; 2,125 characters
(a + i a tan(c + d x))^2 (A + B tan(c + d x))/(q - i q tan(c + d x))^4 declined, in 12 s past 30 s in 0.06 s; 499 characters
(a + i a tan(c + d x))^3 (A + B tan(c + d x))/(q - i q tan(c + d x))^5 past 30 s past 30 s in 0.04 s; 505 characters

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

What changes. All three are in SolveByWritingAnImaginaryTangentAsAnExponential, which writes a + i a tan(z) below the bar as a e^(i z)/cos(z).

  • Beside a root of the tangent or the cotangent of that argument, or of a constant times one, it declines. The exponential's spelling of a root of the tangent is read by nothing, and that search was seven seconds to be declined, where the substitution t = tan(z) answers the integrand as written in a third of a second.
  • A sum above the bar is written as its exponential too, now that one below has called for the spelling. In sines and cosines, (a + i a tan(z))^2 above was a sum of exponentials that nothing gathered: (a + i a tan(z))^2 (A + B tan(z))/(q - i q tan(z))^4 is a^2 e^(6 i z) (A cos(z)^2 + B sin(z) cos(z))/q^4.
  • A polynomial in e^(i z) and its reciprocal with nothing else of x in it -- the exponentials below the bar taken above as their reciprocals -- is multiplied out, each term's exponentials gathered into one with Patterns.GatherPowersOfOneBase and its exponent to its slope and offset, so that a term whose exponents cancel is a constant. Each term is then e^(k i z) times a constant, which the closed rule answers. Not beside a polynomial in x, which would be multiplied out too, and its answer with it.

Tests: ImaginaryTangentSumAsAnExponentialIntegralTest, six rows compared as complex numbers; master answers one of them, in seven seconds.

Measured first on the 1,840 problems of 4.3 and 4.4 with the imaginary unit in them, 1,517 run, at the corpus's 5-second budget, against master 287c69a7, the branch's base:

master this
solved 1059 1112
wrong 0 0
past the budget 290 224

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 2300

The harness counts no answer wrong in either. The 71 problems the two builds disagreed on, pocket and sample together, run again one build at a time: master answers 4 and this 53. Of the 18 this does not answer, 13 are rows master ran past the budget on, which this declines in two to five seconds or answers in a form the harness cannot check on the reals -- six of them, complex-valued, each of which differentiates back to the integrand compared as complex numbers -- two are rows master answers at 21 and 23 seconds, at the edge of the harness's patience, 3.2.1:152 and 3.2.3:29, and three neither answers. 3.2.1:152 went the other way in another branch's run the same night. The figures above were measured with three other corpus runs on the machine.

The suite on the commit measured, d4d6c89e, passed but for IntegralAnswerCacheTest.AnIntegralWithNoAnswerStillFinishesQuickly, which allows a declined integral thirty seconds and took thirty with four corpus runs on the machine; its class passes alone in three seconds. The allocation gate passed. The head here, fbafe34d, merges master 4105b3bf; 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 2 commits October 4, 2026 20:44
… and beside q - i q tan above it

sqrt(tan(c + d x)) (A + B tan(c + d x))/(a + i a tan(c + d x)) ran past the
budget, with the rest of Rubi's 4.3.3.1 beside a root of the tangent or the
cotangent, and so did (a + i a tan(z))^2 (A + B tan(z))/(q - i q tan(z))^4.
Beside a root of the tangent the exponential spelling of the sum is read by
nothing, and the integrand is left to t = tan(z). Above the bar a sum is
written as its exponential too, and a polynomial in e^(i z) and its
reciprocal is multiplied out, each exponent gathered to its slope and offset.

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 5, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 092b281 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