Skip to content

Chebyshev's other two cases for a binomial differential, a term of a top-level sum asked at the top, and a bare inverse function by parts - #1288

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
binomial-differential-cases
Sep 11, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
binomial-differential-cases

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

sqrt(1 + x^3)/x had no antiderivative. x^2 sqrt(1 + x^3) and x^5 sqrt(1 + x^3)
did, by the same substitution, and the rule for it (#1275) stopped where Chebyshev's
first case does.

The second case, with a rational function left over

Under u = (a + b x^n)^(1/q), with s = (m + 1)/n:

int x^m (a + b x^n)^(p/q) dx = (q/(n b^s)) int u^(p+q-1) (u^q - a)^(s-1) du

which is a polynomial in u when s >= 1 -- what the rule expanded -- and a
rational function of u when s <= 0, which it read as "not a polynomial" and
declined. sqrt(1 + x^3)/x is (2/3) int u^2/(u^2 - 1) du; 1/(x sqrt(1 - x^3)) is
(2/3) int 1/(u^2 - 1) du. The rational integrator answers those, and the rule now
hands them to it.

The third case, through the reciprocal

Where s + p/q is whole instead, x = 1/y turns x^m (a + b x^n)^(p/q) dx into
-y^m' (b + a y^n)^(p/q) dy with m' = -m - 2 - n p/q, a whole number, and
(m' + 1)/n = -(s + p/q), whole -- the second case in y, with a and b
exchanged, and y = 1/x put back afterwards. x^6 (3 + 4x^4)^(1/4) is
-9 int u^4/(u^4 - 4)^3 du that way, which is the Hermite reduction's (#1287) and
the binomial rule's. Chebyshev proved there is no fourth case, so a binomial
differential outside these two is declined for a reason.

A term of a top-level sum is asked at the top

(x^3 - 1)/(2 + x^3)^(1/3) is two binomial differentials, and was declined although
each term alone is answered. Linearity splits the integrand before anything else,
and every term it produced sat one level down -- where the five rules scoped to the
question asked (#1265, #1280) decline. A term of a top-level sum is strictly smaller
than the sum and is not a continuation of any rule's search, which is what the
scope was measured to stop; it is asked at the top now. Only from the top: one level
down the terms stay one level down, as before. sec(x)^3 + x is the same story with
the secant reduction.

A bare inverse function, by parts against 1

arctan(x sqrt(1 - x^2)) had no antiderivative. It is one step of parts against 1
-- x f(g) - int x g' f'(g) dx, with an algebraic remainder -- and that step was never
taken: the by-parts rule runs on a product, a single node is not one, and a linear
argument is the table's. The remainder is answered where the radical rules reach it,
which is three of Charlwood's and Bondarenko's ln(1/x^4 + x^4); the rest of that
family wants an Euler substitution the library does not have, and declines in about a
second, which a test pins. Asked, not volunteered, like the regrouping beside it.

Measured

Every answer differentiated back.

Rubi corpus, 463-problem sample, against #1287's branch it was cut from, both timed
on the same evening:

#1287       312/463, 0 wrong, 0 timeouts, 76 s
with this   325/463, 0 wrong, 0 timeouts, 80 s

Thirteen more and nothing lost: arctan(x sqrt(1 - x^2)), arctan(x sqrt(1 + x^2))
(Charlwood) and ln(1/x^4 + x^4) (Bondarenko) by parts against 1; and by the binomial
rule sqrt(1 + x^3)/x (Charlwood), 1/(x sqrt(1 - x^3)) and
sqrt(1 + x^8)/(x (1 + x^8)) (Bronstein), x^6 (3 + 4x^4)^(1/4) and
(x^3 - 1)/(2 + x^3)^(1/3) (Timofeev), and five of Welz's: (1 - x^3)^(1/3)/x,
(1 - x^3)^(2/3)/x, 1/(x (1 - x^2)^(1/3)), 1/(x (1 - x^2)^(2/3)),
1/(x (1 - x^3)^(1/3)). The sum of per-problem time over the sample is 75 s to 79 s,
which is the answers.

BinomialDifferentialTest.OutsideTheFirstCase had 1/(x (1 + x^3)^(1/3)) as a case
that may be declined; it is the second case with s = 0 and moved to the answered
theory, with the three that Chebyshev says have no antiderivative kept where they
were.

The five test suites are green.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…top-level sum asked at the top, and a bare inverse function by parts

`sqrt(1 + x^3)/x` had no antiderivative. `x^2 sqrt(1 + x^3)` and `x^5 sqrt(1 + x^3)`
did, by the same substitution, and the rule for it (#1275) stopped where Chebyshev's
first case does.

## The second case, with a rational function left over

Under `u = (a + b x^n)^(1/q)`, with `s = (m + 1)/n`:

    int x^m (a + b x^n)^(p/q) dx = (q/(n b^s)) int u^(p+q-1) (u^q - a)^(s-1) du

which is a polynomial in `u` when `s >= 1` -- what the rule expanded -- and a
**rational function** of `u` when `s <= 0`, which it read as "not a polynomial" and
declined. `sqrt(1 + x^3)/x` is `(2/3) int u^2/(u^2 - 1) du`; `1/(x sqrt(1 - x^3))` is
`(2/3) int 1/(u^2 - 1) du`. The rational integrator answers those, and the rule now
hands them to it.

## The third case, through the reciprocal

Where `s + p/q` is whole instead, `x = 1/y` turns `x^m (a + b x^n)^(p/q) dx` into
`-y^m' (b + a y^n)^(p/q) dy` with `m' = -m - 2 - n p/q`, a whole number, and
`(m' + 1)/n = -(s + p/q)`, whole -- the second case in `y`, with `a` and `b`
exchanged, and `y = 1/x` put back afterwards. `x^6 (3 + 4x^4)^(1/4)` is
`-9 int u^4/(u^4 - 4)^3 du` that way, which is the Hermite reduction's (#1287) and
the binomial rule's. Chebyshev proved there is no fourth case, so a binomial
differential outside these two is declined for a reason.

## A term of a top-level sum is asked at the top

`(x^3 - 1)/(2 + x^3)^(1/3)` is two binomial differentials, and was declined although
each term alone is answered. Linearity splits the integrand before anything else,
and every term it produced sat one level down -- where the five rules scoped to the
question asked (#1265, #1280) decline. A term of a top-level sum is strictly smaller
than the sum and is not a continuation of any rule's search, which is what the
scope was measured to stop; it is asked at the top now. Only from the top: one level
down the terms stay one level down, as before. `sec(x)^3 + x` is the same story with
the secant reduction.

## A bare inverse function, by parts against 1

`arctan(x sqrt(1 - x^2))` had no antiderivative. It is one step of parts against `1`
-- `x f(g) - int x g' f'(g) dx`, with an algebraic remainder -- and that step was never
taken: the by-parts rule runs on a product, a single node is not one, and a linear
argument is the table's. The remainder is answered where the radical rules reach it,
which is three of Charlwood's and Bondarenko's `ln(1/x^4 + x^4)`; the rest of that
family wants an Euler substitution the library does not have, and declines in about a
second, which a test pins. Asked, not volunteered, like the regrouping beside it.

## Measured

Every answer differentiated back.

Rubi corpus, 463-problem sample, against #1287's branch it was cut from, both timed
on the same evening:

    #1287       312/463, 0 wrong, 0 timeouts, 76 s
    with this   325/463, 0 wrong, 0 timeouts, 80 s

Thirteen more and nothing lost: `arctan(x sqrt(1 - x^2))`, `arctan(x sqrt(1 + x^2))`
(Charlwood) and `ln(1/x^4 + x^4)` (Bondarenko) by parts against 1; and by the binomial
rule `sqrt(1 + x^3)/x` (Charlwood), `1/(x sqrt(1 - x^3))` and
`sqrt(1 + x^8)/(x (1 + x^8))` (Bronstein), `x^6 (3 + 4x^4)^(1/4)` and
`(x^3 - 1)/(2 + x^3)^(1/3)` (Timofeev), and five of Welz's: `(1 - x^3)^(1/3)/x`,
`(1 - x^3)^(2/3)/x`, `1/(x (1 - x^2)^(1/3))`, `1/(x (1 - x^2)^(2/3))`,
`1/(x (1 - x^3)^(1/3))`. The sum of per-problem time over the sample is 75 s to 79 s,
which is the answers.

`BinomialDifferentialTest.OutsideTheFirstCase` had `1/(x (1 + x^3)^(1/3))` as a case
that may be declined; it is the second case with `s = 0` and moved to the answered
theory, with the three that Chebyshev says have no antiderivative kept where they
were.

The five test suites are green.

Part of #718.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit c89f291 into master Sep 11, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the binomial-differential-cases branch September 11, 2026 18:45
Rafael-SOWNet added a commit that referenced this pull request Sep 11, 2026
… root of a quadratic, rationalised and finished by the rational integrator (#1289)

`sqrt(2 - x - x^2)/x^2`, `1/((4 + x^2) sqrt(1 + 4x^2))` and `x sqrt(2 r x - x^2)` had no
antiderivative. The trigonometric substitution answers `x^m sqrt(a + b x^2)^k` and
nothing wider, and nothing at all read a rational function of `x` and one such root
-- which is also what the nested radicals of Bondarenko's suite become under
`u = sqrt(1 + x)`, and what by parts against an inverse function leaves behind.

## The three substitutions

For `Q = a x^2 + b x + c`:

    a > 0:   sqrt(Q) = t - sqrt(a) x     x = (t^2 - c)/(2 sqrt(a) t + b)
    c > 0:   sqrt(Q) = x t + sqrt(c)     x = (2 sqrt(c) t - b)/(a - t^2)
    c = 0:   sqrt(Q) = x t               x = b/(t^2 - a)

Each makes `x`, `sqrt(Q)` and `dx/dt` rational in `t`, so the integrand becomes a
rational function of `t`; whichever applies with its radical a rational number is
taken first, then a real one, then the generic case for a symbol. The rational
function goes to the rational integrator **directly** -- long division, the splits,
the Hermite reduction, the binomial rule -- and never back into the chain.

## Why this one is not the Euler rule that was abandoned

An earlier Euler rule (#1265) rewrote and handed on, and its cost was in two places:
a `Simplify` it ran before it could tell whether it applied, and the open search
below it once it had. This one decides by reading the tree -- every node holding `x`
is a sum, product, quotient, whole power, `x` itself or the one root -- and declines
in microseconds on anything else; and it lands on a closed path. Three things were
measured on the way to that:

- **Placed before the general substitution** it answered that rule's sub-integrals and
  let a doomed search run: `ln(x^2 + sqrt(1 - x^2))` went from a 19 ms decline to
  thirty seconds. It sits after the trigonometric and binomial rules, late.
- **Scoped to the question asked** it declined nine integrands that reach it one level
  down -- the nested radicals, the by-parts remainders -- each closed here. It is not
  scoped, and the corpus says that costs nothing: no timeouts, no losses.
- **Bounded at degree eight** in `t`. At nine the splits' factorisation is five
  seconds per attempt with nothing to show, which is what the same `ln(x^2 + sqrt(1 - x^2))`
  cost at the late position; Timofeev's `(1 + x^4)/((1 + x + x^2) sqrt(2 + x + x^2))`
  is a degree-nine case and is the one answer the bound gives up.

## Two defects it exposed, both fixed

`1/(1 + sqrt(1 - x^2))` **threw**: the rewrite left a factor that collapses to the
constant `-2`, a rational reader divided by its zero leading coefficient and read a
NaN, and `Rational.Create` on a NaN throws. Each side of the rational function is
now rebuilt from its coefficients -- the denominator factor by factor, since with
`sqrt(c)` irrational only the split over written factors reads it -- and the
biquadratic split declines a coefficient that is not finite rather than throwing on it.

`1/((1 + x)^2 sqrt(2) sqrt(x^2 - i))` **answered `NaN`**: `-i` is a number and not a
real one, and the rule took it for a symbol. A coefficient that is a number has to be
real, and an answer holding a NaN is declined -- not answering is legitimate,
answering NaN is not.

The cancellation of common factors, shared with the trigonometric-argument rewrite,
now folds nested whole powers, so `((2t + 1)^2)^2` against `(2t + 1)^4` is one factor;
a substitution that squares what it built leaves the first, and a degree of twelve
that was really eight was being declined.

## Measured

Every answer differentiated back, with parameters pinned.

Rubi corpus, 463-problem sample, against #1288's branch it was cut from, both timed
on the same evening:

    #1288       325/463, 0 wrong, 0 timeouts, 80 s
    with this   334/463, 0 wrong, 0 timeouts, 90 s

Nine more and nothing lost: `sqrt(2 - x - x^2)/x^2` (Apostol), `1/((4 + x^2) sqrt(1 + 4x^2))`
and `x sqrt(2 r x - x^2)` (Timofeev), `sqrt(x + sqrt(1 + x))/x^2` and
`tanh(x)/sqrt(e^x + e^(2x))` (Bondarenko), and Charlwood's `tan(x)/sqrt(1 + tan(x)^4)`,
`sqrt(1 + tan(x)^4) tan(x)`, `atan(x)/(x^2 sqrt(1 - x^2))` and `x atan(x)/sqrt(1 - x^2)`.
Welz's `sqrt(x^2 - 1)/(x - i)^2` now answers and is complex at every real sample
point, which the harness reports as unverifiable. The sum of per-problem time over
the sample is 79 s to 88 s: three seconds of it is Apostol's answer, whose
coefficients are unfolded sums of `sqrt(2)` terms that every later simplification
pays for, and four is a decline that reaches the degree bound only after by parts.

The five test suites are green.

Part of #718.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet added a commit that referenced this pull request Sep 11, 2026
…sign of its base from the radicals (#1290)

`e^(x/2)/sqrt(e^x - 1)` had no antiderivative. It is `2/sqrt(u^2 - 1)` under
`u = e^(x/2)`, and the exponential substitution refused the half: a slope had to be a
whole number. The base is now `e^(k x)` with `k` the greatest common divisor of the
slopes as rationals -- numerators' gcd over denominators' lcm -- so every exponential
in the integrand is a whole power of it, and `e^(x/2)` beside `e^x` is `u` beside
`u^2`.

The sign of `k` is chosen for the radicals. `sqrt(1 + e^(-x))/sinh(x)` under `u = e^x`
is a root of `1 + 1/u`, a quotient, which nothing rationalises; under `u = e^(-x)` it is
`sqrt(1 + u)`, a root of something linear, which the linear-radical substitution
answers. So where every exponential under a root has a negative slope the base is
`e^(-k x)`; `u` is positive either way, being an exponential, and nothing about the
substitution changes but the spelling of what comes out.

## Measured

Every answer differentiated back.

Rubi corpus, 463-problem sample, against the master it was cut from (#1288), timed on
the same evening:

    master      325/463, 0 wrong, 0 timeouts, 80 s
    with this   328/463, 0 wrong, 0 timeouts, 81 s

Three more, nothing lost: Timofeev's `e^(x/2)/sqrt(e^x - 1)`, and Bondarenko's
`sqrt(1 + e^(-x))/(e^x - e^(-x))` and `sqrt(1 + e^(-x))/sinh(x)`. `sqrt(1 + tanh(4x))`,
the fourth of that family, becomes `sqrt(2u^2/(u^2 + 1))` and wants `sqrt(u^2) = u`
for a `u` the rule knows to be positive; that is a rewrite this rule could make and
the simplifier rightly will not, and it is not here yet.

The five test suites are green.

Part of #718.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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