# Finding the maximum of a function

I want to find the maximum of the following function,

$$f(x, y) = e^{m e^{-x}+n e^{-y}-x-y}(mrxe^y+nsye^x+mn(r+s)xy), 0 \le x, y \le 1$$

where $r, s, m,$ and $n$ are positive constants. At the maximum point we have the following equations,

$$\begin{cases} \frac{\partial{f(x, y)}}{\partial{x}} = 0 \\ \frac{\partial{f(x, y)}}{\partial{y}} = 0 \end{cases}$$

Simplifying the above equations we will get,

$$\begin{cases} x = -W_0\left(\frac {s(ny+ye^y-e^y)} {m(nry+nsy+rye^y+sye^y-se^y)}\right) \\ y = -W_0\left(\frac {r(mx+xe^x-e^x)} {n(mrx+msx+rxe^x+sxe^x-re^x)}\right) \end{cases}$$

Where $W_0(.)$ is the upper branch of the Lambert W function. We know that $W_0(.)$ cannot be expressed in terms of elementary functions. Does it imply that the system of equations cannot be solved analytically? If not, how can I solve it analytically?

-

Hint: One possible solution is using complex analysis, by substituting $z=x+iy$ (and then $x=\frac{z+\overline{z}}{2}$ and $y=\frac{z-\overline{z}}{2}$), you can get a simpler form (using, for example, mathematica). Hopefully, the function would be analytic in $\{z|0\leq\Re(z),\Im(z)\leq 1\}$. Then the maximum would be on the boundary, which is relatively easy to calculate (you get a function of one variable).