Repository navigation
A product of powers of quotients of linears is written over each linear once - #1683
Merged
Merged
Conversation
…ar once `e^atanh(a x) sqrt(c - c/(a x))` is `sqrt((1 + a x)/(1 - a x)) sqrt(c (a x - 1)/(a x))`, and the root `1/a` stands in both, with exponents `-1/2` and `1/2`. The substitution search did not finish on it. Written over each linear once it is `K sqrt(a x + 1)/sqrt(x)`, and `K` -- the integrand over that product -- has a zero logarithmic derivative, so it is constant wherever it is defined and stands in front of the answer, as Rubi writes `x^p (c + d/x)^p/(1 + c x/d)^p` in front of its. `SolveByWritingEachLinearOnce` reads the integrand through products, quotients, powers and the exponential of a multiple of a logarithm into linears whose roots are rational in the symbols, sums each root's exponents, and fires where a root stands in two bases under powers that are not whole, or in a root of a quotient with x below the bar and another base, and at most two linears are left under such powers. Each linear takes the sign that is positive on an interval where the integrand is real, so that the product is real there; each such sign is an arm saying where it holds, found with the other symbols pinned to either sign, and an arm for negative x is integrated in `t = -x`, where the power of the variable is one the rules read. The product is asked as a quotient, and without this rule. Every arm or none. With every power whole, a root of a quotient shared with another base is enough -- `e^(2 acoth(a x))/(c - c/(a^2 x^2))^2` is `K x^4/((a x + 1)(a x - 1)^3)`, which the partial fractions answer at once -- and `K` is a constant, with one arm and no condition. First in the chain, at the question asked: the polynomial term writes `1/u` as `u^(-1)` and asks that a level down. Two tests pinned the conditioned answers the linear-radical step gives for integrands this rule now answers on both sides; they assert that instead, and the step's condition stays pinned on `1/sqrt(x + x^(3/2))`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #718.
Rubi 7.3.6 and 7.4.2 have about two hundred problems of one shape that the integrator ran out of time on: an exponential of
atanh(a x)oracoth(a x)beside a power ofc ± c/(a x)orc ± c/(a^2 x^2). For example,The linear
1 - a xstands in both radicals, once as1 - a xand once asa x - 1, with exponents-1/2and1/2. The substitution search took one radical at a time and didn't finish. Rubi's rules write the integrand over each linear once, with a factor in front:That factor is constant wherever it is defined. This PR does the same in a new rule,
SolveByWritingEachLinearOnce.What it does
e^(1/2 ln q)counts asq^(1/2), which is how the inverse hyperbolic functions arrive.K (a x + 1)^(1/2) x^(-1/2), which the rule for two linear radicals answers in milliseconds.Kis the integrand over that product. Its logarithmic derivative is zero, because both sides have the samesum e_i/(x - r_i). SoKis constant wherever it is defined, and it stands in front of the answer.Where the answer holds. The product is real only where its linears have the signs they are written with. Each linear therefore takes the sign that is positive on an interval where the integrand is real, and
Ktakes the imaginary unit the other sign would leave. Each such choice is an arm of a piecewise answer. Its condition is that every linear under a power that is not whole is>= 0. The arm holds there whatever the symbols are.c > 0,e^atanh(a x) sqrt(c - c/(a x))is real between-1/aand 0. Forc < 0it is real between 0 and1/a.xis integrated int = -x, because the rules readt^(1/2)and not(-x)^(1/2).Where it fires. A root has to stand in two bases under powers that are not whole, or in a root of a quotient with
xbelow the bar and in another base. At most two linears may be left under powers that are not whole. A root beside a whole power of one of its own linears is left to the rules that read it as written, such assqrt(x)/(x (x + 1)), or(1 - a^2 x^2)^(3/2)/((1 - a x)^2 (c + d x)), which a rule writes over the radicand. With every power whole, a shared root of a quotient is enough.e^(2 acoth(a x))/(c - c/(a^2 x^2))^2isK x^4/((a x + 1)(a x - 1)^3), which the partial fractions answer at once, and thereKis a plain constant.Why it is first in the chain. The rule answers the question asked only. The polynomial term rewrites
1/uasu^(-1)and asks that a level down, so1/(e^atanh(a x) (c - c/(a x))^(3/2))never reached the rule when it came later.Tests
EachLinearWrittenOnceIntegralTestchecks nineteen integrands, among them both signs ofc. Each answer's derivative is compared with the integrand on both sides of every root, wherever the integrand is real.LinearRadicalSubstitutionIntegralTestpinned the conditioned answers that the linear-radical step gives for two integrands this rule now answers on both sides of the root. They now assert that.1/sqrt(x + x^(3/2)).Measured on the Rubi corpus against master
bc6c190c, with both builds side by side:375 problems moved, all but four in family 7, and I re-ran each alone on both builds. This branch answers 361 of them, with none wrong and 14 past the budget. Master answers 7, with 8 wrong and 196 past the budget. The 8 are #1664's
e^atanh(x)beside a half-integer power of1 - x, which #1669 has since fixed on master another way, and which this rule answers too.The 5 still wrong in family 7 are #1665's, fixed on master by #1682 after this branch's base.
The suite passes, 14,322 tests on a fresh build, and so does the allocation gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura