Repository navigation
A rational function of a sine over a symbolic quadratic in it is integrated over the two roots - #1401
Merged
Merged
Conversation
…grated over the two roots sin(x)/(a + b sin(x) + c sin(x)^2), and everything rational in sin(x) and cos(x)^2 over that quadratic, came back unevaluated or ran past any budget: under the half-angle the quadratic in the sine is a quartic in t with a symbol in every coefficient, which nothing factors, and the substitution u = sin(x) wants a cosine above the bar that an even power does not give. Written in s = sin(x) the integrand is a rational function of s, divided down and split over the written factors as any is, and the piece over the quadratic is taken by its two roots r = (-b ± sqrt(b^2 - 4ac))/(2c), as the biquadratic rule does for x^2: 1/(sin(x) - r) is -2 atan((r tan(x/2) - 1)/sqrt(r^2 - 1))/sqrt(r^2 - 1) for any complex r, and 1/(cos(x) - r) is -2 atan(tan(x/2)/σ)/((1 + r) σ) with σ = sqrt((r - 1)/(r + 1)) -- each checked by differentiation, where the chain's own piecewise on the sign of a root has no value for the conjugate pair the ordinary coefficients give. On each interval between the poles of tan(x/2), as every half-angle answer. Before the substitution search, which spends its budget on the quartic; declining in a few reads for anything else. Rubi's trig^m (a + b sin^n + c sin^(2n))^p file and its cosine sibling: sin(x)^4 over the quadratic answers in 71 ms where master had not returned after 190 s. The 1774-problem suite is unchanged at 1706 with 0 wrong. Part of #718. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…atic # Conflicts: # BREAKING-CHANGES.md # Sources/.editorconfig # Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs
Member
Author
|
Merged |
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.
Rubi's
trig^m (a + b sin^n + c sin^(2n))^pfile and its cosine sibling lost every even numerator:sin(x)/(a + b sin(x) + c sin(x)^2)came back unevaluated,sin(x)^4/(…)was still running after three minutes. Under the half-angle the quadratic in the sine is a quartic intwith a symbol in every coefficient, which nothing factors; the substitutionu = sin(x)wants a cosine above the bar that an even power does not give.The rule. Written in
s = sin(x)— the other four functions as quotients of the two, the cosine's even powers as1 - s^2— the integrand is a rational function ofs. It is divided down where improper, split over the written factors (s^k,(1 - s)^m (1 + s)^mfrom a secant, the quadratic) by the existing symbolic partial fractions, and the piece over the quadratic is taken by its two roots, exactly asSolveAnEvenPolynomialOverASymbolicBiquadraticdoes forx^2: withq = sqrt(b^2 - 4ac)andr = (-b ± q)/(2c),(d + e s)/(a + b s + c s^2)is(d + e r_1)/(q (s - r_1)) - (d + e r_2)/(q (s - r_2)), and∫ dx/(sin(x) - r) = -2 atan((r tan(x/2) - 1)/sqrt(r^2 - 1))/sqrt(r^2 - 1),∫ dx/(cos(x) - r) = -2 atan(tan(x/2)/σ)/((1 + r) σ)withσ = sqrt((r - 1)/(r + 1)),each for any complex
rbut±1, each checked by differentiation (d/dx atan(u/s)/s = u'/(s^2 + u^2)whateversis). That matters because the chain's own answer for1/(sin(x) - r)is a piecewise on the sign ofr^2 - 1, which has no value for the conjugate pair the ordinary coefficients give —1/(sin(x) - ((-b + sqrt(b^2 - 4ac))/(2c)))is unverifiable through the chain and exact here. The two forms are the ones the answers land on. A linear argumentk x + mdivides byk. Before the substitution search, which spends its budget on the quartic; it declines in a few reads for anything else — a tangent, an odd cosine, a second quadratic, a repeated one, a zero discriminant.Measured. All eleven rows of
SineOverASymbolicQuadraticTestdifferentiate back with the coefficients pinned to real roots (1, 5, 2) and to a conjugate pair (3, 1, 2), at six points;sin(x)^4/(a + b sin(x) + c sin(x)^2)answers in 71 ms where master had not returned after 190 s. All four test suites green (11,493). The 1,774-problem independent suite: 1706/1774, 0 wrong, 0 timeouts, per-problem verdicts identical to master, 89.6 s → 85.2 s in total. Rubi's family 4 sample (422, six per file): seven rows go from unevaluated or timeout to solved —sin(x),csc(x)^2,cos(x)^2,sec(x)^2andsin(x)^4overa + b sin(x) + c sin(x)^2,sin(x)^2over the cosine quadratic, and1/(a + b csc(c + d x)^2), which issin^2/(b + a sin^2)— and no row goes the other way (one(a + b tan)^2 (…)/(c + d tan)^3reads Solved at 24.7 s on one run and Timeout on the other, both past the 5 s budget). NewSineOverASymbolicQuadraticTestwith its.editorconfigsection; BREAKING-CHANGES entry.Part of #718.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura