The special functions integrate by parts - #1631
Merged
Merged
Conversation
None of the nine special functions was a factor integration by parts would differentiate, so a power of x beside one had no route: x erf(b x), x^2 Ei(b x) and x Si(b x) were all left unevaluated, and so were Ei, li, Si, Ci, Shi and Chi of a linear argument on their own. Each has an elementary derivative, which is what puts the logarithm and the inverse trigonometric functions first in LIATE, and they stand beside them now: against a power of x the function is differentiated, and what is left is the power times e^(-u^2), e^u/u, sin(u)/u and the like, which the rules answer. Alone, each is integrated against 1, as erf already was: int Ei(u) = u Ei(u) - e^u, int li(u) = u li(u) - Ei(2 ln u), int Si(u) = u Si(u) + cos(u), int Ci(u) = u Ci(u) - sin(u), int Shi(u) = u Shi(u) - cosh(u) and int Chi(u) = u Chi(u) - sinh(u), each over the rate. After Si or Ci the remainder x^m sin(b x) needs parts again, and with more nodes than x^m Si(b x) and no factor left to differentiate, the measure that bounds the descent declined it. Against a polynomial the next steps descend on its degree, so parts are allowed on that remainder there. Allowed against anything, they took erf(b x)^2 from a decline in a third of a second to a timeout. Rubi's family 8, whose statable files are #1501's tranche: 8.1 from 9 to 105 of 177, 8.3 from 2 to 34 of 47, 8.4 from 0 to 44 of 98 and 8.5 from 18 to 75 of 98, 29 to 258 of 420 in all, with 0 wrong and 0 timeouts on master (371b38e) and here. Families 0 to 7, side by side with master: family 0 is 1753 of 1814 on both, row for row, and the families sample goes from 810 to 811 of 912, 0 wrong on both. The move is 3.1.5:213, (a + b ln(c x^n))/(x^2 (d + e ln(f x^m))), which master declines in 5.0 s alone and this answers in 0.9 s. SpecialFunctionsByPartsTest has 24 rows from Rubi's 8.1, 8.3, 8.4 and 8.5, each differentiated back with its parameters pinned. Part of #1501. 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.
None of the nine special functions was a factor that integration by parts would differentiate, so a power of
xbeside one had no route.x erf(b x),x^2 Ei(b x)andx Si(b x)were all left unevaluated. So wereEi,li,Si,Ci,ShiandChiof a linear argument on their own.x, the function is differentiated. Each has an elementary derivative, which is why the logarithm and the inverse trigonometric functions come first in LIATE, and these functions now stand beside them. What is left is the power timese^(-u^2),e^u/u,sin(u)/uand the like, which the rules answer.erfalready was. Withulinear and each divided by the rate:int Ei(u) = u Ei(u) - e^uint li(u) = u li(u) - Ei(2 ln u)int Si(u) = u Si(u) + cos(u)int Ci(u) = u Ci(u) - sin(u)int Shi(u) = u Shi(u) - cosh(u)int Chi(u) = u Chi(u) - sinh(u)SiandCi. Their remainder,x^m sin(b x), needs parts again. It has more nodes thanx^m Si(b x)and no factor left to differentiate, so the measure that bounds the descent declined it. Against a polynomial, the next steps descend on its degree, so parts are allowed on that remainder there. Allowed against anything, they tookerf(b x)^2from a decline in a third of a second to a timeout.What is still out of reach in family 8: the squares
F(a + b x)^2, ande^(c - b^2 x^2) erf(b x)^n, need a derivative-divides rule,int F'(u) F(u)^n = F(u)^(n+1)/(n+1), which is the next PR.F(d (a + b ln(c x^n)))beside a power needs a substitution.Measured
(a + b ln(c x^n))/(x^2 (d + e ln(f x^m))): run alone, master declines it in 5.0 s and this branch answers it in 0.9 s.SpecialFunctionsByPartsTesthas 24 rows from Rubi's 8.1, 8.3, 8.4 and 8.5. Each is differentiated back with its parameters pinned.BREAKING-CHANGES.mddiffers). Allocation matches the baseline on all 19 gated benchmarks.Part of #1501.
🤖 Generated with Claude Code