# How many solutions for this general equation?

#### conscipost

##### Member
I was wondering if there is any way to know in general how many real solutions $x^n=n^x$ may have with n being a positive integer. Thanks!

Using IVT one can see that if n is even there must be at least three solutions, and if n is odd there exists at least two. But are these the "sharpest" bounds?

Last edited:

#### Klaas van Aarsen

##### MHB Seeker
Staff member
I was wondering if there is any way to know in general how many real solutions $x^n=n^x$ may have with n being a positive integer. Thanks!

Using IVT one can see that if n is even there must be at least three solutions, and if n is odd there exists at least two. But are these the "sharpest" bounds?
Hi conscipost! For even n, there are exactly 3 solutions, and for odd n there are exactly 2.

This can be verified by rewriting your equation for positive x:
\begin{array}{lcl}
x^n&=&n^x \\
\ln(x^n)&=&\ln(n^x) \\
n \ln x &=& x \ln n \\
\frac{\ln x}{x} &=& \frac{\ln n}{n}
\end{array}

The derivative of $$\displaystyle \frac{\ln x}{x}$$ is $$\displaystyle \frac{1 - \ln x}{x^2}$$ which has exactly 1 root for $x=e$.
This means that $$\displaystyle \frac{\ln x}{x}$$ has a maximum at $x=e$.
See this plot to see what it looks like.
Since we have a solution at $x=n$, there must be exactly 1 other solution at the other side of $x=e$ (for positive x).

For negative x with odd n there can be no solution, since $x^n$ is negative while $n^x$ is positive.
For negative x with even n there is exactly 1 solution, since $x^n$ is strictly decreasing, while $n^x$ is strictly increasing.

So for even n, there are exactly 3 solutions, and for odd n there are exactly 2.