The following function is a piecewise function. It's easy to plot with option Exclusions->None
but it's derivative is hard to evaluate:
f[x_] = Import["http://pastebin.com/raw/qCfdYTbd"];
Plot[f[x], {x, -5, 5}, Exclusions -> None]
Plot[f'[x], {x, -5, 5}, Exclusions -> None]
The following works well for the Plot
, but introduces very small and large values so I'd like a better solution to compute $f'$.
fp[x_] = (f[x + 10^-6] - f[x])/10^-6