Repository navigation
A power of a cosine and a sine plus their amplitude is integrated - #1761
Merged
Rafael-SOWNet merged 3 commits intoOct 4, 2026
Merged
Conversation
b cos(y) + c sin(y) is R cos(y - phi) for R = sqrt(b^2 + c^2), so with a^2 = b^2 + c^2 the base a + b cos(y) + c sin(y) is a square of the half angle. With T = b sin(y) - c cos(y), T' = S - a, S' = -T and T^2 = S (2a - S), and d/dy (T S^(n-1)) = n S^n - a (2n - 1) S^(n-1) steps a half-odd power down to 1/2, where the integral is 2T/sqrt(S), or up to -1/2 or -1, where it is (2/sqrt(2a)) atanh(T/(sqrt(2a) sqrt(S))) and T/(a S). No phi appears. sqrt(5 + 4 cos(x) + 3 sin(x)) and the rest of Rubi's 4.7.7 with a^2 = b^2 + c^2 were declined or past the budget. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…-and-a-sine-plus-their-amplitude # Conflicts: # Sources/AngouriMath/Functions/Continuous/Integration/Integration.Definition.cs
…-and-a-sine-plus-their-amplitude
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.
sqrt(5 + 4 cos(x) + 3 sin(x))was declined, with the rest of Rubi's 4.7.7 powers ofa + b cos(y) + c sin(y)witha^2 = b^2 + c^2, some of the reciprocal powers after searches past the budget. 2.5.0 declined them too:a10be86csqrt(5 + 4 cos(x) + 3 sin(x))2 (4 sin(x) - 3 cos(x))/sqrt(5 + 4 cos(x) + 3 sin(x)), in 0.8 s(5 + 4 cos(x) + 3 sin(x))^(5/2)1/sqrt(5 + 4 cos(x) + 3 sin(x))1/(5 + 4 cos(x) + 3 sin(x))^(3/2)(-5 + 4 cos(x) + 3 sin(x))^(3/2)1/(b cos(g + f x) + c sin(g + f x) + sqrt(b^2 + c^2))^(5/2)(b cos(g + f x) + c sin(g + f x) - sqrt(b^2 + c^2))^(3/2)1/(b cos(g + f x) + c sin(g + f x) - sqrt(b^2 + c^2))^3Each answer is differentiated back with
b = 0.9,c = 0.7,g = 0.4,f = 1.3and compared atx = -2, -0.7, 0.4, 1.5, 2.6, as complex numbers; the times include that.What changes.
b cos(y) + c sin(y)isR cos(y - phi)forR = sqrt(b^2 + c^2), so witha^2 = b^2 + c^2the base isa (1 ± cos(y - phi)), a square of the half angle, asa + a sin(y)is -- and the rule for that two-term case,SolveAHalfPowerOfOnePlusASine, has the identity this one uses. WithSthe base andT = b sin(y) - c cos(y),T' = S - a,S' = -TandT^2 = S (2a - S), the last beinga^2 = b^2 + c^2, so thatd/dy (T S^(n-1)) = n S^n - a (2n - 1) S^(n-1). That steps a half-odd power down to1/2, where the integral is2T/sqrt(S), or up to-1/2or-1, where it is(2/sqrt(2a)) atanh(T/(sqrt(2a) sqrt(S)))andT/(a S); each base is checked by differentiating it with the three identities alone. The answer needs nophi. For a realaof either sign, an antiderivative on every interval between the zeros ofS: the derivations use onlyS^(3/2) = S sqrt(S)and(sqrt(2a) sqrt(S))^2 = 2a S, and one less the square of the hyperbolic arctangent's argument isS/(2a), not negative. Half-odd powers either way and negative whole ones, up to eight;a^2 = b^2 + c^2decided, not assumed.Tests:
CosineAndSinePlusTheirAmplitudeIntegralTest, eight rows differentiated back with the symbols pinned and compared as complex numbers on both sides of zero; withanegative the integrand is imaginary on the whole line. None is answered on master.Measured first on the 293 problems of Rubi's 4.7.7 with a cosine and a sine of one argument and the 290 of 4.7.2, 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 39 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 7 and this 34. This answers 28 that master does not: 27 of 4.7.7's powers of
a + b cos(d + e x) + c sin(d + e x)witha^2 = b^2 + c^2, each in under a quarter of a second, where master declines them, some after eighteen seconds or past the budget; and a 6.6.1 integrand at twenty-two seconds, at the edge of the harness's patience. Master answers one that ran past the patience here,(A + B cos(x) + C sin(x))/(a + b cos(x) + c sin(x))^2, at twenty-three seconds. Run again, twice on each build, both builds ran past it on both. One more,(-5 + 4 cos(d + e x) + 3 sin(d + e x))^(7/2), is answered here and counted unverified, its integrand being imaginary on the whole line; differentiated back at five points as complex numbers it is right.The suite on the commit measured,
2808ab49, passed, and so did the allocation gate. On the merge with mastera10be86c,f45d54b9, the 4,185 calculus and corpus tests that run pass, with 2 skipped, and the library builds fornetstandard2.0. Every row of the first table is as it says on the merge. On the merge with master9f2cc36d,d6e1afd5, the head here, the 4,192 that run pass, with 2 skipped, and the library builds fornetstandard2.0.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura