1 | initial version |
If you look at whatever documentation you found expand
in, you'll note that somewhere along the line Sage needs to have y
defined as a variable, like so:
var('y')
expand((x+y)*(x-y))
output:
x^2 - y^2
This was a compromise long ago between having all lower (or even upper) case variable names defined, and having none defined. It has worked reasonably well so far, especially since Sage's magic makes y
defined automatically if you do something like
f(x,y) = (x+y)*(x-y)
expand(f)