Skip to content

Write a symbolic quadratic that is a perfect square only as a value as the square of its linear - #1999

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
write-a-symbolic-perfect-square-as-the-square-of-its-linear
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
write-a-symbolic-perfect-square-as-the-square-of-its-linear

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Under the exponential substitution, 1/(b cosh(x) + c sinh(x) + sqrt(b^2 - c^2))^4 becomes a power of (b - c)/(b + c) + 2 sqrt(b^2 - c^2)/(b + c) u + u^2. That quadratic is (u + sqrt(b^2 - c^2)/(b + c))^2: its discriminant is zero as a value, though not as the simplifier writes it. Hermite's reduction declined it on two spellings, for 13 s and 19 s, and the table then answered a piecewise on that zero discriminant.

Partial fractions now begin with a new step, WithSymbolicPerfectSquaresWritten. It writes a repeated factor of the form x^k times such a quadratic as x^k A (x + B/(2A))^2. It takes a factor only if the quadratic has symbols, a root or a quotient of symbols among its coefficients, and a discriminant that is zero by PartialFractions.IsZeroAsAValue, after a quick check at one pinned point.

Each problem alone, measured as one process each:

Problem Master Branch
6.7.1:881, ^4 24.0 s, 53 GB, 6,557 characters 1.3 s, 0.34 GB, 416
6.7.1:880, ^3 14.6 s, 40 GB, 4,697 0.6 s, 0.18 GB, 272
6.7.1:879, ^2 4.8 s, 15 GB, 2,288 0.2 s, 0.08 GB, 182

The -sqrt(b^2 - c^2) twins at ^2 to ^4 drop from 7.8–28.9 s to 0.08–0.33 s, at 181–414 characters. Every answer is verified by differentiating back.

Measured on 20a4b391, branch against master:

Run Problems Master Branch
Pocket: Rubi's family 6 and 4.7, sampled 1,898 1,834 solved 1,834 solved
Family 1, 40 a file 1,381 1,370 1,370
Family 0, whole 1,814 1,796 1,796
Families 2 to 8, sampled 2,410 2,391 2,390

No verdict moves; the change is speed and size. The one-row sample difference is 3.2.1:152, which both builds answer alone. 6.1.5:94 reads wrong on both builds; that is the evaluator artefact of #1944. Other answers are unchanged character for character, among them 244 rows of 6.7.1, 86 of 4.2.7 and the sqrt(b^2 + c^2) rows of 4.7.7.

ASymbolicPerfectSquareWrittenAsTheSquareOfItsLinearIntegralTest checks that the answers carry no piecewise and differentiates them back. 582 related tests pass. BREAKING-CHANGES.md has the entry: 2.5.0 declined these, and the entry gives the unreleased master's piecewise lengths.

Part of #233.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…s the square of its linear

1/(b cosh(x) + c sinh(x) + sqrt(b^2 - c^2))^4 becomes, under the exponential
substitution, a power of (b - c)/(b + c) + 2 sqrt(b^2 - c^2)/(b + c) u + u^2,
which is (u + sqrt(b^2 - c^2)/(b + c))^2 -- its discriminant is zero as a
value, not as the simplifier writes it. Hermite's reduction declined it on
two spellings for 13 and 19 seconds, and the table then answered a piecewise
on that zero discriminant. Partial fractions now first write a repeated
factor that is x^k times such a quadratic, with symbols, a root or a
quotient of symbols among its coefficients and a discriminant zero by
PartialFractions.IsZeroAsAValue after a quick pinned check, as
x^k A (x + B/(2A))^2.

Rubi's 6.7.1:879-881 and the -sqrt twins: 6,557 characters in 24 s and
53 GB to 416 in 1.3 s and 0.34 GB for the fourth power, and so on, verified
by differentiating back. Other answers measured -- 244 rows of 6.7.1, 86 of
4.2.7 and more -- are unchanged, character for character.

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 685093c 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
@Rafael-SOWNet
Rafael-SOWNet deleted the write-a-symbolic-perfect-square-as-the-square-of-its-linear branch October 29, 2026 00:44
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