Skip to content

A trigonometric of a logarithm of an imaginary power is written in a named constant times a power - #1867

Merged
Rafael-SOWNet merged 3 commits into
masterfrom
a-trigonometric-of-a-logarithm-of-an-imaginary-power
Oct 13, 2026
Merged

Rafael-SOWNet merged 3 commits into
masterfrom
a-trigonometric-of-a-logarithm-of-an-imaginary-power

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Part of #718.

sec(a + 2 ln(c x^(i/2)))^3 was declined, along with x sec(a + 2 ln(c x^i))^3 and the cosecant's (Rubi's 4.7.5). The rule that writes a trigonometric function of a + b ln(u) as exponentials only fired when b itself was imaginary. Here b is 2, and the imaginary factor is the power of the variable inside the logarithm.

What the rule needs is for e^(i L) to be a constant times a power of the variable. That holds whenever b x u'/u is an imaginary constant, which for u a product of constants and powers of x is b times the sum of those powers. The condition now reads that sum off the factors.

Asked as it stands, the rewritten integrand gets right answers of over 6,000 characters, because c^(2 i) and c^(-2 i) (or e^(i a) and e^(-i a)) never cancel, so the answer is a piecewise on combinations of them. Instead, e^(i L) is written as K x^p, with K = e^(i L) x^(-p) named as one symbol. The integrand is then rational in x, and K is substituted back afterwards. K is constant wherever it is defined, for either sign of c, so the answer is an antiderivative there. Where the named answer puts a condition on K, as tan(a + i ln x)'s does on K^4 > 0, the condition has no value once K is written back. In that case the exponentials are asked unnamed, as before.

Sizes, measured on master a29f7ec, on 2.5.0 and on this branch:

Integrand 2.5.0 master a29f7ec branch
sec(a + 2*ln(c*x^(1/2*i)))^3 unevaluated unevaluated 262 chars
csc(a + 2*ln(c*x^(1/2*i)))^3 unevaluated unevaluated 264 chars
x*sec(a + 2*ln(c*x^i))^3 unevaluated unevaluated 275 chars
x*csc(a + 2*ln(c*x^i))^3 unevaluated unevaluated 275 chars
sec(a + 2*ln(c/x^(1/2*i)))^3 unevaluated unevaluated 484 chars
csc(a + 2*ln(c/x^(1/2*i)))^3 unevaluated unevaluated unevaluated (a condition on K)
sec(a + i*ln(x))^3 unevaluated 194 chars 198 chars, now through K
tan(a + i*ln(x)) unevaluated 756 chars 756 chars, unchanged (falls back)

Each was checked exactly, derivative against integrand at 50, 300 and 2,000 digits, for c = 2 and c = -2. All agree at every precision except one: sec(a + 2*ln(c/x^(1/2*i)))^3 at c = -2 is right at 300 and 2,000 digits but not at 50. There the integrand is about 1e-8, because ln of a negative c adds i pi, which the factor 2 i turns into e^(-2 pi). The answer's terms cancel to that, so the result is ill-conditioned rather than wrong.

The tests differentiate each one back at c = 1.3 and c = -1.3.

Rubi corpus, compared with master a29f7ec:

  • 4.7.5 pocket: 145 → 150 of 160, with 0 wrong on either side.
  • The 5 that moved went from unevaluated to solved, and each was re-run on its own.
  • Every family is unchanged.

The allocation gate passed. The suite passed: 15,309 passed, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 3 commits October 13, 2026 04:46
…named constant times a power

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
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 13, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 7ca5b88 into master Oct 13, 2026
34 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the a-trigonometric-of-a-logarithm-of-an-imaginary-power branch October 13, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant