[Math] maximize function with two variables

calculusfunctionsmultivariable-calculusoptimization

I would like to maximize the function:

$f(x,y) = c[x\log(2y) + (1-x)\log(2(1-y))]$ subject to constraint that $x,y \in (0,1)$

to find a relationship between $x$ and $y$ that maximizes $f(x,y)$. My solution is: take partial derivative with respect to $y$ and set to 0:

$\partial f/\partial y = c\times\partial/\partial y[x\log(2y) + (1-x)\log(2(1-y))] = 0$

I treat $x$ as constant and I believe this yields that: $x = y$, for the derivative to be zero. Questions:

  1. Is this the correct way to solve this, and how can we show $x = y$ is a maximum?
  2. I think the $2$ constant inside the $\log$ doesn't change the solution. If we had substituted any constant $z$ for $2$ in the equation, ie:

$f(x,y) = c[x\log(zy) + (1-x)\log(z(1-y))]$

The result would be the same. Is that right?

Best Answer

For the first part, look at the convexity of the function at the extremum.

For the second part of the question : if we consider $$F = c\Big(x\log(zy) + (1-x)\log(z(1-y))\Big)= c\Big(x\log(y) + (1-x)\log((1-y))+\log(z)\Big)$$ I suppose that we can forget $c$ and $z$ as long as we search for extremum conditions (I assume $c\neq 0$ and $z\neq 0$) . So, the critical points do not depend on $c$ or $z$.

Now, if we compute the partials, we have $$F'_x=\log (y z)-\log ((1-y) z)=\log (y )-\log (1-y)$$ $$F'_y=\frac{x}{y}-\frac{1-x}{1-y}$$ Setting the first equal to $0$ leads to $y=\frac{1}{2}$ and replacing in the second it cancels for $x==\frac{1}{2}$ too.

This just to confirm that you are totally right. It is very good you notice points like this one.