Skip to content

Symbolic powers of a ± a sin beside a power of the cosine are integrated through the sine - #1754

Merged
Rafael-SOWNet merged 3 commits into
masterfrom
a-power-of-one-plus-the-sine-beside-one-minus-it
Oct 4, 2026
Merged

Rafael-SOWNet merged 3 commits into
masterfrom
a-power-of-one-plus-the-sine-beside-one-minus-it

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

(a + a sin(h + f x))^m sqrt(c - c sin(h + f x)) was declined, and so were the other powers of a ± a sin with a symbolic exponent beside the cosine or a function of the sine -- Rubi's (a + b sin)^m (c + d sin)^n files with a^2 = b^2 and c^2 = d^2, most of them after the whole budget: the half angle at which 1 ± sin is a square wants numeric powers. 2.5.0 declined them too:

integrand 2.5.0 master 4dbe73a4 this
(a + a sin(h + f x))^m sqrt(c - c sin(h + f x)) declined searched past 8 s in 1.3 s
cos(h + f x)^2 (a + a sin(h + f x))^m/sqrt(c - c sin(h + f x)) declined searched past 8 s in 0.2 s
(g cos(h + f x))^(1 - 2m) (a + a sin(h + f x))^m (c - c sin(h + f x))^(m - 1) declined declined after 6.3 s in 0.2 s
(a + a sin(h + f x))^m (c - c sin(h + f x))^(-1 - m) declined searched past 8 s in 0.7 s
(a + a cos(h + f x))^m sqrt(c - c cos(h + f x)) declined declined after 7.1 s in 0.1 s

Each answer is differentiated back with the symbols pinned and compared as a complex number at x = -2.3, -1.1, -0.4, 0.4, 1.1, 1.9, 2.6; the times include that.

What changes. (1 + sin(y))(1 - sin(y)) is cos(y)^2, so under u = sin(y) each such power, a power of g cos(y) beside it and dy = du/cos(y) itself are powers of 1 + u and 1 - u, up to a factor constant on each interval where it is defined, and the rest of the integrand, a function of the sine, comes along. (1 + u)^A (1 - u)^B R(u) is asked in u, and the answer is that antiderivative times the factor: the powers as written over the form they were rewritten to, a quotient whose logarithmic derivative is zero, so it holds whatever a, c, g and the exponents are. The cosine's the same way, by u = cos(y). Only where an exponent is symbolic.

Tests: PowersOfOnePlusAndMinusASineIntegralTest, seven rows differentiated back with the symbols pinned, at six points on both sides of zero; none is answered on master.

Measured first on the 1,279 problems of family 4 with a power of a ± a sin or a ± a cos, 797 of them run, at the corpus's 5-second budget, against master 8f3757cd, the branch's base:

master this
solved 733 777
wrong 0 0
past the budget 52 16

The 697 with numeric powers are answered alike, all but one on both builds. Of the 100 with a symbolic power, master answers 37 and this 81. Thirteen of the 19 left ask (1 + u)^A (1 - u)^B beside a polynomial, with A + B a whole number below -2 -- (a + a sin)^m (c - c sin)^(-3 - m) and its kin -- which t = (1 + u)/(1 - u) makes a power of t beside a polynomial. A rule for two linear powers whose exponents sum to such a number follows in a PR of its own, and with both the thirteen are answered in 0.1 to 0.5 seconds, where either alone runs past eight.

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 1297
families 2 to 8, sampled (2410) 2215 2225

The harness counts no answer wrong in the pocket or the sample on either build. Of the 49 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 1 and this 42. The 42 are family 4's symbolic powers of a ± a sin, answered here in a second or less but one at sixteen, where master declines them or runs past the budget. The one master answers, 1/(x (a x + b x^3 + c x^5)^2), at twenty-two seconds, ran past the harness's patience here; run again, twice on each build, it runs past it on both. (-3 + 3 sin(h + f x))^(-1 - m) (a + a sin(h + f x))^m, past the budget on master, is answered here where the harness cannot check it, its integrand being complex on the whole real line, and five run past the budget on both.

The suite passes on the commit measured, c342aaea, 14,598 tests with 13 skipped, and the allocation gate with it. On the merge with master 4dbe73a4, 3a351431, the 4,148 calculus and corpus tests that run pass, with 2 skipped. Every row of the first table is as it says on the merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 3 commits October 4, 2026 09:43
…ted through the sine

(1 + sin y)(1 - sin y) is cos(y)^2, so under u = sin(y) a power of
a ± a sin(y), a power of g cos(y) beside it and dy itself are powers of
1 + u and 1 - u up to a factor constant on each interval. The rest is
asked in u, and the answer is the antiderivative times that factor: the
powers as written over the form they were rewritten to, whose logarithmic
derivative is zero. The cosine's the same way, by u = cos(y). Only where an
exponent is symbolic, since numeric half powers are the half angle's.

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 merged commit a27661f into master Oct 4, 2026
34 checks passed
Rafael-SOWNet added a commit that referenced this pull request Oct 4, 2026
…are integrated (#1756)

(a + b x)^m (c + d x)^(-3 - m) was declined, while the sum -2 was
answered. Under t = L1/L2 the product L1^A L2^B, with A + B = -k and
k >= 2 whole, beside a polynomial of degree at most k - 2, is a power of
t beside a polynomial in t. Since t^(A + i + 1) is t^A t^(i + 1) for a
whole i + 1, the antiderivative is the two powers as written times a
polynomial in x, exact wherever the integrand is defined. A closed rule:
with #1754's substitution it also answers the powers of 1 +- sin(y) that
rule leaves. Rubi's 1.1.1.2 to 1.1.1.4 with such powers go from 310 to
330 of 339.

Part of #718.

Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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