defining multivariate piecewise function
I need to define some function like f(x,y) = x * sin(y)/y if y != 0, x otherwise
, such that f
can be differentiated. Is there a way to do so? Thanks!
I need to define some function like f(x,y) = x * sin(y)/y if y != 0, x otherwise
, such that f
can be differentiated. Is there a way to do so? Thanks!
piecewise
currently only supports a single variable, but in your case you could factor out the x
and define
f(x,y) = x * piecewise([[(-oo,0), sin(y)/y], [[0,0], 1], [(0,oo), sin(y)/y]])
The square brackets around the origin denote a closed domain to ensure that point is included.
Asked: 8 years ago
Seen: 606 times
Last updated: Feb 12 '17