Skip to content

A difference is offered to the substitution search as a sum is - #1773

Merged
Rafael-SOWNet merged 5 commits into
masterfrom
a-difference-is-offered-for-substitution-as-a-sum-is
Oct 5, 2026
Merged

Rafael-SOWNet merged 5 commits into
masterfrom
a-difference-is-offered-for-substitution-as-a-sum-is

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

sin(1 + 2/(1 + x)) is answered under u = 1 + x, and sin(1 + 2/(1 - x)) was declined: the substitution search offered every sum in the integrand as a candidate, and no difference, so u = 1 - x was never tried. 2.5.0 declined these too:

integrand 2.5.0 master 85d6601c this
sin(1 + 2/(1 - x)) declined declined (x - 1) sin(1 + 2/(1 - x)), written apart, and the sine and cosine integrals of 2/(1 - x), in 0.4 s
cos(1 + 2/(x - 1)) declined declined in 0.08 s
sin(p + k/(c - d x)) declined declined in 0.07 s

Each answer is differentiated back and compared with the integrand at six points; the times include that. The answers run from 168 to 200 characters.

What changes. The search's candidates are the functions in the integrand, their arguments, the bases and exponents of powers, and the sums that stand in it. A difference stood in it as often, c - d x as c + d x, and is offered now where a sum is, under the same guard against a sum that stands only inside a longer one, which is a node of the tree rather than something written -- in the question asked, and not below it, where every substitution writes differences, x = (u^2 - c)/d: offered there, they were two fifths more search on Rubi's (c + d x)^(5/2)/(x (a + b x)^2).

Tests: DifferenceAsASubstitutionIntegralTest, five rows differentiated back with p = 0.3, k = 0.9, c = 1.1, d = 0.7 on both sides of the pole of each; master declines all five.

Measured first on the 1,692 problems with a difference in them across the corpus, a third of those in 1.1.1.3, 1,222 run, at the corpus's 5-second budget, against master 287c69a7, the branch's base:

master this
solved 1188 1188
wrong 0 0
past the budget 9 9

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 1306
families 2 to 8, sampled (2410) 2301 2293

The harness counts no answer wrong in the pocket or the sample on either build. The family figures were measured with three other corpus runs on the machine. The 10 problems the two builds disagreed on, pocket and sample together, are all rows at the edge of the harness's patience, answered at 14 to 25 seconds by one build or the other; run again one build at a time, master answers 5 and this 9. That commit, 01ea90ba, offered a difference at every depth, and one of the ten, 1.1.1.3:607, (c + d x)^(5/2)/(x (a + b x)^2), took it 30 seconds where master took 21 to 23; offered in the question asked only, as on the head, it takes 14 to 18. On the same 1,222 problems against master 85d6601c, the head and master answer the same 1,194, and neither answers any wrongly.

The suite on the commit measured, 01ea90ba, passed but for IntegralAnswerCacheTest.AnIntegralWithNoAnswerStillFinishesQuickly, which allows a declined integral thirty seconds and took sixty-nine with four corpus runs on the machine; on the head, that class and the new one pass alone in six seconds. The allocation gate passed. The head here, d022cedb, merges master 85d6601c, and gives every row of the first table the answer it says.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 5 commits October 4, 2026 20:02
`sin(1 + 2/(1 + x))` was answered under `u = 1 + x`, and `sin(1 + 2/(1 - x))`
was declined: the search offered every sum in the integrand as a candidate and
no difference, so `u = 1 - x` was never tried. A difference is offered wherever
a sum is, under the same guard against a partial sum.

Part of #718

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Below it every substitution writes differences, x = (u^2 - c)/d, and offering
them was two fifths more search on Rubi's (c + d x)^(5/2)/(x (a + b x)^2).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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 c313b24 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