Repository navigation
A linear over a quadratic beside the root of another, in closed form - #1583
Merged
Merged
Conversation
(g + h x)/(A sqrt(B)) with two different quadratics was declined wherever a coefficient was a symbol: the rational function beside a root was taken apart over linears only, and Euler's substitution leaves a quartic in a field the rational integrator does not stay in. For L = lambda + mu x, u = L/sqrt(B) turns N/(A sqrt(B)) into 2 rho/(alpha + beta u^2) where alpha B + beta L^2 = rho A, and that holds for the two roots of E lambda^2 - 2 P lambda mu + F mu^2 = 0, P = A2 B0 - A0 B2, E = A2 B1 - A1 B2, F = A1 B0 - A0 B1. Their two numerators span every linear, so the answer is two arctangents of a linear over the root with sqrt(P^2 - E F) in their coefficients, Rubi's q for 1.2.1.6, and a hyperbolic arctangent where the ratio under a piece's root is a negative number. The rational function beside the root is taken apart over a quadratic, a power of a linear and a power of the radicand as well, and each piece is closed: over a power of a linear by its reciprocal, over a power of the radicand as one half-odd power. Powers of linears only beside a quadratic: over squared linears alone the reciprocal writes a sign of each, sgn(sqrt(1 + x) - 1) under u = sqrt(1 + x), whose derivative is not read, and Euler's substitution answers those without one. Measured with work/intbench against a8a2b7e, 3 s a problem: Rubi's 1.2.1.6, 4.3.9 and 4.4.9 in full, 66 -> 201 of 217 solved, none lost and none wrong, every gain made by this alone; and 12 more gained over the families sample (912 problems) and family 0 (1814), none lost. Part of #718. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:
(g + h x)/(A sqrt(B))with two different quadratics, in closed form with symbolic coefficients, which is Rubi's 1.2.1.6 and what its 4.3.9 and 4.4.9 become under the tangent.1/sqrt(a + b tan(x) + c tan(x)^2)is1/((1 + t^2) sqrt(a + b t + c t^2))under the tangent, and that was where it stopped. The rational function beside a root was taken apart over linears only. Euler's substitution leaves a quartic in a field the rational integrator does not stay in. The rotation of the tangent (#1475) needs its rotationmto be a number, and witha,b,csymbolsmis a nested surd.The closed form. For a linear
L = lambda + mu x,u = L/sqrt(B)hasdu = N dx/(2 B^(3/2))withN = (2 mu B0 - lambda B1) + (mu B1 - 2 lambda B2) x, andalpha + beta u^2 = (alpha B + beta L^2)/B. So whereveralpha B + beta L^2 = rho A,N dx/(A sqrt(B))is2 rho du/(alpha + beta u^2). The three equations foralpha,beta,rhohave a solution where their determinant vanishes. That is a quadratic inlambda : mu,E lambda^2 - 2 P lambda mu + F mu^2 = 0, withP = A2 B0 - A0 B2,E = A2 B1 - A1 B2andF = A1 B0 - A0 B1. Its two roots give two numerators, independent unlessq = sqrt(P^2 - E F)is zero orBis a square, andg + h xis a sum of them. The answer is two arctangents of a linear oversqrt(B), whose coefficients holdq, Rubi'sqfor this shape. Each piece is written2 rho arctan(k u)/(alpha k)withk = sqrt(beta/alpha), whose derivative is right on either branch of the root, sincealpha k^2 = betaexactly. Wherebeta/alphais a negative number, it is written as the hyperbolic arctangent it is.Taken apart into it.
SolveARationalFunctionBesideTheRootOfAQuadraticsplit over distinct linears only. It now also splits over a quadratic below the bar, a power of a linear, and a power of the radicand, and closes each piece without asking the chain:The polynomial part still goes to the chain as before, after the other pieces have closed. So a piece that does not close declines the whole before any search is asked for.
Powers of linears are taken only beside a quadratic. Over squared linears alone, the reciprocal writes a sign of each linear:
sgn(sqrt(1 + x) - 1), oncesqrt(x + sqrt(1 + x))/x^2is taken back fromu = sqrt(1 + x). That sign's derivative is not read where the argument is not shown real, and Euler's substitution, after this rule, answers those without one (EulerSubstitutionTest.ReachedOneLevelDownpins it).One existing test changes.
MixedTrigonometricArgumentsTest.ASymbolicQuadraticInTheTangentIsDeclinedAndNotSearchedpinned a quick decline for1/sqrt(a + b tan(x) + c tan(x)^2), since the rotation of #1475 takes only a numeric rotation. The integrand is answered now, and the test says so as...IsAnsweredAndNotSearched, still bounded byIntegrationDecline.Guard.1/sqrt(a + b*tan(x) + c*tan(x)^2)integral(...)tan(x)over the root(g + h*x)/((d + k*x + f*x^2)*sqrt(a + b*x + c*x^2))integral(...)cot(x)^3/(a + b*tan(x) + c*tan(x)^2)^(3/2)integral(...)(2 + x)/((2 + 4*x - 3*x^2)*(1 + 3*x + 2*x^2)^(3/2))integral(...); master runs past 20 s1/((x^2 + 1)*sqrt(x^2 + x + 1))integral(...)QuadraticBesideARootIntegralTestdifferentiates thirteen such integrands back with the symbols pinned; master answers none of the thirteen.Measured with
work/intbenchagainst master ata8a2b7e7, the commit this is cut from, 3 s a problem, on a build with the other five branches of this batch merged beside it. Every moved problem was then re-run on this branch alone:sqrt(2 + 2 tan(x) + tan(x)^2)(Charlwood's 29), four of 1.2.1.6, four of 4.3.9 and three of 4.4.9. None of the moves is a loss of this branch's.The unit tests pass on the merged build (net10.0, 13,514), every target builds, and the allocation gate passes.
🤖 Generated with Claude Code