Ask Your Question
2

defining multivariate piecewise function

asked 2017-02-11 14:24:14 +0100

maaaaaaartin gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-12 01:50:36 +0100

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-11 14:24:14 +0100

Seen: 553 times

Last updated: Feb 12 '17