# Find the max of this function

$$f(x) = x(2+x)e^{-x}$$

I have to find $$\max_{\mathbb{Q}} \{ f(x) \}$$ but I don't know how to proceed.

I started with $$f'(x) = (-x^2+2)e^{-x}$$ whence the stationary points are given when the $$x$$ coordinate is $$x = \pm \sqrt{2}$$

Yet those points do not belong to $$\mathbb{Q}$$. I thought like "I hav to find the closest possible point to $$\sqrt{2}$$, but it doesn't exist. I can always find a closer rational number from the one I found (call it $$p$$) and $$\sqrt{2}$$.

My conclusion would be that $$f(x)$$ has no maximum in $$\mathbb{Q}$$, but it does on $$\mathbb{R}$$ or if we want to be fancy, it even does on $$\mathbb{R}\backslash\mathbb{Q}$$.

• You are correct - there is no maximum over $\mathbb{Q}$ of that function. Jan 1 at 20:08
Let $$(q_n)_{n\in\Bbb N}$$ be a sequence of rational numbers such that $$\lim_{n\to\infty}q_n=\sqrt2$$. Then\begin{align}\lim_{n\to\infty}f(q_n)&=f\left(\sqrt2\right)\\&=\left(2+2\sqrt2\right)e^{-\sqrt2}.\end{align}But, for each $$q\in\Bbb Q$$, $$q\ne\sqrt2$$, and the maximum of $$f$$ is attained at $$\sqrt2$$ and only at that point. Therefore\begin{align}f(q)&So, there is some $$n\in\Bbb N$$ such that $$f(q). This proves that, for each rational number $$q$$, there is some rational number $$q^\star$$ such that $$f(q), and therefore the set $$\{f(q)\mid q\in\Bbb Q\}$$ has no maximum.