A trigonometric function of an imaginary multiple of a logarithm is integrated in exponentials - #1744
Merged
Rafael-SOWNet merged 5 commits intoOct 4, 2026
Conversation
…ntegrated in exponentials tan(a + i ln(x)) and sin(a + ln(c x^2) sqrt(-1/4)) were declined: the closed form for a power of the variable times a sine or cosine of a logarithm divides by (m + 1)^2 + B^2, which an imaginary B can make zero, and Rubi's 4.7.5 is built on exactly that. e^(i (a + b ln(u))) is e^(i a) times a real power of u when b is imaginary, so each function is written as a sum or quotient of such powers when b is an imaginary number; a symbolic b is left alone, since whether the zero is there turns on a sign. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…ubstitution's answer Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-Authored-By: Claude Opus 5.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.
Part of #718.
tan(a + i ln(x))andsin(a + ln(c x^2) sqrt(-1/4))were declined: the closed form for a power of the variable times a sine or cosine of a logarithm divides by(m + 1)^2 + B^2, which an imaginaryBcan make zero, and Rubi's 4.7.5 builds 66 problems on exactly that. 2.5.0 declined them too:3f744439sin(a + ln(c x^2) sqrt(-1/4))tan(a + i ln(x))cot(a + i ln(x))/x^21/cos(a - 2 i ln(c x))^(3/2)x sin(a + ln(c x^n) sqrt(-1/n^2))^2cos(a + ln(c x^n) sqrt(-1/(4 n^2)))^2sin(a + ln(c x^n) sqrt(-1/n^2))Each answer is differentiated back with the symbols pinned and compared as a complex number at six points.
What changes.
e^(i (a + b ln(u)))ise^(i a)times a real power ofuwhenbis imaginary, so each trigonometric function of such an argument is a sum or quotient of powers ofu. Wherebis an imaginary number they are written so, through Euler's formula, and the question asked again: the zero the closed form divides by is a power1/xthere, whose integral is a logarithm. After the closed form, which answers every realb. A symbolicb,sqrt(-1/n^2), is left alone: whether the zero is there turns on the sign ofn, and the general power's formula, written without knowing it, has a zero below its bar. Beside its own derivative the logarithm is left to the substitution:tan(a + i ln(x))/xistan(a + i u)inu = ln(x), which the integrator answers in a closed form, where the exponentials would answer it as a piecewise ine^(i a).Tests:
TrigonometricOfAnImaginaryLogarithmIntegralTest, five rows compared as complex numbers; four are declined on master, and the fifth is answered there by another route. Two more,tan(a + i ln(x))/xandcot(a + i ln(x))/x, keep the substitution's answer, and fail without the step that leaves them to it.Measured first on the 72 problems of 4.7.5 with an imaginary multiple of a logarithm in a trigonometric function, 66 run, at the corpus's 5-second budget, against master
8f3757cd, the branch's base:Seven more are answered and not counted. Six,
x tan(a + i ln(x))and its kin withx,x^3or1/x^3beside the tangent or the cotangent, are answered in a piecewise ine^(i a)whose conditions holde^(-i a) e^(i a)as written; the harness evaluates them onceSimplifyhas made that 1, and they check out then. The seventh,1/sin(a - 2 i ln(c x))^(3/2), is answeredprovided e^a > 0, which the harness does not evaluate with its pinned symbols; its derivative matches the integrand to 1e-23 at eight points on both sides of zero, by central differences in mpmath at 40 digits.cot(a + i ln(x))^2/x^3, past the budget here, is answered in four and a half seconds alone. The 30 still declined have a symbolic coefficient,sqrt(-1/n^2),sqrt(-(1 + m)^2/n^2)and their kin, 26 of them, or a symbolic power,sec(a + i ln(c x^n)/(n (p - 2)))^pand its kin, four.Measured then on the Rubi corpus against master
8f3757cd:The harness counts no answer wrong in the pocket or the sample on either build. Of the 37 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 5 and this 26: twenty-four of 4.7.5's that master declines in a tenth of a second to a second, answered here in a tenth of a second to eighteen seconds, and the two with
1/xbeside the function,tan(a + i ln(x))/xandcot(a + i ln(x))/x, which both answer in under a tenth of a second. The three master answers there and this does not,(a + b x)^10 (A + B x)/(d + e x)^9,1/(x (a x + b x^3 + c x^5)^2)andlog(e (f (a + b x)^p (c + d x)^q)^r)/(a + b x)^4, take twenty to twenty-four seconds on master, at the edge of the harness's patience, and ran past it here under a heavier load; family 1's one in the sample is the first. Seven more of the 37 are the seven above that the harness does not count, andx^4/((a + b x^2)^2 (c + d x^2)^3)is past the budget on both.The suite passes on the commit measured,
1924669c, 14,596 tests with 13 skipped, and the allocation gate with it. The pocket and the 37 moved problems were run again with the step that leaves a logarithm beside its derivative to the substitution,38f87001, which is what the counts above are; the families were measured before it, and it changes only an integrand with the logarithm's derivative beside it, two of the pocket's. On the merge with master7075a747,7d23e936, the 4,104 calculus and corpus tests that run pass, with 2 skipped; on the merge with master3f744439,cedda6a2, this file's tests, #1743's and the corpus gate pass, 23 of them. Every row of the first table is as it says on the merge.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura