Repository navigation
A root of one in the sine's symbolic quadratic is taken as the square it makes - #1596
Merged
Merged
Conversation
… it makes csc(x)^2/(a - a sin(x)^2) and sin(x)^6/(a - a sin(x)^2) were answered with NaN wherever they were evaluated. The rule for a rational function of the sine over a symbolic quadratic in it splits over the quadratic's two roots and integrates each 1/(sin(x) - r) as -2 atan((r tan(x/2) - 1)/sqrt(r^2 - 1))/sqrt(r^2 - 1). Its documentation excludes r = 1 and r = -1, but nothing checked for them, and a - a s^2 has exactly those roots for every a. Where r^2 - 1 vanishes identically, the quadratic under the half-angle is a square and the piece is rational in t = tan(x/2): 2/(r t - 1) for the sine, and for the cosine (1 + r)/(2t) + (1 - r) t/2, which is 1/t at 1 and t at -1. Measured with work/intbench against dd72825, 3 s a problem: Rubi's 102 rows with a - a sin^2, a - a cos^2 or a - b sin^2 below the bar, 88 -> 102 solved, the 14 wrong -- all of 4.1.7's rows 64 to 77 -- none wrong now. Closes #1588. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #1588: a rational function of the sine or the cosine over a symbolic quadratic whose roots are ±1 is integrated, where it was answered with NaN.
SolveARationalFunctionOfASineOverASymbolicQuadraticsplits over the two rootsrof the quadratic in the function, and integrates each1/(sin(x) - r)as-2 atan((r tan(x/2) - 1)/sqrt(r^2 - 1))/sqrt(r^2 - 1). Its documentation excludesr = ±1, but nothing checked for them.a - a sin(x)^2has exactly those roots for everya, so the answer divided by zero wherever it was evaluated.Where
r^2 - 1vanishes identically, the quadratic under the half-angle is a square, and the piece is rational int = tan(x/2):2/(r t - 1);(1 + r)/(2t) + (1 - r) t/2, which is1/tat 1 andtat -1.csc(x)^2/(a - a*sin(x)^2)integral(...)-cot(x)/aand two terms rational intan(x/2)sin(x)^6/(a - a*sin(x)^2)integral(...)1/(a - a*cos(x)^2)integral(...)tan(x/2)cos(x)^4/(a - a*cos(x)^2)integral(...)SineOverASymbolicQuadraticTest.OverRootsAtOnedifferentiates four such integrands back ata = 1.3and ata = -0.7.Measured with
work/intbenchagainst master atdd728251, the commit this is cut from, 3 s a problem:a - a sin(y)^2,a - a cos(y)^2ora - b sin(y)^2below the bar (4.1.7 and 4.2.7): 88 → 102 solved, 14 wrong → 0. The fourteen are all of 4.1.7's rows 64 to 77, powers of the sine and the cosecant overa - a sin(c + d x)^2, which master answered with NaN.dd728251: re-run on each branch alone, none of the twelve moves is this branch's, and none is a loss.SineOverASymbolicQuadraticTestpasses (15), and every target builds.🤖 Generated with Claude Code