Prove that $(1+x)^\frac{1}{x}+(1+\frac{1}{x})^x \leq 4$

From a friend who doesn't want to use math.se...

Write the inequality as $$ \frac{1}{1+x} \left(1+x\right)^{1+\frac{1}{x}} + \frac{x}{1+x} \left(1+\frac{1}{x}\right)^{1+x} \leq 4.$$

Let $f(x) =(1+x)^{1+\frac{1}{x}}$. If $f$ is concave, then we are done since this means that

$$4=f(1)=f((1- \alpha)x + \alpha y)) \geq (1- \alpha) f(x) + \alpha f(y) = \frac{1}{1+x} \left(1+x\right)^{1+\frac{1}{x}} + \frac{x}{1+x} \left(1+\frac{1}{x}\right)^{1+x}$$ with $\alpha = \frac{x}{1+x}, 1-\alpha = \frac{1}{1+x},$ and $y = \frac{1}{x}$. So, we will show that $f$ is concave.

Note that if $f(x) = e^{g(x)}$ and $g''(x) + g'(x)^2 \leq 0$ for all $x$, then $f$ is concave.

So, consider $g(x) = (1+\frac{1}{x}) \log (1+x).$ Then we have that $$g''(x) + g'(x)^2 \leq 0 \leftrightarrow \log(1+x) \leq \frac{x}{\sqrt{1+x}}$$

Note that $\lim_{x \to 0^+} \log(1+x) = \lim_{x \to 0^+} \frac{x}{\sqrt{1+x}}=0.$

By AM-GM, $$\frac{1}{1+x} = \frac{d}{dx} \log(1+x) \leq \frac{x+2}{2(1+x)^{\frac{3}{2}}} = \frac{d}{dx} \frac{x}{\sqrt{1+x}} $$

So, $$\log(1+x) = \int_0^x \log (1+x) ' dx \leq \int_0^x \left(\frac{x}{\sqrt{1+x}}\right)' dx = \frac{x}{\sqrt{1+x}}.$$


I'm going to include another (almost) answer for "cultural enrichment of technique". This will not be nearly as beautiful as Alvin's approach but does exemplify that when enlightenment doesn't fall upon you that doesn't mean that your hands are bound. The question posed and the answers and comments that eventually got deleted all wanted to use elementary analysis in some capacity. And unfortunately, concavity/convexity isn't discussed in all elementary analysis courses. So this will also provide an approach avoiding convexity, while going deeper into inequalities.

This was a stubborn inequality. The components had dual nature: when one was large, the other was small. And vice versa. This would normally be great if they weren't similar in nature on the middle of $[0,1]$. Typical inequalities were not precise enough to be good both at the endpoints and in the middle of $[0,1]$.

Thus osculatory interpolating polynomials are things to keep in mind, as they can be constructed as needed for ad hoc purposes when enlightenment doesn't come to you but you still have to roll up your sleaves.

We first observe that $$f(x)=(1+x)^{1/x}+(1+1/x)^x=e^{x\ln(1+1/x)}+e^{\ln(1+x)/x}\,.$$ Let us define $$g(x)=x\ln(1+1/x)\quad\text{and}\quad h(x)=\ln(1+x)/x\,.$$ It will be nice to have some information about $g$ and $h$. Elementary calculus can show that $g$ is strictly increasing and that $h$ is strictly decreasing on $(0,1)$. But overmore $$0\leq g(x)\leq\ln 2 \quad\text{and}\quad \ln 2\leq h(x)\leq 1$$ for $0\leq x\leq 1$. And lastly $$\lim_{x\rightarrow 0^+}g(x)=0\quad\text{and}\quad \lim_{x\rightarrow 0^+}h(x)=1\,.$$

Most inequalities in elementary analysis are derived from Taylor series which are unfortunately typically only good near a point and pretty much useless far away from that point. Thus things like $1+x\leq e^x$ aren't very much help in this problem since the inequality posed is very exact on its entire domain. We need more precision.

Let us define the polynomials below $$p(x)=a_2x^2+a_1x+a_0\quad\text{and}\quad q(x)=b^2x^2+b_1x+b_0$$ where $$a_2=\frac{1-\ln 2}{\ln^2 2},\quad a_1=a_0=1, $$ $$b_2=\frac{-4+e+\ln 4}{(\ln 2-1)^2}\,\quad b_1=\frac{2(1-\ln^2 2-e\ln 2+\ln 4}{(\ln 2-1)^2},\quad b_0=\frac{2+2\ln^2 2+e\ln^2 2-6\ln 2}{(\ln 2-1)^2}\,.$$ Why would we do this for any sensible reason? These polynomials are actually fairly easy to reverse engineer. They were specifically constructed to satisfy the properties below. $$p(0)=p'(0)=1=e^0=(\exp)'(0)\quad\text{and}\quad p(\ln 2)=2=e^{\ln 2}$$ $$q(\ln 2)=q'(\ln 2)=e^{\ln 2}=2\quad\text{and}\quad q(1)=e=e^1\,.$$ These constructions make $p$ a good approximation for $e^x$ at $0$ and at $\ln 2$ but also on $[0,\ln 2]$ (which is the range of $g$). Likewise, $q$ is a good approximation for $e^x$ at $\ln 2$ and at $1$ but also on $[\ln 2, 1]$ (which is the range of $h$). They are also upper bounds for $e^x$ on the first and latter intervals as well. With these polynomials in hand, we can conclude $$(1+1/x)^x+(1+x)^{1/x}=e^{g(x)}+e^{h(x)}\leq p(g(x))+q(h(x))$$ Therefore, $$f(x)\leq a_2x^2\ln^2(1+1/x)+x\ln(1+1/x)+1+b_2\frac{\ln^2(1+x)}{x^2}+b_1\frac{\ln(1+x)}{x}+b_0\,.$$ We already have here far more separation than we had in our original inequality. Now we try to start using cruder estimates. For example, $$x\ln(1+1/x)\leq \ln 2\cdot\sqrt[4]{x}\quad\text{and}\quad x\ln(1+1/x)\leq\ln2\cdot\sqrt{x}$$ could be used. Graphing software seems to hint that these crude replacements won't harm anything (the endpoint limits stay the same and monotonicity is preserved). Thus after simplifying $$f(x)\leq \sqrt{x}+1+b_2\frac{\ln^2(1+x)}{x^2}+b_1\frac{\ln(1+x)}{x}+b_0\,.$$ We now create a new osculatory polynomial for $g$ on $[0,1]$. We can construct $$\frac{\ln(1+x)}{x}\leq \left(\frac{3}{2}-\ln 4\right)x^2+(\ln 8-5/2)x+1=r(x)$$ for all $0\leq x\leq 1$ (preserving limits). This was constructed so that $r(0), r'(0)$, and $r(1)$ coincide with $g(0), g'(0)$, and $g(1)$ respectively.

We now have $$f(x)\leq \sqrt{x}+1+b_2(r(x))^2+b_1(r(x))+b_0\,.$$ Graphing software seems to indicate that this latter (almost) polynomial is less than or equal to $4$ for all $0\leq x\leq 1$. Which seems quite approachable with elementary analysis and numerical approximations of numbers.

But before I went onto this part, Alvin provided convexity and a far easier argument. Thus I could stop. But I haven't seen this approach to problem solving elsewhere. And this could help someone when convexity can't be found.