Skip to content

A root of one in the sine's symbolic quadratic is taken as the square it makes - #1596

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-root-of-one-in-the-sine-quadratic
Sep 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-root-of-one-in-the-sine-quadratic

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

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.

SolveARationalFunctionOfASineOverASymbolicQuadratic splits over the two roots r of the quadratic in the function, 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, but nothing checked for them. a - a sin(x)^2 has exactly those roots for every a, so the answer divided by zero wherever it was evaluated.

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):

  • for the sine, 2/(r t - 1);
  • for the cosine, (1 + r)/(2t) + (1 - r) t/2, which is 1/t at 1 and t at -1.
Input Was (2.5.0) Master Now
csc(x)^2/(a - a*sin(x)^2) integral(...) NaN wherever evaluated -cot(x)/a and two terms rational in tan(x/2)
sin(x)^6/(a - a*sin(x)^2) integral(...) NaN wherever evaluated an antiderivative
1/(a - a*cos(x)^2) integral(...) NaN wherever evaluated an antiderivative rational in tan(x/2)
cos(x)^4/(a - a*cos(x)^2) integral(...) NaN wherever evaluated an antiderivative

SineOverASymbolicQuadraticTest.OverRootsAtOne differentiates four such integrands back at a = 1.3 and at a = -0.7.

Measured with work/intbench against master at dd728251, the commit this is cut from, 3 s a problem:

  • Rubi's 102 rows with a - a sin(y)^2, a - a cos(y)^2 or a - b sin(y)^2 below 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 over a - a sin(c + d x)^2, which master answered with NaN.
  • The families sample (912 problems) and family 0 (1814), on a build with this branch and three others merged, against dd728251: re-run on each branch alone, none of the twelve moves is this branch's, and none is a loss.

SineOverASymbolicQuadraticTest passes (15), and every target builds.

🤖 Generated with Claude Code

… 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>
@Rafael-SOWNet
Rafael-SOWNet merged commit 1293b56 into master Sep 29, 2026
31 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.

A rational function of the sine over a symbolic quadratic with roots ±1 is answered with NaN

1 participant