Repository navigation
An antiderivative built through an even root says where the root is real - #1431
Merged
Merged
Conversation
The linear-radical substitution u = (a x + b)^(1/q) and the general substitution for an even root both take a power of u out of a radical on the strength of u being a non-negative real, which it is only where the radical is. Beyond the radicand's zero u is imaginary and the integrand can still be real: Rubi's x sqrt(c - a c x)/e^(3 atanh(a x)) above a x = 1 is the product of two imaginary factors, and the answer built for a real u was 14% off its derivative there and shipped as an answer (family 7, one wrong after #1430 made the row reachable). An answer that used the step now carries provided a x + b >= 0: NaN beyond it, which is no claim, and unchanged where it holds. An answer the step did not touch is as it was. #718 Co-Authored-By: Claude Opus 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.
Found by the Rubi family-7 run on #1430's merge commit:
x*sqrt(c-a*c*x)/e^(3*atanh(a*x))(7.3.6) came back wrong — d/dx 14% off the integrand atx = 0.59,a = 3.1,c = 0.7. Not a defect of the new rule:e^(3 atanh(a x))now folds to(2/(1 - a x) - 1)^(3/2)(exact), which made the row reachable for the linear-radical substitutionu = sqrt(c - a c x), and that route was already wrong on the same shape (sqrt(c-a*c*x)*(2/(1-a*x)-1)^(-3/2)on master, WRONG 2/6).The cause. For an even
qthe substitution takes a power ofuout of the radicals —(2c/u^2 - 1)^(-3/2)asu^3/(2c - u^2)^(3/2)— on the strength ofubeing a non-negative real (FactorANonnegativeVariableOutOfRadicals), which it is only where the radical is real. Abovea x = 1the root is imaginary, the identity does not hold, and the integrand is still real there:sqrt(negative) · (negative)^(-3/2)isi · i · (…). So the answer built for a realuis not the antiderivative on that region, and nothing said so. The general substitution's even-root branch (SolveBySubstitution, "an even root is not negative") made the same assumption.The fix. An answer that used the step carries the condition it used:
provided a x + b >= 0(the linear-radical route, unless the caller knowsunon-negative, asu = e^(k x)is),provided radicand >= 0(the general route). Beyond it the answer isNaN— no claim — and inside it is unchanged. An answer the step did not touch (x/sqrt(1 + x),1/(sqrt(x) - x^(-1/3))) is as it was.1/sqrt(x + x^(3/2))now reads2 * sqrt(1 + sqrt(x)) / (1/2) + C provided x >= 0.LinearRadicalSubstitutionIntegralTest.TheEvenRootStepSaysWhereItHoldspins both: the condition on the answer, the derivative matching inside it at three points, the integrand real atx = 0.59and the answer's derivativeNaNthere. Full suite 12007 passed, 0 failed. BREAKING-CHANGES.md entry measured on a v2.5.0 build (both rows were unevaluated there).The harness side is in the workspace:
intbenchnow skips a sample point where a condition the answer states (anywhere in its tree, sinceCis added outside theprovided) is decidedly False, instead of stripping the condition and comparing — an answer claims nothing there. On that harness: 1774 suite 1706/1774, 0 wrong, 0 timeout (unchanged), family 7 153/270, 0 wrong (152 with the wrong row before), family 6 315/417, 0 wrong (unchanged).Part of #718.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura