Skip to content

A perfect square in a power of the variable is read as one - #1491

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
perfect-square-trinomial
Sep 24, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
perfect-square-trinomial

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

sqrt(a^2 + 2 a b x^2 + b^2 x^4) sqrt(c + e x + d x^2) was left unevaluated. The radicand is (a + b x^2)^2, so its root is |a + b x^2|, but the rule that reads a root of a perfect square (#1477) read only a quadratic in x. It now reads the same quadratic in a power of x, a x^(2k) + b x^k + c. It puts sgn(x^k + h) in front of the integral, as it does for k = 1, and leaves the sign off where k is even and h is a positive number. The shift h is simplified where it holds a symbol, so 2 a b/(2 b^2) becomes a/b, for k = 1 as well.

Measured

before after
Rubi 1.2.2.2, 1.2.2.4, 1.2.2.7 and 1.2.3.2: the 574 problems that count with a perfect square written in symbols 182 388, no row lost, 19 timeouts → 9, 732 s → 478 s
Rubi family 1 160/228 166/228
Rubi families 4–7, the 7.1 files and the 1774-problem suite — unchanged, row for row
unit suite 12,709 12,712 (three cases added), 0 failed, run to completion
allocation gate — PASSED on all 19 gated benchmarks

Two rows went from a decline to a timeout: (d x)^(23/2)/(a^2 + 2 a b x^2 + b^2 x^4)^(5/2) and its 21/2 neighbour. Both become a high power of x over the fifth power of x^2 + a/b.

Still declined: the same square in a symbolic power x^n, and whole powers of the square, such as 1/(a^2 + 2 a b x^2 + b^2 x^4)^2. The whole powers are 84 of the remaining rows, and I'm taking them next.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

sqrt(a^2 + 2 a b x^2 + b^2 x^4) is |a + b x^2|, but the rule that reads a
root of a perfect square read only a quadratic in x. It now reads the
same quadratic in a power of x, a x^(2k) + b x^k + c, with sgn(x^k + h) in
front of the integral as for k = 1. There is no sign where k is even and
h is a positive number. The shift h is simplified where it holds a
symbol.

Rubi's 1.2.2.2, 1.2.2.4, 1.2.2.7 and 1.2.3.2, the 574 problems that count
with a perfect square written with symbols: 182 to 388, no row lost,
19 timeouts to 9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit d5f7a40 into master Sep 24, 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