f(x,y) = (1-x)^2 + 100*(y - x^2)^2
solve([f.diff(ar) for ar in f.args()],f.args())[0]
[x=1;y=1]
The `subs_expr` method accepts multiple equations already, so you can
shave a few characters off that:
sage: solution = solve([f.diff(ar) for ar in f.args()],f.args())[0]
sage: f(x,y).subs_expr(*solution)
0
`subs` accepts multiple arguments too, and will generally work like a
function call with named arguments if you want it to.
sage: x,y,z = var('x,y,z')
sage: f = x + y + z
sage: f(x=1, y=2, z=3)
6
sage: f.subs(x=1, y=2, z=3)
6
sage: f.subs({x: 1, y: 2, z: 3})
6
Passing it one equation does work,
sage: f.subs(x == 1)
y + z + 1
But more than one doesn't,
sage: f.subs(x == 1, y == 2)
...
TypeError: substitute() takes at most 1 positional argument (2 given)
I guess all that's missing is the ability to pass it multiple equations,
like `subs_expr`. It would probably be easy to add that ability to
`subs` if you want to create a ticket for something.