MaximaDefine(var,expr) should only define var using expr in Maxima. Obviously, var is also defined in SMath. This prevents further MaximaDefine() commands using the same variable.Workaround is to define the variable and use the single argument version in SMath.