Skip to content

A half-angle integrand with symbols in it is put over one bar and not simplified - #1730

Merged
Rafael-SOWNet merged 5 commits into
masterfrom
a-half-angle-integrand-with-symbols-is-not-simplified
Oct 4, 2026
Merged

Rafael-SOWNet merged 5 commits into
masterfrom
a-half-angle-integrand-with-symbols-is-not-simplified

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

Under t = tan(x/2) a rational function of the sine and cosine was simplified before it was integrated, and with symbols in it the simplifier's search grew past any budget, where integrating what it returned takes a fraction of a second:

integrand 2.5.0 master ba8eb99b this
sec(x)^2/(a + b cos(x))^3 declined 38 s 1.6 s
sec(x)^2/(a + b cos(x))^4 declined past two minutes 1.4 s
sec(c + d x)^2/(a + b cos(c + d x))^4 declined past two minutes 0.9 s
sec(x)/(a + b cos(x))^3 declined 7.5 s 0.25 s
1/(cos(x) (a + b cos(x))^2) declined 1.6 s 0.3 s

Timed one integrand at a time, beside other work on the machine.

What changes. A rational function of t with a symbol in it is put over one bar, with its whole powers of products written as products of powers and its bases of a lower degree than they are written in lowered, and is not simplified further. One without a symbol, or with a root of t in it, is simplified as before: under a root the simplifier's writing of the radicand is what the radical rules read, and 1/(b cos(x) + c sin(x) - sqrt(b^2 + c^2))^(3/2) went from a decline in three seconds to a search past two minutes without it.

Tests: HalfAngleSubstitutionIntegralTest.APowerOfALinearInTheCosineBesideASecant, five rows, each differentiated back with the symbols pinned.

Measured first on every sixth of the 5,655 problems in Rubi's family 4 that are rational functions of trigonometric functions of one argument with a symbol in them, 938 run, at the corpus's 5-second budget, against master 8f3757cd, the branch's base:

master this
solved 871 902
wrong 0 0
past the budget 59 28

Measured then on the Rubi corpus against master 8f3757cd:

master this
family 0, independent suites (1814) 1766 1766
family 1, 40 a file (1381) 1296 1295
families 2 to 8, sampled (2410) 2215 2232

No answer is wrong in the sample on either build. Of the 49 problems the two builds disagreed on, run again one build at a time, 43 ran out of time on master and are answered here, 34 of them in the secant files 4.5 -- 1/(a + b sec(c + d x))^2, sec(e + f x) (a + b sec(e + f x))/(c + d sec(e + f x))^3 and (A + B sec(c + d x))/(a + b sec(c + d x))^2 among them -- and the other nine rational functions of the trigonometric functions over a power of a linear or a quadratic in one of them. Five are answered on both: four take 21 to 23 s on either build, past the corpus's five seconds, and family 1's one difference in the sample, x^4/((a + b x^2)^2 (c + d x^2)^3), is one of them; the fifth, (A + B sin(e + f x))/((a + a sin(e + f x))^3 (c + d sin(e + f x))^3), takes 21 s on master and 7 s here. One, sqrt(g sin(e + f x))/((c + d sin(e + f x)) sqrt(a + a sin(e + f x))), runs out of time on both.

The suite passes on the merge with master ba8eb99b, 095cb42a, 14,673 tests with 13 skipped, run under a 4 GB heap limit, and the allocation gate on the commit measured, 489eb68b; every row above is as the table says on the merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 5 commits October 3, 2026 14:26
Under t = tan(x/2) the integrand was simplified before it was
integrated, and with symbols in it the simplifier's search grew past any
budget: sec(x)^2/(a + b cos(x))^3 spent 43 s in it and the fourth power
more than two minutes, where integrating what it returned takes 0.14 s.
With a symbol in it the integrand is put over one bar and not simplified;
one without a symbol is simplified as before.

Two things the simplifier did are done instead, since the steps after
it read them: whole powers of products are written as products of
powers, so that the 1 + t^2 the division takes off as a factor is not
hidden inside ((1 + t^2)(1 - t^2))^6, and a base of a lower degree than
it is written in is written as its polynomial, a (1 + t^2) + a (1 - t^2)
as 2 a, where read as a quadratic its leading coefficient is zero as a
value only.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Under a root the simplifier's writing of the radicand is what the
radical rules read: 1/(b cos(x) + c sin(x) - sqrt(b^2 + c^2))^(3/2)
was declined in 3 s with it and ran past two minutes without it.

Part of #718.

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
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 4, 2026
@Rafael-SOWNet
Rafael-SOWNet force-pushed the a-half-angle-integrand-with-symbols-is-not-simplified branch from 916f7c2 to e4048ed Compare October 4, 2026 04:13
@Rafael-SOWNet
Rafael-SOWNet merged commit 752974b into master Oct 4, 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