3

For the function $f(x)$, find the constant n where $f(x)$ has a maximum at $(n,1)$$$f(x)=\frac{x^{n-x}}{(n-x)!}$$ It is roughly $0.561459...$, but this is through numerical guess and check work. I'm fairly confident that the solution will be some infinite series that involves the Euler-Mascheroni constant and the digamma function, along with the Reimann-Zeta function, but I haven't been able to work anything out that leads to any kind of evidence to suggest it even has a way to express $n$ as anything more than a numerical value.

Some of you may be wondering how I know that it can even have a maximum at $(n,1)$. you'll notice that when $n=x$, $f(x)=1$ and I'm not sure how to describe this so just play with the value of $n$ on https://www.desmos.com/calculator/jb8x3n0cya and you'll see how the graph works. The values that intercept with $y=1$ are what I've found to be important.

P.S. Should $f(x)$ be $f(x,n)$? I'm really not sure.

Jacob Claassen
  • 868
  • 1
  • 8
  • 19
  • 1
    I don't get the question. It says "find the constant n ..." and in your answer it says "It is roughly 0.561459". So n is roughly 0.561459? How does this fit with the factorial? Did you replace the factorial by the Gamma function? --- Other question: what is "(n,1)" ? Is that supposed to mean n=n, x = 1? --- Please clarify. – Andreas Apr 28 '17 at 06:38
  • Where did this question come from? If you came up with it yourself, then why? I think you should provide some context. – skyking Apr 28 '17 at 07:51
  • For example what is the domain of $f$? If $x$ and $n$ is supposed to be integers and $n\ge x$ then it's certainly possible to see that $n=1$ is the value (for $n=2$ it has a non-strict maximum at $(n,1)$). – skyking Apr 28 '17 at 07:57
  • $(n−x)!$ means $\Gamma(n-x)$. After looking at the linked calculator site I recognised that you want to find a real $n$ such that $$f(n)=1$$ $$f'(n)=0$$. – miracle173 Apr 28 '17 at 08:45

1 Answers1

2

Using the derivative of $x^x$,

$$(x^x)' = (\ln x + 1) x^x$$

Using the derivative of $n!$,

$$(n!)' = n!\left(-\gamma + \sum_{k = 1}^{n} \frac{1}{k}\right)$$

Note that we really have to replace factorial with the Gamma function to make sense of differentiation. But lucky, we only need to know the value of its derivative at nonnegative integer so the above formula suffices. (Be careful, the above formula works only when $n$ is a nonnegative integer.)

Now regards $f$ as a function of $x$ on $(-\infty, n + 1)$. Here we again replace factorial with Gamma function so that $f$ is well-defined on $(-\infty, n + 1)$.

$$f'(x) = \left(\frac{x^{n - x}}{(n - x)!}\right)'$$ $$= \left(\frac{x^n}{x^x (n - x)!}\right)'$$ $$= \frac{x^x (n - x)! (x^n)' - x^n (x^x (n - x)!)'}{(x^x (n - x)!)^2}$$ $$= \frac{x^x(n - x)!n x^{n - 1} - x^n((x^x)'(n - x)! + x^x ((n - x)!)')}{(x^x (n - x)!)^2}$$ $$= \frac{x^x(n - x)!n x^{n - 1} - x^n\left((\ln x + 1) x^x(n - x)! + x^x \left(-(n - x)!\left(-\gamma + \sum_{k = 1}^{n - x} \frac{1}{k}\right)\right)\right)}{(x^x (n - x)!)^2}$$

(Be careful, the above formula works only when $n - x$ is a nonnegative integer.)

Putting $x = n$ and $f' = 0$ (we can do it since $n - x = n - n = 0$ is a nonnegative integer),

$$f'(n) = \frac{n^n(n - n)!n n^{n - 1} - n^n\left((\ln n + 1) n^n(n - n)! + n^n \left(-(n - n)!\left(-\gamma + \sum_{k = 1}^{n - n} \frac{1}{k}\right)\right)\right)}{(n^n (n - n)!)^2}$$ $$= \frac{n^n n^n - n^n((\ln n + 1) n^n + n^n \gamma)}{(n^n)^2}$$ $$= 1 - (\ln n + 1 + \gamma)$$ $$= -\ln n - \gamma$$ $$= 0$$

So $n = e^{-\gamma}$ is the unique critical point. Since $f$ is differentiable on $(-\infty, n + 1)$ and $(-\infty, n + 1)$ has no end points, the global maximum (which exists according to the question) must be a critical point. Hence $n = e^{-\gamma}$ is the unique global maximum.

Alex Vong
  • 1,654
  • $n$ is a real constant, not an inter constant. So $\sum_{k = 1}^{n}$ does not make sense. – miracle173 Apr 28 '17 at 08:48
  • @miracle173 That formula is only valid when $n$ is a nonnegative integer. Similarly, the formula for $f'(x)$ is only valid when $n - x$ is an nonnegative integer. But we are lucky here since when we put $x = n$, $n - x = 0$ is a nonnegative integer. Thanks, I will edit the question to indicate that. – Alex Vong Apr 28 '17 at 08:56