Skip to content

Any power of a square written out is the power of its root, in any power of x - #1698

Merged
Rafael-SOWNet merged 4 commits into
masterfrom
a-power-of-a-square-is-a-power-of-its-root
Oct 2, 2026
Merged

Rafael-SOWNet merged 4 commits into
masterfrom
a-power-of-a-square-is-a-power-of-its-root

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Part of #718.

A square written out, A + B w + C w^2 with B^2 = 4 A C, is read as the modulus of its root by SolveByTakingARootOfAPerfectSquare, but only under half an odd power and only in a whole power of x. Rubi writes the square under every other power too, and in other powers of x:

integrand master this
x^2 (a^2 + 2 a b x^3 + b^2 x^6)^p declined (a^2 + 2 a b x^3 + b^2 x^6)^p (x^3 + a/b)/(3 (2 p + 1))
(a + b x)(d + e x)^3 (a^2 + 2 a b x + b^2 x^2)^p declined 0.6 s
(a^2 + 2 a b x^2 + b^2 x^4)^(3/4) declined 0.3 s
x sqrt(a^2 + 2 a b x^n + b^2 x^(2n)) declined sqrt(...)/(x^n + a/b) (a x^2/(2 b) + x^(n + 2)/(n + 2))
x (a^2 + 2 a b x^(1/3) + b^2 x^(2/3))^p declined 0.8 s

What changes. A new rule, after SolveByTakingARootOfAPerfectSquare, reads a power Q^p of a sum of three terms whose powers of x are 0, k and 2 k, for any k: a whole number, a fraction or a symbol. Where B^2 - 4 A C vanishes identically, Q = C L^2 with L = x^k + B/(2 C). The integral is then F times the integral with L^(2p) in place of Q^p, where F = Q^p / L^(2p). F is constant wherever L is not zero: its derivative carries C L^2 Q^(p-1) - Q^p, which is zero because Q^(p-1) Q = Q^p wherever Q is not zero. So it comes out of the integral, whatever p is: F above the bar, 1/F below it, and nothing where the square is not a factor of the integrand. For a whole p it is C^p. This is how Rubi writes these answers.

The rule leaves to the rule before it what that one answers, so those answers keep their form: half an odd power or a whole one of a square in a whole power of x, and since #1695 half an odd power of one in a fractional power. It runs at the top only, as the sign that rule writes does.

Tests: PowerOfAPerfectSquareIntegralTest, eleven rows, five of them with the square below the bar, each differentiated back with a negative so that L changes sign among the points. The two below the bar in x^(1/3) take a symbolic power and 3/4, which only this rule answers, since #1695 answers a half-odd one.

Measured first on Rubi's 1.2.3.2, the 179 fair problems whose trinomial is a square, both builds side by side. Against master 58581667, merged in and with #1695's modulus for fractional powers, this answers 156 and master 124. Neither answers any wrongly, and nothing master answers is lost. Against the branch's base the same pocket was 156 against 103.

Measured then on the Rubi corpus against master c3f52691, the branch's base, with both builds side by side:

master this
family 0, independent suites (1814) 1758 1758
family 1, 40 a file (1381) 1121 1127
families 2 to 8, sampled (2410) 2144 2145

No answer is wrong on either build.

Seven problems moved between the two runs, so I re-ran each alone on both builds. This branch answers all seven and master one of them, neither wrongly.

The suite passes, 14,389 tests on a fresh build, and so does the allocation gate. Master 58581667 is merged in since. Its conflicts were #1691's rule and #1695's helper, added beside this rule, and both are kept. On the merge the tests of all three pass, 47 of them. Master f2f1ce1c is merged in after that, without conflicts, and the calculus tests pass on it, 3,730 of them.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 3 commits October 2, 2026 14:39
…wer of x

A square written out, A + B w + C w^2 with B^2 = 4 A C, was read as the
modulus of its root only under half an odd power and in a whole power of
x. A symbolic power, (a^2 + 2 a b x + b^2 x^2)^p, a power such as 3/4,
and the square in x^n or x^(1/3) were declined.

The power of the square is now the power of its root L = w + B/(2 C)
times F = (A + B w + C w^2)^p / L^(2p), which is constant wherever L is
not zero and comes out of the integral: F above the bar, 1/F below it,
and nothing where the square is not a factor of the integrand. After the
rule for half an odd power, which keeps its answers, and at the top only.
On Rubi's 1.2.3.2, 179 fair problems whose trinomial is a square, 156 are
answered where master answers 103, none wrongly. Rubi's 1.2.1.2, 1.2.2.2
and 1.2.3.2.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…-is-a-power-of-its-root

# Conflicts:
#	Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs
#	Sources/AngouriMath/Functions/Continuous/Integration/Integration.Definition.cs
…t answer it

A half-odd power of a square in a fractional power of x is the root of a
square's, by its modulus, since #1695. The two rows below the bar take a
symbolic power and 3/4 instead, which only this rule answers.

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 2, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 0dd8692 into master Oct 2, 2026
34 checks passed
Rafael-SOWNet added a commit that referenced this pull request Oct 3, 2026
…m has it (#1705)

1/sqrt(a x^2 + b x^5) was declined: the rule that takes a repeated
factor out of a root factors the radicand over the rationals, which a
symbol stops, and nothing took a power of x out of a fractional power at
all, as in 1/(x sqrt(b x^(2/3) + a x)). (a x^j + b x^n)^p is
K x^(j p) (a + b x^(n - j))^p with K the quotient of the two, which is
constant wherever x and the sum are not zero, so it comes out of the
integral as the factor of a square does (#1698). For an even whole j
and a whole j p it is sgn(x)^(j p). The sum may be written as one, or as
a product or quotient with powers of x among its factors. An odd whole
j out of a sum of whole powers is left to the rules that answered it,
since the sum is real on both sides of 0 and x^(j p) is not.

x/sqrt(1 + 1/(c x)^2) goes this way now: x^(-2) is positive, and the
answer holds for any c but 0, where it said c^2 > 0. Its test checks
that at a complex c instead.

Part of #718.


Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet
Rafael-SOWNet deleted the a-power-of-a-square-is-a-power-of-its-root branch October 29, 2026 00:43
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