Maximum Value Question I have a question about this following question:


Let $a>0$. Show that the maximum value of $f(x):=\frac{1}{1+|x|}+\frac{1}{1+|x-a|}$ is $\frac{2+a}{1+a}$


I am wondering if I am headed in the right direction with the following process. I first adress the issue of the absolute values by rewriting the function:
$$f(x)=:\frac{1}{1+\sqrt{x^{2}}}
+\frac{1}{1+\sqrt{(x-a)^{2}}}$$
I then take the derivative of $f(x)$, which yields:
$$f'(x)=\frac{a-x}{(1+\sqrt{(a-x)^{2}})^{2}\sqrt{(a-x)^{2}}}+\frac{x}{\sqrt{x^{2}}(1+\sqrt{x^{2}})^{2}}$$
The derivative I've taken from Wolfram Alpha for the moment. I am a bit confused about my next step, though I have an idea. Would I input $\frac{2+a}{1+a}$ into the first derivative, which should give me back zero? This would show that there is a maximum or minimum at that point. The next step being to check the value of the second derivative to show that it is indeed a maximum? I suppose this still wont show that $\frac{2+a}{1+a}$ is the global maximum.
 A: This was a response to the question $f(x):=\frac{1}{1+|x|}-\frac{1}{1+|x-a|}$
Perhaps I am misunderstanding something, but doesn't the graph look something like this?

If $x \le 0 $ then $f(x)=\frac{1}{1+|x|}-\frac{1}{1+|x-a|}=\frac{1}{1-x}-\frac{1}{1+a-x} =\frac{a}{(1-x)(1+a-x)}$ which is an positive increasing function for that $x$.
If $0 \le x \le a $ then $f(x)=\frac{1}{1+|x|}-\frac{1}{1+|x-a|}=\frac{1}{1+x}-\frac{1}{1+a-x} =\frac{a-2x}{(1+x)(1+a-x)}$ which is a decreasing function for that $x$, positive for $x\lt a/2$ and negative for $a/2 \lt x$.
If $a \le x $ then $f(x)=\frac{1}{1+|x|}-\frac{1}{1+|x-a|}=\frac{1}{1+x}-\frac{1}{1+x-a} =\frac{-a}{(1+x)(1+x-a)}$ which is a negative but increasing function for that $x$.
So the maximum must occur when $x=0$ and takes the value $f(0)=\frac{a}{1+a}$.
With the change in the question this becomes 
 
and the maximum occurs when $x=0$ or $x=a$ and takes the value $f(0)=\frac{1}{1}+\frac{1}{1+a} = \frac{2+a}{1+a}$.
A: First, note that the limits as $x\to\infty$ and as $x\to-\infty$ of $f(x)$ are $0$. That tells you that the function does have a global maximum and a global minimum, since the function is necessarily bounded (as it is continuous and defined everywhere). 
Once you know that the function does have global extremes, you also know that the global extremes are necessarily local extremes as well. So you can use the usual methods to find the points where the local extremes may be located, namely, the critical points.
The critical points are the points in the domain where the derivative does not exist or is equal to $0$. 
Since you have the derivative, you should then determine what are the points where the derivative does not exist (if any), and the points where the derivative is $0$ (if any).
Once you have this list of points, you can simply plug all of them into the original function: the largest value you get will be the global maximum, the smallest value you get will be the global minimum; this will also tell you where they are located.
So, your next step (after filling in the gap at the beginning of establishing that the function does have global extremes) is to determine the critical points.
