# Maximum minimum value of a modulus function

Let $f(x)= \dfrac1{1+|x|} + \dfrac1{1+|x-1|}$ for all $x$ in $[-1,1]$. Then the maximum and minimum value of function is?

• As $x<1, |x-1|=1-x$ – lab bhattacharjee Feb 4 '17 at 3:11

Separate the function in two pieces, $x\leq0$ and $x\geq0$.

First, let's compute the maximum:

For $x\leq0$, $|x|=-x$ and $|x-1|=1-x$, so

$$f(x)=\frac{1}{1-x}+\frac{1}{1+1-x}=\frac{1}{1-x}+\frac{1}{2-x}.$$

Its second derivative is

$$f''(x)=2\left(\frac{1}{(1-x)^3}+\frac{1}{(2-x)^3}\right)>0.$$

It is strictly positive in all $x\in[-1,0]$, so it is convex, so the maximum over the interval $[-1,0]$ must be on one of the boundaries.

Same for the interval $x\in[0,1]$:

$$f(x)=\frac{1}{1+x}+\frac{1}{1+1-x}=\frac{1}{1+x}+\frac{1}{2-x},$$

$$f''(x)=2\left(\frac{1}{(1+x)^3}+\frac{1}{(2-x)^3}\right)>0.$$

Again, it is convex, so the maximum over this interval must be on the boundaries.

Now we need to evaluate only three points which are candidate to being the maximum: -1, 0 and 1.

$$f(-1) = \frac{1}{2}+\frac{1}{3} = 0.8333,$$ $$f(0) = \frac{1}{1}+\frac{1}{2}=1.5,$$ $$f(1) = \frac{1}{2}+\frac{1}{1} = 1.5.$$

So it has two maxima over this interval, corresponding to the points $x=0$ and $x=1$.

Now, let's compute the minimum:

Over $[-1,0]$, the first derivative is

$$f'(x)=\frac{1}{(1-x)^2}+\frac{1}{(2-x)^2}>0.$$

Since it is positive, the function is strictly increasing, so the minimum over this interval must be on $x=-1$.

Over $[0,1]$, the derivative is

$$f'(x)=-\frac{1}{(1+x)^2}+\frac{1}{(2-x)^2}.$$

We solve for $f'(x)=0$ to find the local minimum (remember that the function is convex over this interval) and find $x=\frac{1}{2}$.

So we have two candidates to evaluate as minimum, one for each interval: $$f(-1)=0.8333,$$ $$f\left(\frac{1}{2}\right)=\frac{1}{1+\frac{1}{2}}+\frac{1}{1+\frac{1}{2}}=1.3333.$$

So the minimum is at $x=-1$.