Skip to content

Special integral functions? #1469

Description

@Happypig375

#1467 asserts that

neither of its terms has an elementary antiderivative

But we don't have to limit ourselves to elementary antiderivatives. We can introduce the functions of https://mpmath.org/doc/current/functions/expintegrals.html and have special integral functions too!

Activity

  1. Rafael-SOWNet commented on Sep 22, 2026

    @Rafael-SOWNet
    Member

    Agreed, and the sentence you quote was about what int cosh(x)^p dx is, not about what we should be willing to print: for a fractional p it is an incomplete elliptic integral of the second kind, and the rule in #1467 answers the combinations where the elliptic part cancels. Where it does not cancel, an E(phi | m) is the honest answer and unevaluated is a worse one. So the question is not whether, but which functions, in what order, and against which test.

    What the corpus says the order is. Rubi's family 8, which we do not run at all today, is 1949 problems in ten files:

    file problems needs
    8.9 Product logarithm 398 W(x)
    8.1 Error functions 311 erf, erfc, erfi
    8.6 Gamma functions 233 Gamma(a, x), gamma(a, x), logGamma
    8.2 Fresnel integrals 218 S(x), C(x)
    8.3 Exponential integrals 208 Ei(n, x), Ei(x), li(x)
    8.8 Polylogarithm 198 Li_n(x)
    8.4 Trig integrals 136 Si, Ci, Shi, Chi
    8.5 Hyperbolic integrals 136 the same four
    8.10 Formal derivatives 97 nothing new
    8.7 Zeta 14 zeta(s)

    That is a different shape from what I expected: the product logarithm and the error function carry more of the corpus than the exponential integral does, and Si/Ci/Shi/Chi share a file each way for 272 together. It also means the first tranche that pays is erf/erfc/erfi plus Ei/li and the four trigonometric-integral functions — about 655 problems — while W, the polylogarithms and the gamma family are each their own piece of work.

    Three things I would want settled before the first one lands, because they are what makes the difference between a function and a symbol we print:

    1. A function is its definition, not its notation. Each needs a branch convention written down where the code can be checked against it (Ei(x) as the Cauchy principal value for x > 0; li(x) = Ei(ln x) with the same cut; erfi(x) = -i erf(i x) exactly, not as a separate series), and a numerical evaluation that agrees with it. Without the numeric side, Integrate starts returning answers that EvalNumerical cannot check, and our own corpus harness grades them Unverifiable — we would be adding answers the suite cannot defend.
    2. Differentiation and the derivative-back check come first. Every one of these is defined by its derivative, so d/dx Ei(x) = e^x/x and friends are what make the 97 problems of 8.10 free and what lets propcheck and intbench verify everything else. That is the cheapest possible first commit and I would put it before any integration rule.
    3. The decline rule stays. "Not answering is a legitimate answer; answering wrongly is not" does not weaken here: int e^(x^2) dx becoming sqrt(pi) erfi(x)/2 is right, but a rule that reaches for a special function whenever the elementary search fails will start printing them for integrands whose antiderivative is elementary and merely not found yet. The guard I would want is that a special-function answer is only produced by a rule that names the identity it is using, never by a fallback.

    If that reading matches your intent I will open a Goal for the first tranche (erf family, Ei/li, Si/Ci/Shi/Chi) with the definitions, the numerical evaluation and the derivatives as its first children, and wire family 8 into the corpus harness so the number is visible from the start — today it is 1949 problems we silently do not count. #809 already surveyed the neighbouring gap (the eight functions that are refused by name today, erf among them), so the two would want to be read together.

  2. Happypig375 commented on Sep 22, 2026

    @Happypig375
    MemberAuthor

    These all seem correct. Implementing these before v3 (2.8) might allow some repeating architectural patterns or duplicate implementations or more efficient processing that better pass through these function nodes to be exposed.

  3. added this to the 3.0 milestone on Sep 22, 2026
  4. modified the milestones: 3.0, 2.8 on Sep 24, 2026
  5. Rafael-SOWNet commented on Sep 27, 2026

    @Rafael-SOWNet
    Member

    A correction to my comment above: the derivatives don't make 8.10's 97 formal-derivative problems free. Those problems integrate undefined functions, such as Derivative(1)(f)(x)/f(x) to log(f(x)), and none of them mentions a special function. They need f(x) as a function in its own right, so #1501 leaves them out.

  6. modified the milestones: 2.8, 2.6.0 on Sep 30, 2026
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

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions