Skip to content

The incomplete gamma function #2075

Closed
Closed

Description

@Rafael-SOWNet

The upper incomplete gamma function, Gamma(a, x) = int_x^oo t^(a - 1) e^(-t) dt, is what the last open item of #180 needs: int t^(-1/2) e^(-t^(-2)) dt is 2 sqrt(t) e^(-1/t^2) - 2 Gamma(3/4, 1/t^2). It is also most of Rubi's file 8.6, which #1469 counts at 233 problems. The file uses the two-argument GAMMA 628 times, against 34 for the one-argument one. @Happypig375's note there was to implement family 8's functions before v3.

What it takes, in #1501's order:

  1. The harness. Read 8.6, mapping GAMMA(a, x) to gamma(a, x), Psi(n, x) to polygamma(n, x) (The polygamma functions, and the derivative of the factorial #2068), and lnGAMMA. Then the count is visible before anything lands.
  2. The node. gamma(a, x), upper, as Mathematica's Gamma[a, x] and mpmath's gammainc(a, x) are. It needs:
    • its branch convention written down;
    • evaluation to the working precision for complex a and x: the series for small |x|, the continued fraction for large |x|, and Gamma(0, x) = E_1(x) and the other non-positive whole a handled on their own;
    • the derivative in x, -x^(a - 1) e^(-x);
    • its LaTeX and SymPy forms (uppergamma).
  3. Integration rules, each naming its identity: int x^(a - 1) e^(-x) dx = -Gamma(a, x) for a non-whole a, and int Gamma(a, x) dx = x Gamma(a, x) - Gamma(a + 1, x).

8.6's lnGAMMA problems need Psi(n, x) at negative n, the repeated integrals of ln Gamma, which are a further step.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Activity

  1. added this to the 2.7.0 milestone on Oct 22, 2026
  2. Rafael-SOWNet commented on Oct 23, 2026

    @Rafael-SOWNet
    MemberAuthor

    Where this stands on master e62a56d6:

    Rubi's 8.6, read with a harness copy that maps GAMMA(a, x): 156 of 177, 0 wrong. The node alone solved 63.

    Left:

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  3. Rafael-SOWNet commented on Oct 23, 2026

    @Rafael-SOWNet
    MemberAuthor

    Item 1 is done. The corpus harness now reads Maxima's GAMMA(a, x) as gamma(a, x) and Psi(n, x) as polygamma(n, x), and lnGAMMA stays excluded by its head. On master e62a56d6, Rubi's suite goes from 48,305/48,305 to 48,502/49,052:

    rows solved
    fair before 48,305 48,305, none moved
    new, with GAMMA or Psi in the integrand or the answer 747 197: 8.6's 157 of 184 and 40 in 2.3

    0 wrong. Most of the 545 new unsolved rows are in 2.3, the 3.x logarithm files and 4.1.10/4.1.12, as x^m e^(b x^n) shapes after a substitution. That is what the rule in my comment above answers.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  4. 7 remaining items

  5. Rafael-SOWNet commented on Oct 24, 2026

    @Rafael-SOWNet
    MemberAuthor

    With #2106 in, everything this issue listed is done, in #2077–#2106:

    • the harness reads GAMMA and Psi;
    • gamma(a, z) is the upper incomplete gamma function, with its convention written down and its evaluation;
    • it has a derivative, a LaTeX form and a SymPy form;
    • the integration rules exist, together with the routes that reach them.

    On the full fair Rubi corpus, measured on #2106 rebased onto master (191510f3):

    solved
    8.6 Gamma functions 179 of 184
    all families 49,047 of 49,052

    What is left in 8.6

    • 269–272 are (c + d x)^k polygamma(n, a + b x) at a symbolic order n. Their answers use polygamma(n - 1, …) down to polygamma(n - 4, …). polygamma here is defined for n >= 0, so at small n those terms are the repeated integrals of ln Gamma, which the body calls a further step.
    • 282 is answered, -polygamma(n, a + b x)/x, but cannot be checked at the harness's non-integer pinned order.

    I'm closing this; the negative orders would be an issue of their own.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions