Let $f(x)=\big(|x+a|-|x+2|+b|x+5| \big)$ be an odd function then find $a+b$ Let $f(x)=\big(|x+a|-|x+2|+b|x+5| \big)$ be an odd function then find $a+b$.
My try :
$$\begin{align}f(-x)&=|-x+a|-|-x+2|+b|-x+5| \\ &=-f(x) \\&= -\big(|x+a|-|x+2|+b|x+5| \big)  \end{align}$$
$$|-x+a|-|-x+2|+b|-x+5|+ \big(|x+a|-|x+2|+b|x+5|) =0$$
Now what do I do?
 A: Since, $f(-x)=-f(x),$ we obtain:
$$|x-a|-|x-2|+b|x-5|+|x+a|-|x+2|+b|x+5|=0.$$
Now, for $x=2$ we obtain:
$$10b+|a-2|+|a+2|-4=0$$ and for $x=5$ we obtain:
$$10b+|a-5|+|a+5|-10=0,$$ which gives
$$|a-2|+|a+2|=|a-5|+|a+5|-6$$ or
$$-2\leq a\leq2,$$ which gives$$b=0.$$
Thus, $$f(x)=|x+a|-|x+2|$$ and
$$|x-a|-|x-2|+|x+a|-|x+2|=0,$$ which for $x=0$ gives
$$|a|=2$$ and we see that $a=2$ and $a=-2$ they are valid.
Id est, $a+b=2$ or $a+b=-2.$
A: You can equate the slopes for small and large $x$ and
$$-1+1-b=1-1+b$$ so that $b=0$.
Then
$$f(x)=|x+a|-|x+2|$$ odd requires $|a|=2$ to ensure that $f(0)=0$. 
By direct check, $f(x)=|x-2|-|x+2|$ or $f(x)=|x+2|-|x+2|=0$ are indeed odd.
A: The condition $f(-x)=-f(x)$, i.e.,
$$|-x+a|-|-x+2|+b|-x+5|=-(|x+a|-|x+2|+b|x+5|)$$
is equivalent to
$$|x+a|+|-x+a|+b|x+5|+b|-x+5|=|x+2|+|-x+2|$$
which can be rewritten as
$$(|x+|a||+|x-|a||)+b(|5+x|+|5-x|)=|x+2|+|x-2|$$
Now think of each side of this equation as the formula for a continuous function whose derivative fails to exist only at values of $x$ where the linear expression inside an absolute value sign takes the value $0$. For the function on the right hand side, the derivative fails to exist at $x=\pm2$ (and exists for all other values of $x$).  Since $5\pm2\not=0$, the only way that the derivative of the left hand function can fail to exist at $x=\pm2$ is if $a=\pm2$.  But if $b\not=0$, the derivative of the left hand function will also fail to exist at $x=\pm5$, where the right hand function has a well defined derivative. Thus $b=0$ and $a=\pm2$, hence $a+b=\pm2$.
A: The function $\phi(x):=|x+a|-|x+2|$ is $\ \equiv a-2$ when $x\gg1$ and is $\ \equiv2-a$ when $x\ll-1$. On the other hand $|x|\gg1$ implies ${\rm sgn}\bigl(b|x+5|\bigr)={\rm sgn}(b)$ when $b\ne0$, which is forbidden for an odd function. It follows that necessarily $b=0$.
The graph of $\phi$ has corners at $x=-a$ and at $x=-2$. In order to make $\phi$ odd we can choose $a=2$, which results in $f(x)=\phi(x)\equiv0$, or we can choose $a=-2$ in the hope of obtaining a nontrivial solution of the problem. This second choice results in
$$f(x)=\phi(x)=|x-2|-|x+2|=|(-x)+2|-|x+2|\ ,$$
which is obviously odd.
It follows that the possible values of $a+b$ are $\pm2$.
