How to solve: If $x+y=8$, what is the max of $x^y$?

310 Views Asked by At

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?

2

There are 2 best solutions below

0
On 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$).

1
On

Almost correct. It's indeed enough to find maximum for function $x^{8 - x}$ on $(0, 8)$. From calculus, if differentiable function attains maximum on an interval, then it's derivative in this point is $0$, so solving $\left(x^{8-x}\right)' = 0$ is the way to go, and you solved it correctly.

What remains is to show that it's actually a maximum. It's simple: for example, you can say that if $x$ is close to $0$, then $x^{8 - x}$ is also close to $0$, and if $x$ is close to $8$, then $x^{8 - x}$ is close to $1$. But as if $x = 4$ then $x^{8 - x} = 4^4 > 1$, function has a larger value inside the interval than near borders, thus it has a global maximum in an inner point of the interval, and in this point derivative is $0$. As there is only $1$ point with zero derivative, it has to be global maximum.

Counterexample why it's important to check that derivative's zero is actually maximum: function $f(x) = x^3 - x^2$ on interval $(-1, 5)$ has two zeroes of derivative: $x = 0$ and $x = 3/2$, but neither is maximum on this interval: the former is only local maximum, while the later is minimum.