Skip to content

Take the power's branch in the incomplete gamma function - #2080

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
the-incomplete-gamma-function-takes-the-powers-branch
Oct 22, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
the-incomplete-gamma-function-takes-the-powers-branch

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Makes gamma(a, z) take the branch of z^a the power takes, so that its derivative is the derivative of its value everywhere. Part of #2075; see #204.

What was wrong. The function took the principal branch of z^a. The power takes the real root of a negative base for an exact exponent of odd denominator below 10 (SimplificationContract §6). So on the negative axis, for such an a, the derivative -z^(a - 1) e^(-z) read the real root while the value was principal. The difference quotient of gamma(1/3, z) at z = -2 was the derivative turned by e^(-2iπ/3).

Every antiderivative written in the function inherits that, and differentiating back cannot see it, because the symbolic derivative is consistent with itself. With the next integration rule, ∫₁² e^(x^3) dx came out -137.76 + …i, where quadrature gives 275.51.

The fix. Gamma(a, z) = Gamma(a) - z^a g(a, z) with g(a, z) = Σ_k (-z)^k/(k! (a + k)) entire (DLMF 8.7.3). Its z^a is now the power's, ρ = (-1)^p e^(-iπp/q) times the principal one:

  • Series: ρ goes into the prefactor.
  • Continued fraction: used on the negative axis only past (P + 5) ln 10, where it is (1 - ρ) Gamma(a) + ρ times the principal value, with nothing to cancel.
  • Imaginary part: on the cut it is now exactly zero, each factor being real.
master c73cc681, the principal branch now reference, the sum with the real root at 90 digits
gamma(1/3, -2) -1.08786823 - 6.524300699i 10.212552064243320672… 10.212552064243320672…
gamma(2/3, -4) 20.48002493 - 33.12704266i -36.897696051078160810… -36.897696051078160810…
gamma(-1/3, -300) -4.857661756e126 + 8.413716968e126i 9.7153235129376790359…e126 9.7153235129376790359…e126
gamma(1/2, -3), even denominator principal principal, unchanged
gamma(1/11, -2), denominator past 10 principal principal, unchanged, as (-8)^(1/11) is

SimplificationContract §6's table now has a row for gamma(1/3, -2). It also gets the bound below 10, which it did not record: (-8)^(1/11) is 1.1592 + 0.3404i, measured on this build. MathS.IncompleteGamma and the breaking entry say which branch the function takes, replacing #2078's note that the derivative disagreed.

The suite passes (16,895) and so do the MCP tests (329). The new tests pin the four values above against the 90-digit sum, and assert that the derivative on the cut is the difference quotient of the value. That test fails on master, where the quotient is not even real. No integrand in Rubi's corpus holds the function, so the shared harness cannot move.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

gamma(a, z) took the principal branch of z^a everywhere, and the power takes
the real root of a negative base for an exact exponent of odd denominator below
10 (SimplificationContract section 6). So on the negative axis, for such an a,
the function's derivative -z^(a - 1) e^(-z), whose power takes the real root,
was not the derivative of its value: the difference quotient of gamma(1/3, z) at
z = -2 was the derivative turned by e^(-2 i pi/3). An antiderivative written in
the function had the values of one turned the same way; with the next
integration rule, the integral of e^(x^3) from 1 to 2 came out -137.8 plus an
imaginary part, where it is 275.5, and differentiating back did not show it.

Gamma(a, z) is Gamma(a) - z^a g(a, z) with g entire, and its z^a is now the
power's: rho = (-1)^p e^(-i pi p/q) times the principal one, which makes the
value real. gamma(1/3, -2) is 10.2125..., DLMF 8.7.3's sum with the real root
at 90 digits. The conventions table records it, with the bound below 10 that it
did not: (-8)^(1/11) is principal.

Part of #2075; see #204.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant