Hey guys, I have the following function
f[x_, y_ ] =
Piecewise[{{x^2/y^(-4)*Exp[-(x^2/y^(-4)], y != 0}, {0,y = 0}}]
Mathematica’s output is just a simple 0. For an unknown reason Mathematica “thinks” that y=0. Anybody an idea how I could fix this? I have honestly no idea where the problem could be.
I see a typo in the post. Does this work for you?
Piecewise[{{x^2/y^(-4)*Exp[-(x^2/y^(-4))], y != 0}, {0, y == 0}}]
Hi Dezső,
Because of the y = 0 in the second condition. Should be y == 0. There is a ) missing in the expression above. Also better to use SetDelayed rather than Set. Please check that I added the ) in the right place.
f[x_, y_] := Piecewise[{{x^2/y^(-4)*Exp[-(x^2/y^(-4))], y != 0}, {0, y == 0}}]