Adding integration formulas to lookup table

32 views
Skip to first unread message

SalahDin Rezk

unread,
Mar 27, 2025, 1:19:47 PM3/27/25
to sympy
Hi, I have been spending some time on https://github.com/sympy/sympy/issues/27586 and am taking the approach of adding rules for each integration formula. However, this seems inefficient and there has to be a more efficient way.

My approach:


@dataclass
class ErfExpRule(AtomicRule):
    a: Expr
    b: Expr

    def eval(self) -> Expr:
        a, b, x = self.a, self.b, self.variable

        return (1/b) * exp(b*x) * erf(a*x) - (1/b) * exp(b**2 / (4*a**2)) * erf(a*x - b/(2*a))



Adding (Mul, erf(a*_symbol, evaluate=False) * exp(b*_symbol, evaluate=False), None, ErfExpRule) to _special_function_patterns.extend

Thank you.
Reply all
Reply to author
Forward
0 new messages