Skip to content

A sine or a cosine of a shifted argument is written in the other - #1825

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-sine-of-a-shifted-argument-is-written-in-the-other
Oct 8, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-sine-of-a-shifted-argument-is-written-in-the-other

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

sin(a + b x) sec(c + b x)^3 was declined in a few milliseconds, with twenty-nine more of Rubi's 4.7.1 that put a sine or a cosine of one linear argument beside functions of another of the same slope: SolveByWritingTwoFunctionsOfShiftedArgumentsApart reads two functions of one kind, and nothing read a sine beside a secant of a shifted argument. With d = A - B a constant,

sin(A) = sin(d) cos(B) + cos(d) sin(B)
cos(A) = cos(d) cos(B) - sin(d) sin(B)

so SolveByWritingASineOfAShiftedArgumentInTheOther writes the sines and cosines of the one argument that stands only in sines and cosines in the other, and asks the same question of one argument.

Both arguments must carry an offset. A first version did not ask it, and lost nine of 4.3.1.2's sec(c + d x)^4/(a + i a tan(c + d x))^2 and its like: another rule had written cos(c + d x) as cos(c) cos(d x) - sin(c) sin(d x) on the way, and this one wrote it back, round and round past thirty seconds.

integrand 2.5.0 master 136a7f51 this
sin(a + b x) sec(c + b x)^3 declined declined 82 characters
cos(a + b x) sec(c + b x)^2 declined declined 111 characters
sin(a + b x) csc(c + b x)^4 declined declined 215 characters

Tests: ASineOfAShiftedArgumentIntegralTest, the three rows above, each differentiated back and compared at six points.

Measured on every corpus problem of 4.7 and every one with a secant or a cosecant, 7,605 of them, at the corpus's 5-second budget, against master 136a7f51:

master this
solved 7372 7402
unevaluated 163 133
wrong 0 0
past the budget 50 50

Thirty problems are answered here and not on master, all of 4.7.1, and none the other way; on the 7,372 both answer the time is 1,922 seconds and 1,922.

master this
family 0, independent suites (1814) 1782 1782
family 1, 40 a file (1381) 1341 1341
families 2 to 8, sampled (2410) 2330 2330

The harness counts no answer wrong in either. The thirty problems the builds disagreed on, run again one build at a time: master answers none, this all thirty.

The suite passes: 15,164 passed, 13 skipped, none failed, on the change before its test was added; with it, the related tests pass, 534. The allocation gate passes: every gated benchmark allocates what the baseline says. The library builds for every target.

Left in 4.7.1: csc(a + b x)^k sin(2a + 2b x)^n, whose arguments' slopes differ by a factor of two.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Where every trigonometric function is of one of two linear arguments of the
same slope, each with an offset, and those of one are sines and cosines only,
the addition formula writes them in the other. 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 8, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit b8b252b into master Oct 8, 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