# Maximum value of $\frac{x}{y+1}+\frac{y}{x+1}$ while $0\leq x,y \leq 1$

What is the maximum value of $$\frac{x}{y+1}+\frac{y}{x+1}$$ while $$0\leq x,y \leq 1$$?
Wolfram Alpha plots this expression on a 3d graph, but I want to solve it algebraicly, by modifying the expression
My Attempts
1) add and substract 2 at the equation and we get $$\frac{x+y+1}{y+1}+\frac{x+y+1}{x+1}$$ and the numerator is same
=>failed
2) use AM-GM or Cauchy-Schwarz inequality
=>also failed

• Since $x$ and $y$ both vary from $0$ to $1$ you can use one variable calculus. First maximize over $x$ and then over $y$. Dec 14, 2019 at 12:54
• The function is convex in both variables, so that the maximum is attained at one of the corners of the quadrilateral. Dec 14, 2019 at 13:07

When $$0\le x,y \le 1$$, then $$\frac{x}{y+1} \le \frac{x}{x+y}$$ $$\frac{y}{x+1} \le \frac{y}{x+y}$$ Adding them we have $$\frac{x}{y+1}+\frac{y}{x+1} \le \frac{x+y}{x+y}=1.$$

Equality holds when $$x=0$$ and $$y=1$$ or $$x=1$$ and $$y=0$$ and the maximum of $$1$$ is attained.

It is $$\frac{x}{y+1}+\frac{y}{x+1}\le 1$$ since $$x(x+1)+y(y+1)\le (x+1)(y+1)$$ This is equivalent to $$0\le x(1-x)+(1-y)(1-x+y)$$

• Why is $x(x+1)+y(y+1)\le (x+1)(y+1)$? Dec 14, 2019 at 12:46
• $\frac{x}{\color{#25f}{y+1}}+\frac{y}{\color{#d05}{x+1}}\le 1 \implies x\color{#d05}{(x+1)}+y\color{#25f}{(y+1)}\le\color{#d05}{(x+1)}\color{#25f}{(y+1)}$ Dec 14, 2019 at 12:50
• You must say that value $1$ is actually obtained for $x=y=1$. Dec 14, 2019 at 13:04

Given the function $$f : \mathcal{D} \to \mathbb{R}$$ of law:

$$f(x,\,y) := \frac{x}{y + 1} + \frac{y}{x + 1}\,,$$

with $$\mathcal{D} := [0,\,1] \times [0,\,1]$$, since:

$$\nabla f(x,\,y) = \left(\frac{1}{y + 1} - \frac{y}{\left(x + 1\right)^2}, \; \frac{1}{x + 1} - \frac{x}{\left(y + 1\right)^2}\right) \ne (0,\,0) \; \; \forall \, (x,\,y) \in D$$

it follows that f has no critical points inside $$\mathcal{D}$$.

So, studying $$f$$ on the boundary of $$\mathcal{D}$$, noting that:

$$f'(0,\,t) = f'(t,\,0) = 1\,, \; \; \; f'(1,\,t) = f'(t,\,1) = \frac{1}{2} - \frac{1}{(t + 1)^2}$$

with $$0 < t < 1$$, $$f$$ has two critical points of coordinates $$\left(1,\,\sqrt{2}-1\right)$$, $$\left(\sqrt{2}-1, \; 1\right)$$, to which must be added the critical points placed in the four vertices of $$\mathcal{D}$$: $$(0,\,0)$$, $$(1,\,0)$$, $$(1,\,1)$$, $$(0,\,1)$$. This done, noting that:

$$f\left(1,\,\sqrt{2}-1\right) = f\left(\sqrt{2}-1,\,1\right) = \sqrt{2} - \frac{1}{2}, \\ f(0,\,0) = 0, \; \; f(1,\,0) = f(1,\,1) = f(0,\,1) = 1$$

since $$f$$ is a continuous function in $$\mathcal{D}$$, set closed and bounded, by Weierstrass's theorem:

$$\underset{\mathcal{D}}{\min} f = 0 \; \; \; \; \; \; \underset{\mathcal{D}}{\max} f = 1$$

as easily verifiable also in Wolfram Mathematica by the following code:

DensityPlot[x/(y + 1) + y/(x + 1), {x, 0, 1}, {y, 0, 1},
FrameLabel -> {x, y}, PlotLegends -> Automatic]


Since $$\delta\left(\frac{x}{y+1}+\frac{y}{x+1}\right) =\left(\frac1{y+1}-\frac{y}{(x+1)^2}\right)\delta x +\left(\frac1{x+1}-\frac{x}{(y+1)^2}\right)\delta y$$ to get an interior critical point, we need $$\frac1{y+1}=\frac{y}{(x+1)^2}\quad\text{and}\quad\frac1{x+1}=\frac{x}{(y+1)^2}$$ which have only the singular solution $$x=y=-1$$, which, even if allowed, are outside of $$[0,1]\times[0,1]$$. Therefore, we are searching for boundary critical points.

Due to the symmetry, we need only consider $$x=0$$ and $$x=1$$.

For $$x=0$$, we get $$\frac{x}{y+1}+\frac{y}{x+1}=y$$ and the maximum is at $$y=1$$.

For $$x=1$$, we get $$\frac{x}{y+1}+\frac{y}{x+1}=\frac1{y+1}+\frac y2$$. Then, the critical point is $$y=\sqrt2-1$$, which gives $$\frac{x}{y+1}+\frac{y}{x+1}=\sqrt2-\frac12\lt1$$. The endpoints $$y\in\{0,1\}$$ both give $$\frac{x}{y+1}+\frac{y}{x+1}=1$$.

Thus, the maximum is $$1$$.