Solve: If $x+y=8$, what is the max of $x^y$

calculusmaxima-minimarecreational-mathematicssolution-verification

Now, I was bored, and decided to do some math for fun. After a while, I came up with this:$$\text{Given }x+y=8\text{, what is }\max(x^y)\\\text{where }x,y\gt0$$which I thought that I might be able to do. Here is my attempt at doing so:

Right away we can see that $y=8-x$ which implies that we can rewrite $x^y$ as $x^{8-x}$.

Now, letting some function $p(x)=x^{8-x}$, we can see that $p'(x)=-x^{7-x}(x+x\ln(x)-8)$ and now, to find the maximum, we need to set this to $0$. Now, here's a quick explanation of why I am setting $p'(x)$ equal to zero:

In mathematics, the derivative shows the "sensitivity" of the change of a function's output with respect to the output. This is basically a change in $y$ over a change in $x$ of a function (if you remember $\frac{\Delta y}{\Delta x}$ from your Algebra I class), but applied infinitely. The reason we set the derivative equal to $0$ is because at the maximums and minimums of a function, the change of the function's output at that point will be $0$, therefore the derivative is $0$. Now back to the question.

We have that $\lim_{x\to0^+}p'(x)=0$ (because $\lim_{x\to0^-}p'(x)$ does not exist), although we have that that is actually the minimum of $p(x)=x^{8-x}$, since ($p(0)=0$) but we have 2 equations we can solve:$$-x^{7-x}=0\text{ or }x+x\ln(x)-8=0$$which since we already established that $x=0$ is a minimum of our function, we need to find the solution to our non algebraically solvable boi$$x+x\ln(x)=8$$which this is how I did so:$$x+x\ln(x)=8\implies x^xe^x=e^8\\\implies xe=e^{8/x}\\\implies\dfrac1xe^{8/x}=e\\\implies\dfrac8xe^{8/x}=8e\\\implies\dfrac8x=W(8e)\\\implies\dfrac8{W(8e)}=x$$which we can rewrite as$$x=e^{W(8e)-1}$$meaning that our maximum is at$$e^{(W(8e)-1)(8-e^{W(8e)-1})}\approx280.904556713$$which, for any $x+y=\alpha$ where $x,y,\alpha\ge0$, we can write the max of $x^y$ as$$\max(x^y)=e^{(W(\alpha e)-1)(\alpha-e^{W(\alpha e)-1})}$$however, my question is:

Is my solution correct, or what would I do to get the correct solution?

Best Answer

Your calculations are correct. You should argue that, since $f(x)= x^{8-x}$ is continuous in $[0,8]$ and differentiable in $(0,8)$, the global maximum/minimum will exist (Weierstrass theorem) and will occur either at point where $f' =0$ or at the boundary.

Since you have established that the derivative vanishes at a single point $x_0 \in (0,8)$, and that $f(0) = 0$, $f(8)=1$, $f(x_0) \approx 280$, you can conclude that $f(x_0)$ is the global maximum and zero is the global minimum (also, $f$ attains a local minimum at $x=8$).

Related Question