I am definitely not a mathematician.

I was reading about $e$ and I saw this fun thing where your cut up a number then raise the result to the power of the $x$ you divided the number by.

I chose $10$ as the number, $x$ is in the range $1$ to $5$, a numpy array:

x = np.linspace(1, 5, 100)

Using matplotlib, I made a nice little plot, and sure enough, when $10/x = e$, $(10/x)^x$ is biggest.

I'm not sure I understand why. Could you tell me why this is so?


Consider the function $f(x) = (10/x)^x$. Then your question is to determine which $x$ maximizes this function.

One way to solve this is with calculus. Here, the derivative is given by $$ f'(x) = \big( \frac{10}{x} \big)^x \big( \log(10/x) - 1\big). $$ Extrema will occur when $f'(x) = 0$ or in limiting behavior. As $x \to 0$, $f(x) \to 1$, and as $x \to \infty$, $f(x) \to 0$. The points where $f'(x) = 0$ are the points where $\log(10/x) - 1 = 0$, which is exactly when $10/x = e$

Either plugging in a value or computing the second derivative, we see that $x = 10/e$ is a maximum, and in fact the global maximum.