I need to define some functions with more than one variable, but the examples only list one variable cases, so I tried this:
f[x_, y_] = (y/x) + xy
f[1, 2]
Sadly, my output is (y/x)+xy, which is not what I'm looking for. Someone knows what should I do?
SOLVED: had to use Exit[]
xandyinxy, the latter will be considered as an independent variable of namexy. This being said, definingf[x_, y_] = (y/x) + x yand asking forf[1, 2]works fine for me and returns4. Perhaps, exiting your session withExit[]and evaluating your inputs again may solve your issue. In the general situation, it is however better to use:=instead of=as mentionned by @eldo. – Oct 18 '15 at 17:56