Optimality with input derivatives