#30641·sympy

Can mrv() handle functions with multiple varying arguments?

Author: sonusharma6-dsaCreated Oct 1, 2026Updated Oct 1, 2026

The generic Function branch in mrv() raises NotImplementedError when more than one argument has a non-empty MRV set. For example, on commit 2d283a82:

python
from sympy import Symbol, exp, erf2, limit, oo

x = Symbol('x', positive=True)
limit(exp(x)*erf2(exp(-x), 2*exp(-x)), x, oo)

This raises:

NotImplementedError: MRV set computation for functions in several variables not implemented.

The expected limit is 2/sqrt(pi), since erf2(t, 2*t) has leading term 2*t/sqrt(pi) near zero.

Add and Mul already use mrv_max1() to merge MRV sets and reconcile dummy substitutions. Would it make sense to use the same machinery across function arguments, carrying the rewritten arguments in a Tuple and rebuilding the function afterward?

What I'm unsure about is whether this would preserve the assumptions of the existing Function fallback. Consistent substitutions are one part of it, but the outer function still needs suitable series support.

Are there known cases where this approach would give an incorrect result, or particular cases that should be tested before attempting a patch?

Related: #5415 contains historical examples of this restriction, and the series example in #26096 still encounters it.