Skip to content

Hold an answer through a root taken real where a second root makes the integrand real - #2017

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
hold-an-answer-where-a-second-root-makes-the-integrand-real
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
hold-an-answer-where-a-second-root-makes-the-integrand-real

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #233. Fixes answers that held on only part of the real line.

Three places take a root as a nonnegative real u and attach radicand >= 0 to the answer:

  • the factoring in SolveByLinearRadicalSubstitution;
  • the "as the root" branch of SolveBySubstitution;
  • the factored branch of SolveBySubstitution.

Where a second root is imaginary on the same side, the integrand is real there as a product of two imaginary roots, and the answer said nothing:

  • Timofeev 926 and 927, asec(x) beside sqrt(x^2 - 1), are real on 0 < x < 1, where the arcsecant and the root are both imaginary.
  • Rubi's sqrt(cot) (a + b tan)^(k/2) and its kin in 4.3.2.1 and 4.3.3.1 are real where tan < -a/b.

The harness now counts such an answer as Partial: right wherever it has a value, and without one at points where the integrand is real.

The change. ConditionedOnTheRadicand acts where the answer holds an even root besides. It asks PartialFractions.WhereTheDerivativeHoldsBeyondTheRadicand, which works in two stages:

  1. It sorts 15 points per sign pattern by interval arithmetic on the integrand and the radicand.
  2. Only where one of those points is real beyond the zero does it differentiate the answer, lazily, real points first.

The outcome sets the condition:

  • holds at every real point there, beside exactly one other half-odd root: the answer carries the integrand's real domain, e.g. provided tan(c + d x) >= 0 or a + b tan(c + d x) <= 0;
  • also holds at every complex point: no condition;
  • anything else: the old condition, as it is for an integrand that is real at no point beyond the zero.

Results:

  • 40 partial answers become whole: 26 of 4.3.3.1, 12 of 4.3.2.1, and Timofeev 926 and 927. Each was checked with mpmath on both sides.
  • Only the condition changes, by 28–60 characters: Timofeev 926 goes 184 → 212, 4.3.3.1:740 goes 2,736 → 2,767.
  • 2.5.0 declined every sample.

Chain against master a567c8b (this branch's base was a4e7656, one commit later, which touches 3.x only), with the harness at its current revision on both arms:

  • pocket of 2,104 rows (all of 5.5.x, 5.6.x, Timofeev and 4.3.3.1, plus 510 tangent-root rows of family 4): exactly those 40 go Partial → Solved, 0 wrong;
  • samples of families 0–8: unchanged in verdicts;
  • the check costs 24–111 MB on the rows it changes;
  • a first version re-answered Bondarenko 22 and 23 at 2.4× the allocation. Its dropped condition was right by mpmath, but the check is now bounded, and those rows are master's again, byte for byte, at 0.582 and 0.505 GB.

Rebased onto f705d99, which changes how constants differentiate (#2014): 2,312 related tests pass.

The BREAKING-CHANGES.md entry has 2.5.0's column measured.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…e integrand real

Three places take a root as a nonnegative real u and attach `radicand >= 0`
to the answer: the factoring in SolveByLinearRadicalSubstitution and the "as
the root" and factored branches of SolveBySubstitution. Where a second root
is imaginary on the same side, the integrand is real there as a product of
two imaginary roots, and the answer said nothing. Timofeev 926 and 927,
asec(x) beside sqrt(x^2 - 1), are real on 0 < x < 1; Rubi's
sqrt(cot) (a + b tan)^(k/2) and its kin in 4.3.2.1 and 4.3.3.1 are real
where tan < -a/b.

ConditionedOnTheRadicand, where the answer holds an even root besides,
asks PartialFractions.WhereTheDerivativeHoldsBeyondTheRadicand. That sorts
15 points per sign pattern by interval arithmetic on the integrand and the
radicand, and only where one is real beyond the zero differentiates the
answer, lazily and real points first. An answer that holds at every real
point there, beside exactly one other half-odd root, carries the integrand's
real domain -- `tan(c + d x) >= 0 or a + b tan(c + d x) <= 0`; one that also
holds at every complex point carries no condition; anything else keeps the
old one, and so does an integrand real nowhere beyond the zero.

40 answers on part of the line -> whole (26 of 4.3.3.1, 12 of 4.3.2.1,
Timofeev 926, 927), each checked with mpmath on both sides; the condition
grows 28-60 characters. Chain against master a567c8b (base a4e7656): pocket
of 2,104 rows, exactly those 40 Partial -> Solved, 0 wrong; samples unchanged
in verdicts. The check costs 24-111 MB on the rows it changes; Bondarenko 22
and 23, which the first version re-answered at 2.4x the allocation, are
master's again, byte for byte, at 0.582 and 0.505 GB.

Part of #233.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 21, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit f7f2a7a into master Oct 21, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant