I've asked this question in MaplePrime, but wonder if any folks here can answer it as well.
I would like to find a way to represent each piece of a piecewise function in Maple.
For example, for a piecewise function:
f:=x->piecewise(1<=x<=2,c[1]*x+c[2],2<=x<=3,c[3]*x+c[4],3<=x<=4,c[5]*x+c[6]);
I want to have a way to retrieve each piece, e.g. c[3]*x+c[4], but f(x)[2] doesn't work.
Is it archievable?
I believe that
is what you are looking for. If your piecewises are always fully defined (i.e. no 'otherwise' branch), then
would give you all the pieces.