Skip to content

A root of a quadratic in the tangent is rotated until the quadratic has no linear term - #1475

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
mobius-rotation
Sep 23, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
mobius-rotation

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

1/sqrt(1 + 2 tan(x) + 3 tan(x)^2) was left as written — though 1/((1 + t^2) sqrt(A + C t^2)), which is what the tangent substitution leaves of it once the linear term is gone, was already answered.

Under x = y + arctan(m) the tangent becomes (tan(y) + m)/(1 - m tan(y)): the Möbius map that preserves 1 + tan^2, the factor the tangent substitution's dx brings. The quadratic's linear coefficient becomes b(1 - m^2) + 2(c - a)m, zero for a root of b m^2 + 2(a - c)m - b, whose discriminant 4((a - c)^2 + b^2) is never negative — the two roots are the quadratic form's perpendicular directions, and either will do.

Two things the measurements decided:

  • The radicand is assembled, not substituted into. A = a + bm + cm^2, C = am^2 - bm + c. Writing the Möbius quotient inside the root leaves a nesting that neither Simplify nor the chain reduces, so the substitution never sees the rotated quadratic: the first version of this rule turned a 787 ms decline into a 90 s search. The modulus that sqrt(N/(1 - mS)^2) leaves comes out in front as sgn(1 - m tan(y)), constant between its zeros as every such sign in these rules is.
  • A numeric rotation only. With symbolic a, b, c the rotation m is a nested surd, the rotated quadratic is written in it, and the rational integrator is handed a quotient over that field — two minutes and no answer, against a 0.8 s decline unrotated. The bound is on the work, not on the mathematics; a test pins that the symbolic shape is still declined quickly.

Measured (final build):

  • 1774-problem suite: 1707, 0 wrong, 0 timeout — unchanged. Family 6: 377/417 — unchanged. Family 4: 290/422 either way (one 27 s row flips with warmth at the 5 s cap; it times the same on master, 27.0 s against 27.9 s). Rubi's rows of this family are symbolic, so the corpus does not move: what this adds is the numeric class, int dx/sqrt(1 + 2 tan x + 3 tan^2 x) and its kin.
  • Unit suite: 12,655 tests, 0 failed. bench.sh: PASSED on all 19 gated benchmarks.
  • Five forms verified by differentiating back at five points, worst relative deviation 0, including tan(x)^2/(2 + tan(x) + tan(x)^2)^(3/2).

The symbolic case wants a rational integrator that stays in a quadratic field rather than expanding into it; that is the next piece of this, and it is not in here.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…as no linear term

`1/sqrt(1 + 2 tan(x) + 3 tan(x)^2)` was left as written, though
`1/((1 + t^2) sqrt(A + C t^2))` -- what the tangent substitution leaves
of it once the linear term is gone -- was already answered.

Under `x = y + arctan(m)` the tangent becomes `(tan(y) + m)/(1 - m tan(y))`,
the Möbius map that preserves `1 + tan^2`, and the quadratic's linear
coefficient becomes `b(1 - m^2) + 2(c - a)m`: zero for a root of
`b m^2 + 2(a - c)m - b`, whose discriminant `4((a - c)^2 + b^2)` is never
negative, so the rotation is always real. The two roots are the quadratic
form's perpendicular directions and either will do.

The radicand is assembled -- `A = a + bm + cm^2`, `C = am^2 - bm + c` --
and not substituted into: writing the quotient inside the root leaves a
nesting that nothing downstream reduces, which is how the first version of
this rule turned a decline into a ninety-second search. The modulus that
`sqrt(N/(1 - mS)^2)` leaves comes out in front as `sgn(1 - m tan(y))`,
constant between its zeros.

A numeric rotation only. With symbolic coefficients `m` is a nested surd,
the rotated quadratic is written in it, and what the rational integrator is
handed is a quotient over that field: two minutes and no answer, where the
integrand is declined in under a second unrotated. That bound is on the
work rather than on the mathematics, and a test pins that the symbolic
shape is still declined quickly.

Family 4 of the Rubi suite: 290/422 either way, 0 wrong -- its rows of this
family are symbolic; family 6 377/417 and the 1774-problem suite 1707
unchanged. Suite 12655 passed; allocation gate passed on all 19 gated
benchmarks. Each new row differentiates back at five points.

Part of #718.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit f46d55f into master Sep 23, 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.

1 participant