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.

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}$.
