Repository navigation
A definite integral with a parameter takes the limit at an infinite bound - #2462
Merged
Merged
Conversation
…nity inside the value A definite integral to an infinite bound substituted the bound into the antiderivative, and with a parameter beside it the infinity stayed inside a function: erf(+oo - y), since y could itself be infinite. The limit at the bound is now taken there, reading the parameter as the finite value an integral with a parameter is a function of: e^(-(t - y)^2) over the line is sqrt(pi), and 1/(1 + (t - y)^2) is pi. It is taken only where the antiderivative was read to be continuous across the range, numeric bounds with no break listed or all breaks listed, so that 1/(t^2 + y^2)'s logarithm for y^2 < 0, whose zeros move with y, is not answered with its principal value. A limit that is undecided, undefined, or still holds an infinity (e^(-y t), which depends on the sign of y) keeps the substituted value as before. Part of #2451 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2462 +/- ##
==========================================
+ Coverage 86.98% 87.00% +0.01%
==========================================
Files 320 320
Lines 71174 71194 +20
Branches 20759 20769 +10
==========================================
+ Hits 61914 61940 +26
+ Misses 4970 4964 -6
Partials 4290 4290
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
A definite integral evaluated its antiderivative at an infinite bound by substitution, and took a limit only where substituting gave
NaN. With a parameter, substitution leaves an infinity inside a function (erf(+oo - y)), so the answer was left unfinished.AtAnInfiniteBoundnow also takes the one-sided limit there, from the left at+ooand the right at-oo, through the existing cached, budgetedLimitAtTheBound. The parameter is read as finite, since the integral is a function of the finite parameter.The substituted value is kept exactly as before where the limit is undecided, is
NaN, still holds an infinity (how the library says the answer depends on the parameter's sign, as fore^(+oo * -y)), or where the antiderivative holds an incomplete gamma; and the limit is taken only where the antiderivative has been read as continuous across the range.∫ e^(-(t-y)^2), -oo..+oosqrt(pi)*(erf(+oo-y)-erf(-oo-y))/2sqrt(pi)∫ e^(-(t-y)^2), 0..+oosqrt(pi)*(erf(+oo-y)-erf(-y))/2sqrt(pi)*(1/2 + -1/2*erf(-y))∫ 1/(1+(t-y)^2), -oo..+ooarctan((+oo-2y)/2)-arctan((-2y-+oo)/2)pi∫ 1/(1+(t-y)^2), 0..+oo+ooinsidearctanpi/2 - arctan(-y)∫ t e^(-(t-y)^2)/t^2 e^(-(t-y)^2), over Rsqrt(pi)*y/sqrt(pi)*(1/2+y^2)∫ e^(-(t-y)^2/2)/e^(-t^2-2yt), over Rerfat ±oosqrt(2pi)/sqrt(pi)*e^(y^2)Every new answer agrees with mpmath quadrature to 40 digits at y = −2.3, −0.7, 0, 0.4, 1.9 (worst relative error 1.7e-41), the half-line answers differentiate back in
ytoe^(-y^2)and1/(1+y^2), and each is smaller than what it replaces.Declined, unchanged:
∫ e^(-y t), 0..+oo(depends on the sign ofy),∫ 1/(t-y)^2, 0..+oo(a pole that cannot be placed),∫ 1/(t^2+y^2), -oo..+oo(they^2 < 0branch would give only a principal value), and a symbolic bound.For complex
y: the Gaussian answer holds for every complexy.∫ 1/(1+(t-y)^2)over R ispionly for |Im y| < 1, and 0 beyond; master already answerspifor every concrete suchy, which is #2460 (a branch cut crossed through a complex shift, also off by π on finite ranges), so this inherits that rather than adding to it. Found on the way, and also pre-existing: #2461.ImproperIntegralTest:Issue2451_*, 15 rows; the 10 that assert an answer fail on master. Calculus|Limit|Integra: 7129 passed, 10 failed → 7139 passed, 0 failed. limitcheck summary identical on master and the branch.Full check on this commit before the rebase onto e5f544f (clean): 19,983 unit tests, 0 failed; MCP 441, Terminal 69, F# 134, Interactive 19; AOT 78/78; BoundCheck 0 disagreements, RootCheck 596/596, CasBench 120/121 with 0 wrong, SimpSweep 10463/10463, RuleCheck clean, CanonCheck and Confluence at their baselines.
Closes #2451.
🤖 Generated with Claude Code