I am trying to differentiate the piecewise function shown in the picture below using Maple
However when I assign the piecewise function to H
using the following code
H := piecewise(gamma <> 0, exp(-(1 + gamma*(x - alpha)/beta)^(-1/gamma)), gamma = 0, exp(-exp(-(x - alpha)/beta)))
the function when γ=0 is being ignored and I am not sure why. I am getting the following output
As a result, when I try to find the derivative with respect to x, the derivative when γ=0 is omitted. I am kindly seeking assistance on how to resolve this problem.
The name gamma
is a predefined constant in Maple.
evalf(gamma);
0.5772156649
You could first declare is local
at the top-level, or you could use another name.
For example,
restart;
local gamma;
H := piecewise(gamma <> 0,
exp(-(1 + gamma*(x - alpha)/beta)^(-1/gamma)),
gamma = 0,
exp(-exp(-(x - alpha)/beta)));