Okay, this is part of a bigger question, but you don't need to know that. I just can't quite seem to get this right. I've got this function

...

...and I want to differentiate with respect to

. So collecting the terms that don't depend on

together as one general constant I get...

Looks simple, and I got an answer, but, ideally, when I find the second derivative I need it to be quite obviously negative (so that the answer I get when solving the first derivative equal to 0 is a maximum of the function), which it isn't, which is making me think that I've done something wrong. Might be worth me pointing out that

and

are also constants, so they don't affect the differentiating; just make it look rank.

Any ideas?