Maximisation problem not working

I am trying to solve the following optimisation problem, but Mathematica is not providing me with a solution:

$$\max_{x_{1},x_{2},e_{1},e_{2}}\theta_{1}\ln(x_{1})-e_{1} + \theta_{2}\ln(x_{2})-e_{2} \\ \text{s.t}\quad \theta_{1}\sqrt{e_{1}}+\theta_{2}\sqrt{e_{2}}=x_{1}+x_{2}$$

I am using the following Mathematica code, but it just returns the string I provide, rather than any attempt at a solution.

Maximize[{t Log[x] - e + T Log[X] - f, t Sqrt[e] + T Sqrt[f] == x + X},{x,X,e,f}]

This should be solvable by using Lagrange multipliers but it is just returning:

Maximize[{-e - f + t Log[x] + T Log[X], Sqrt[e] t + Sqrt[f] T == x + X}, {x, X, e, f}]
• Why not try the Lagrange multiplier approach with Solve[], just for comparison's sake? Mar 7 '16 at 17:27
• Also, is it sufficient to get numerical results using NMaximize or relatives? Mar 7 '16 at 17:34

One solution with NMaximize

NMaximize[{t Log[x] - e + T Log[X] - f, t Sqrt[e] + T Sqrt[f] == x + X
&& x > 0 && X > 0 && e > 0 && f > 0}, {x, X, e, f, t, T}]
(* {49.9142, {e -> 0.247974, f -> 0.542274, t -> -2.79977, T -> 3.65042,
x -> 1.96201*10^-8, X -> 1.32159}} *)

A warning is reported:

NMaximize::nnum: "The function value Indeterminate is not a number at {e,f,t,T,x,X} = {0.209827,0.533031,-2.96546,3.74982,0.,1.41812}."

a supplement

If t and T are given parameters; this is a big relief!

NMaximize[{t Log[x] - e + T Log[X] - f, t Sqrt[e] + T Sqrt[f] == x + X
&& x > 0 && X > 0 && e > 0 && f > 0} /. {t -> 1, T -> 1}, {x, X, e, f}]
(* {-1.69315, {x -> 0.707108, X -> 0.707108, e -> 0.500001, f -> 0.500001}} *)

{t -> 1, T -> 1} are freely chosen.

ff = t Log[x] - e + T Log[X] - f;
g = t Sqrt[e] + T Sqrt[f] - x - X;
L = ff + \[Lambda] g;

Solve[Eliminate[{Grad[L, {x, X, e, f}] == 0, g == 0}, {\[Lambda]}], {x, X, e, f]}] Solution is the term with x > 0 and X > 0.

% /. {t -> 1, T -> 1}
(* {x -> 1/Sqrt, X -> 1/Sqrt, e -> 1/2, f -> 1/2} *)
• As I understand it, t and T are given parameters Mar 7 '16 at 17:55
• @Dr. belisarius Thanks for the help.
– user36273
Mar 7 '16 at 18:23