First change your notation, what you have makes it difficult to read and will result in some confusing notation.

Let the free variable be rather than , and put , also assume . Then your problem is to find the that maximises:

so:

so for an extremum you need to solve , which if is equivalent to:

Note: The maximising in your notation cannot depend on as this only appears in the multipler which is by definition a constant greater than zero and so effects the maximum but not the value of which gives this.

CB