A special function of a logarithm of a monomial is integrated, through Ei of a complex argument - #1645
Merged
Conversation
Member
Author
|
On hold, and back to draft: |
…h Ei of a complex argument (e x)^m Si(d (a + b ln(c x^n))) is by parts against (e x)^m, and what is left is a power of x times sin(d (a + b ln(c x^n)))/(a + b ln(c x^n)). Two rules were missing on the way, and both are here. A power of x times a function of one logarithm of a monomial, x^m G(ln(c x^n)), is integrated under t = ln(c x^n). dx is x dt/n, and x^(m + 1) is K e^((m + 1) t/n), where K = x^(m + 1) (c x^n)^(-(m + 1)/n) has derivative 0 wherever it is defined. So the answer is K/n times the integral of e^((m + 1) t/n) G(t) at t = ln(c x^n), an antiderivative wherever the integrand is real. For an even n that includes negative x, where ln(c x^n) is not ln(c) + n ln(x) and an answer through ln(x) would be off by a branch. A power of a monomial, (e x)^m, is x^m times a factor of the same kind. Rubi's answers to 8.3 to 8.5 are written in this K. And an exponential times sines and cosines of linears over linears: each sine and cosine is written as exponentials, the product multiplied out, and every term is an exponential with a complex rate over the linears, which the exponential rules answer with Ei of a complex argument. e^(2x) sin(x)/x is (Ei((2 + i) x) - Ei((2 - i) x))/(2i), two conjugate terms whose sum is real. Only with an exponential beside the sine or cosine: sin(x)/x alone stays Si(x). The evaluator reads Ei, Si and erf off the real line already, so these answers are checked like any other. Measured on the Rubi corpus, master at 9efc486 and this change on it, run side by side: family 8 394 -> 409 of 420, all fifteen of F(d (a + b ln(c x^n))): Ei, Shi and Chi beside (e x)^m, and Si and Ci alone, beside x, x^2 and (e x)^m, and over x^2 and x^3. Family 4 at ten a file 611 -> 612, the one being cos(a + b ln(c x^n))^2. Family 2 is 544 of 650 on both, family 3 at twenty a file 173 of 180, the independent suites 1756 of 1814, and families 1, 5, 6 and 7 at five a file 439 of 499. 0 wrong everywhere. Run alone, the sixteen are 0 of 16 on master and 16 of 16 here. The unit tests pass, 14,272. The unit tests pass, 14,273, with the GC heap held to 4 GB, and the performance gate passes on 49f87185, which is this change on 9efc486 but for K written as 1 where the logarithm is ln(x): allocation is what the baseline says on all 19 gated benchmarks. ExponentialIntegralIntegrationTest has three rows of an exponential beside a sine or cosine over a linear, and four of a function of a logarithm of a monomial, checked at negative x as well with n = 2. Part of #1501. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SolveByAPowerAndALogarithmOfAMonomial built its integrand in t as a product: for (d x)^m x/ln(b x) that is e^((m + 2) t) t^(-1), which the exponential integral rules do not read, and which runs away in integration by parts on master (#1646). Built with SingleQuotient.Combine, as the logarithm substitution builds its own, (d x)^m x/ln(b x) is K Ei((m + 2) ln(b x)) in 0.3 s, and (d x)^m li(b x), Rubi's 8.3 row 269, is answered in 0.8 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rafael-SOWNet
force-pushed
the
an-exponential-times-a-sine-over-a-linear
branch
from
October 1, 2026 11:15
6a4b09c to
7717217
Compare
Rafael-SOWNet
marked this pull request as ready for review
October 1, 2026 11:15
Member
Author
|
Ready again. The integral in |
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.
(e x)^m Si(d (a + b ln(c x^n)))is by parts against(e x)^m, and what is left is a power ofxtimessin(d (a + b ln(c x^n)))/(a + b ln(c x^n)). Two rules were missing on the way, and both are here.x^m G(ln(c x^n))is integrated undert = ln(c x^n).dxisx dt/n, andx^(m + 1)isK e^((m + 1) t/n)withK = x^(m + 1) (c x^n)^(-(m + 1)/n), whose derivative is 0 wherever it is defined. So the answer isK/ntimes the integral ofe^((m + 1) t/n) G(t)att = ln(c x^n). That is an antiderivative wherever the integrand is real. For an evennthat includes negativex, whereln(c x^n)is notln(c) + n ln(x)and an answer throughln(x)would be off by a branch. A power of a monomial,(e x)^m, isx^mtimes a factor of the same kind. Rubi's answers to 8.3–8.5 are written in thisK. The integral intis asked as one quotient, as the logarithm substitution asks its own: as a product,(d x)^m x/ln(b x)handed overe^((m + 2) t) t^(-1), which ran away in integration by parts (Integrating e^(2x) x^(-1) runs out of memory: integration by parts reads x^(-1) as a polynomial #1646, fixed by A negative power of the variable is not a polynomial to integration by parts #1647). As a quotient it isEi((m + 2) t)at once, and(d x)^m li(b x)is answered too, since by parts leaves(d x)^m x/ln(b x)of it.Eiof a complex argument.e^(2x) sin(x)/xis(Ei((2 + i) x) - Ei((2 - i) x))/(2i), two conjugate terms whose sum is real. This applies only with an exponential beside the sine or cosine:sin(x)/xalone staysSi(x).The evaluator already reads
Ei,Sianderfoff the real line, so these answers are checked like any other.Ei(1 + 2i)evaluates to1.0421677… + 3.7015014… i.Measured
"e^(2*x)*sin(x)/x".Integrate("x")integral(e ^ (2 * x) * sin(x) / x, x)(-1/2 * i) * Ei((2 + i) * x) + 1/2 * i * Ei((2 - i) * x) + C"x*sin(ln(x))/ln(x)".Integrate("x")integral(x * sin(ln(x)) / ln(x), x)(-1/2 * i) * Ei((2 + i) * ln(x)) + 1/2 * i * Ei((2 - i) * ln(x)) + C"cos(a+b*ln(c*x^n))^2".Integrate("x")integral(cos(a + b * ln(c * x ^ n)) ^ 2, x)sinandcosof2 (a + b ln(c x^n)), besidex (c x^n)^(-1/n)492afc23and this change on it, run side by side, 0 wrong everywhere:F(d (a + b ln(c x^n))):Ei,ShiandChibeside(e x)^m, andSiandCialone, besidex,x^2and(e x)^m, and overx^2andx^3;(d x)^m li(b x), Rubi's 8.3 row 269.cos(a + b ln(c x^n))^2.6a4b09c1, this change on492afc23: 14,275, none failed (net10.0), with the GC heap held to 4 GB. Rebased onto master with A negative power of the variable is not a polynomial to integration by parts #1647, the integration test classes pass (199).6a4b09c1. Allocation matches the baseline on all 19 gated benchmarks.ExponentialIntegralIntegrationTesthas three rows of an exponential beside a sine or cosine over a linear. It also has four of a function of a logarithm of a monomial, checked at negativexas well withn = 2, and(k x)^m x/ln(b x)past 1.SpecialFunctionsByPartsTestchecks(d x)^m li(b x)at positive points, whereli(b x)is real.Part of #1501.
🤖 Generated with Claude Code