Skip to content

A root the substitution search would write through i is kept, and the cube is answered too - #1552

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
a-root-of-a-negation-stays-real
Sep 29, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
a-root-of-a-negation-stays-real

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Closes #1370: sqrt(a + b sech(x)) tanh(x)^5 and sqrt(a + b sech(x)) tanh(x)^3 are both answered now, and right.

The tangent substitution writes sech(x) as sqrt(1 - u^2) for u = tanh(x). The substitution search then takes u_2 = u^2 - 1 and simplifies the rewritten integrand one level, and that writes b sqrt(-u_2) as i b sqrt(u_2). That is the other root wherever u_2 is negative, and tanh(x)^2 - 1 is negative everywhere. The fifth power was answered in i sqrt(u^2 - 1), and its derivative was off at every real point, until the tangent substitution's check turned it into a decline.

Two commits:

  • The first passes over a candidate whose integrand holds the imaginary unit where the integrand did not, and another candidate answers the fifth power.
  • The second keeps a candidate's integrand as written where the one-level simplification would bring in i, at each of the four places the search simplifies one. Traced, the cube's simplification went one step further than the fifth power's, from sqrt(-u_2) to i sqrt(u_2), so the candidate that answers it was passed over. With the root as written, the search in u_2 answers the cube through sqrt(-u_2), as it answers the fifth power. The first commit's check stays, for whichever step writes i otherwise.
Input Was (2.5.0) Now
sqrt(a+b*sech(x))*tanh(x)^5 ran past two minutes the antiderivative, in sqrt(a + b sqrt(1 - tanh(x)^2)), written in exponentials
sqrt(a+b*sech(x))*tanh(x)^3 ran past five minutes the antiderivative, the same way

ExponentialSubstitutionIntegralTest.ARootOfTheSecantBesideAnOddPowerOfTheTangentIsAnswered differentiates both back at five points with the symbols pinned.

Measured at 780f638, both commits, against master 40b7e58:

  • The whole of Rubi 4.1.12, 4.2.12, 6.5.3 and 6.5.7 (555 problems that count, 3 s each): master 455 solved, this branch 461, 0 wrong. The six that moved are all of 6.5.3's odd powers of tanh(c + d x) beside sqrt(a + b sech(c + d x)), its reciprocal and its minus three-halves power, the fifth powers and the cubes. Re-run alone, they are this branch's and no other PR's. The files' total time went from 470 s to 416 s.
  • A sample of families 1 to 7 (5 per file, 912 problems): 764 solved on both, 0 wrong, row for row.
  • The independent suites (family 0, 1814 problems, 5 s each): 1750 on both, 0 wrong, 0 timeouts.
  • The unit tests pass (net10.0, 13327 passed), every target builds, and the allocation gate passes at 780f638: allocation is what the baseline says on all 19 gated benchmarks.

🤖 Generated with Claude Code

Under a candidate `u`, the substitution search simplifies the rewritten integrand
one level, and that writes `sqrt(-u)` as `i sqrt(u)`: the other root wherever u
is negative. `sqrt(a + b sech(x)) tanh(x)^5` meets it with `u = tanh(x)^2 - 1`,
negative everywhere, and was answered through `i`, off at every real point, and
then declined by the tangent substitution's check. A candidate whose integrand
holds the imaginary unit where the integrand did not is now passed over, and the
search goes on to one under which the root stays real.

The cube, `sqrt(a + b sech(x)) tanh(x)^3`, is still declined, as on master, and is
left for a follow-up.

Measured against master 40b7e58, together with the other two fixes opened
beside it: a sample of families 1 to 7 (912 problems) 764 solved on both,
row for row, and family 0 1750/1814 on both, 0 wrong.

Part of #1370.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it through i

The cube, `sqrt(a + b sech(x)) tanh(x)^3`, was still declined. Under
`u = tanh(x)^2 - 1` the one-level simplification of its integrand in u went one
step further than the fifth power's, from `sqrt(-u)` to `i sqrt(u)`, so the
candidate was passed over, where the fifth power's kept `sqrt(-u)` and was
answered through it. Each one-level simplification of a candidate's integrand
now keeps the integrand as written where the simplified one would hold the
imaginary unit and neither the written one nor the integrand in x does. Both
powers are answered and differentiate back.

Closes #1370.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet changed the title A substitution that brings in the imaginary unit is passed over A root the substitution search would write through i is kept, and the cube is answered too Sep 29, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit a8a2b7e into master Sep 29, 2026
31 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.

sqrt(a + b sech(x)) tanh(x)^5 is integrated wrongly: the root of 1 - u^2 is written through the imaginary unit

1 participant