# What are the local extrema of f(x)= xlnx-xe^x?

Mar 26, 2018

This function has no local extrema.

#### Explanation:

$f \left(x\right) = x \ln x - x {e}^{x} \implies$

$g \left(x\right) \equiv {f}^{'} \left(x\right) = 1 + \ln x - \left(x + 1\right) {e}^{x}$

For $x$ to be be a local extremum, $g \left(x\right)$ must be zero. We will now show that this does not occur for any real value of $x$.

Note that

${g}^{'} \left(x\right) = \frac{1}{x} - \left(x + 2\right) {e}^{x} , q \quad {g}^{' '} \left(x\right) = - \frac{1}{x} ^ 2 - \left(x + 3\right) {e}^{x}$

Thus ${g}^{'} \left(x\right)$ will vanish if

${e}^{x} = \frac{1}{x \left(x + 2\right)}$

This is a transcendental equation which can be solved numerically. Since ${g}^{'} \left(0\right) = + \infty$ and ${g}^{'} \left(1\right) = 1 - 3 e < 0$, the root lies between 0 and 1. And since ${g}^{' '} \left(0\right) < 0$ for all positive $x$, this is the only root and it corresponds to a maximum for $g \left(x\right)$

It is quite easy to solve the equation numerically, and this shows that $g \left(x\right)$ has a maximum at $x = 0.3152$ and the maximum value is $g \left(0.3152\right) = - 1.957$. Since the maximum value of $g \left(x\right)$ is negative, there is no value of $x$ at which $g \left(x\right)$ vanishes.

It may be instructive to look at this graphically:

graph{xlog(x)-xe^x [-0.105, 1, -1.175, 0.075]}

As you can see from the graph above, the function $f \left(x\right)$ actually has a maximum at $x = 0$ - but this is not a local maximum. The graph below shows that $g \left(x\right) \equiv {f}^{'} \left(x\right)$ never takes the value zero.

graph{1+log(x)-(x+1)*e^x [-0.105, 1, -3, 0.075]}