I am going to assume two things..firstly d2=dē and secondly, that you are in calc

You are attempting to maximize

differentiating we get

So now we need to find where this equals zero

to verify this is a max we use the second derivative test

and since

we can see that this is in fact a max