Replace deprecated max() operator by maximum()
Replace home-made symbolic derivator by the one provided by the Calculus pkg