Have you been taught how to solve an optimisation problem?
You find the stationary points and then check the nature of these stationary points. If you want to maximise then you keep the solution that is a maximum. If you want to minimise then you keep the solution that is a minimum.
I have set it up for you! All that is essentially left is to find the coordinates of the maximum turning point of D^2. Surely you can do this? If not, you need to go back to your classnotes and textbook and thoroughly review the material that this topic is based on. To find the derivative, I suggest you apply some basic algebra and expand the expression I gave you. Then differentiate it term-by-term.
If you want more help, show some effort. We are not going to just hand you a step-by-step by solution.