Added cases to derive function

Need to add logarithms