Skip to content

A constant comes out of a fractional power beside another power of the same function - #1481

Open
Rafael-SOWNet wants to merge 1 commit into
masterfrom
distribute-a-constant
Open

Rafael-SOWNet wants to merge 1 commit into
masterfrom
distribute-a-constant

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

sqrt(b sec(x))/sec(x)^(7/2) was left as written. The two powers of the secant are the same function to a total power of -3, which the rules for a power of a secant answer — and they cannot see it while one of them is written over b sec(x) rather than over sec(x).

(c f)^b is c^b f^b for a positive real c and any f: both sides pick up the same phase where f is negative, so the rewrite needs nothing assumed about f, and a symbolic c gives the answer provided c > 0.

That condition is not decoration. 2.5.0 answered sec(x)^(3/2)/(b sec(x))^(5/2) without it, and that answer is wrong wherever b and the secant are both negative — at b = -3 its derivative is +0.0267i against the integrand's -0.0267i at x = 2, while the two agree at x = 0.5. #1388 withdrew the unconditional reading for exactly that reason, and this brings the shape back with the condition it owes.

Two restrictions keep the rewrite from costing anything elsewhere:

  • A single factor. The constant comes out only where the rest of the base is one factor, which is where it pays: the power it leaves can then meet another power of the same function beside it. Over a product it would rewrite the question into one no easier and pay a whole descent to find out — (cos(x)^11 sin(x)^13)^(-1/4) measured at ten seconds against forty-seven.
  • Not an even power. (a sin(x)^2)^(5/2) is a^(5/2) sgn(sin x) sin(x)^5 for any real a, since an even power is never negative, and the rule that takes a function out of its even power with its sign says so unconditionally. Taking the constant out there would answer the same shape provided a > 0 and lose the negative half of the line by getting there first. The evenness is read through the nesting and past the sign, because below the tangent substitution the factor arrives as (u^2)^(-1).

Measured

before after
Rubi family 4 290/422 309/422, no row lost, 30 timeouts against 32
Rubi corpus (1774) 1707, 0 wrong, 0 error, 0 timeout 1707, 0 wrong, 0 error, 0 timeout
Rubi family 1 158/228 158/228
suite 12,644 passed, 0 failed, 14 skipped
allocation gate PASSED on all 19 gated benchmarks

Four tests added, and BREAKING-CHANGES.md records both changed answers with their 2.5.0 values.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…e same function

`sqrt(b sec(x))/sec(x)^(7/2)` was left as written. The two powers of the secant are the
same function to a total power of -3, which the rules for a power of a secant answer, and
they cannot see it while one of the two is written over `b sec(x)` rather than over
`sec(x)`.

`(c f)^b` is `c^b f^b` for a positive real `c` and any `f` -- both sides pick up the same
phase where `f` is negative, so nothing need be assumed about `f`, and a symbolic `c` gives
the answer `provided c > 0`. That condition is not decoration: 2.5.0 answered
`sec(x)^(3/2)/(b sec(x))^(5/2)` without it, and its answer is wrong wherever `b` and the
secant are both negative -- at `b = -3` its derivative is `+0.0267i` against the
integrand's `-0.0267i` at `x = 2`, the two agreeing at `x = 0.5`. PR #1388 withdrew the
unconditional reading for that reason; this brings the shape back with the condition it
owes.

Two restrictions keep the rewrite from costing anything elsewhere. The constant comes out
only where the rest of the base is a *single* factor, which is where it pays, the power it
leaves being free to meet another power of the same function beside it; over a product it
would rewrite the question into one no easier and pay a whole descent to find out, which
`(cos(x)^11 sin(x)^13)^(-1/4)` measured at ten seconds against forty-seven. And an even
whole power of a function is left to the rule that takes the function out of it with its
sign, which answers `(a sin(x)^2)^(5/2)` for any real `a` -- read through the nesting and
past the sign, since below the tangent substitution the factor arrives as `(u^2)^(-1)`.

Rubi's family 4 goes from 290 to 309 of 422, no row lost and two fewer timeouts; the
corpus stays at 1707 of 1774 with no wrong answer, no error and no timeout.

Part of #718.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

This branch has not been deployed

No deployments
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