Repository navigation
A constant plus an imaginary cosine and sine is an exponential - #1766
Merged
Rafael-SOWNet merged 2 commits intoOct 5, 2026
Merged
Rafael-SOWNet merged 2 commits into
Rafael-SOWNet merged 2 commits into
Conversation
a + b cos(y) + i b sin(y) is a + b e^(i y): the rule that writes the pair below the bar as the exponential reads it beside a constant, and there writes the cosine and sine of y elsewhere as exponentials too, so that the whole is rational in e^(i y). Without a constant the cosine above the bar stays, beside the exponential the closed rules answer. Rubi's (A + B cos(x))/(a + b cos(x) + i b sin(x)) and its kin were declined. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…imaginary-cosine-and-sine-is-an-exponential
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #718.
(A + B cos(x))/(a + b cos(x) + i b sin(x))was declined, with the rest of Rubi's 4.7.7 overa + b cos(x) ± i b sin(x). 2.5.0 declined them too:763f7bae(k + q cos(x))/(a + b cos(x) + i b sin(x))a + b e^(i x)and a term ine^(-i x), piecewise in whetheraandbare zero, in 1.1 s(k + q sin(x))/(a + b cos(x) - i b sin(x))(k + p cos(x) + q sin(x))/(a + b cos(x) + i b sin(x))cos(x)/(a + b cos(x) + i b sin(x))-i ln(b (a + b e^(i x)))/(2b)and a term ine^(-i x), in 0.2 sEach answer is differentiated back with
a = 2.3,b = 0.9,k = 1.1,p = 0.4,q = 0.6and compared atx = -2.3, -1.1, -0.4, 0.4, 1.1, 2.3, as complex numbers; the times include that. The answers run from 128 to 1,477 characters.What changes.
b cos(y) + i b sin(y)isb e^(i y), and the rule that writes such a pair below the bar as its exponential,SolveByWritingAnImaginarySumOfACosineAndASineAsAnExponential, read the pair alone. It reads it beside a constant now,a + b e^(i y), and there writes the cosine and sine ofyelsewhere in the integrand as exponentials too, so that the whole is rational ine^(i y). Without a constant, a cosine above the bar stays as it is, beside the exponential the closed rules answer.1/(a + b cos(x) + i b sin(x)), which master answers by the half-angle tangent, is answered in the exponential now.Tests:
ConstantPlusAnImaginaryCosineAndSineIntegralTest, four rows compared as complex numbers; master declines all four.Measured first on all of Rubi's 4.7.7, 836 problems, at the corpus's 5-second budget, against master
287c69a7, the branch's base:Measured then on the Rubi corpus against master
287c69a7: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. Of the 13 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 1 and this 10: eight are 4.7.7's quotients by
a + b cos(x) ± i b sin(x), each in two seconds or less, where master declines them, and one is a 1.1.2.4 rational function at twenty-three seconds, at the edge of the harness's patience, which master ran past. Both builds answer the other one, and both run past the budget on the remaining three.The suite on the commit measured,
613216e1, passed but for two tests that bound how long a declined integral takes,IntegralAnswerCacheTest.AnIntegralWithNoAnswerStillFinishesQuicklyat thirty-one seconds andInverseTangentPowerByPartsTest.ANonElementaryRemainderIsDeclinedQuicklyat sixty-five, with four other corpus runs on the machine; alone, the two classes pass in twelve seconds. The allocation gate passed. The head here,228dd45d, merges master763f7bae, and every row of the first table is as it says on it.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura