Add support to calculate analytical derivative of ifelse function (assuming it was used to define piecewise functions).

Use inline expression instead of parse for differentiation of ifelse funtion