Skip to content

An answer that took an even root real without reading its sign says where it holds - #1594

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
an-even-root-answer-says-where-it-holds
Sep 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
an-even-root-answer-says-where-it-holds

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Closes #1581: an answer through an even root that took the root real without reading its sign is checked where the integrand is real, and says where it holds when it is not the antiderivative there.

SolveBySubstitution conditions its answer on the radicand after an even root u = t^(1/q), but only when the answer below held sgn(u) or |u|. The rules below can take u real without either. SolveByCombiningRadicals writes sqrt(1 + 1/u^2) sqrt(1 - u^4) as sqrt(u^4 - u^8 + u^2 - u^6)/u^2, which is right for a real u, where sqrt(u^4) = u^2, and negated for an imaginary one. Where the radicand is negative u is imaginary, and the integrand can still be real there beside a second imaginary root. sqrt(cos(x))/sqrt(a + a sec(x)) under t = cos(x) and u = sqrt(t) came back negated wherever the cosine is negative, and so did six of its kin in Rubi's 4.5.1.2 and 4.5.3.1.

The check. Where the answer below read no sign and the integrand holds a second even root, which is the only way it can be real where the radicand is negative, the answer is differentiated with the symbols pinned and compared with the integrand at the default sampled points where the integrand is real (DiffersWhereReal, #1572's). Where it differs, it carries provided t >= 0, as the answers that read a sign already do. Where it does not, the answer is as it was. Conditioning every answer through an even root, which the issue tested, would also condition the answers that hold on both sides.

Input Was (2.5.0) Master Now
sqrt(x)/(sqrt(1/x + 1)*sqrt(1 - x^2)) integral(...) an antiderivative, negated on (-1, 0) the same, provided x >= 0
sqrt(cos(x))/sqrt(1 + sec(x)) integral(...) through #1584's rule, provided cos(x) >= 0 unchanged

LinearRadicalSubstitutionIntegralTest.AnEvenRootTakenRealWithoutASignSaysWhereItHolds differentiates both back inside the condition and checks that the answer claims nothing outside it, where the integrand is real.

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

  • A seeded twentieth of the problems in families 0 to 7 whose integrand holds half-odd powers of two different bases, 453 listed and 273 the harness can state. These are the only integrands the check can reach. No verdict moves (183 solved on both), and the rows take 382 s against 383 s. The check changes an answer only where it is not the antiderivative where the integrand is real, and Half-odd powers of a ± a sec and a ± a csc by the half-angle tangent #1584 answers Rubi's seven rows before this route is asked.
  • The families sample (912 problems) and family 0 (1814), on a build with this branch and three others merged, against dd728251: 793 → 804 and 1752 → 1753. Re-run on each branch alone, none of the twelve moves is this branch's, and none is a loss.

The unit tests pass on a build with this branch and two others of mine merged (net10.0, 13,685), and every target builds.

🤖 Generated with Claude Code

…here it holds

The substitution for an even root, u = t^(1/q), conditions its answer on the
radicand only where the answer below read a sign or a modulus of u. The rules
below can take u real without either: SolveByCombiningRadicals writes
sqrt(1 + 1/u^2) sqrt(1 - u^4) as sqrt(u^4 - u^8 + u^2 - u^6)/u^2, which reads
sqrt(u^4) as u^2, the other root wherever u is imaginary. Where the radicand
is negative u is imaginary, and the integrand can still be real there beside
a second imaginary root: sqrt(cos(x))/sqrt(a + a sec(x)) under t = cos(x) and
u = sqrt(t) came back negated wherever the cosine is negative. Where the answer
below read no sign and the integrand holds a second even root, the answer is
now differentiated and compared with the integrand at the default sampled
points where the integrand is real; where it differs, it carries
provided t >= 0, as the answers that read a sign already do.

Measured with work/intbench against dd72825, 3 s a problem: a seeded
twentieth of the problems holding half-odd powers of two different bases, the
only ones the check reaches, 273 statable: no verdict moves, same time.

Closes #1581.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet
Rafael-SOWNet merged commit 02e2f3d 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 root of the cosine beside a half-odd power of a + a sec is integrated wrongly where the cosine is negative

1 participant