Reduce time of differentiation?

Hi.
I am facing a problem regarding runtime for a differentiation. Here is my code

What are equation1 and cons? Please provide complete code that can be evaluated to reproduce the problem.