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?

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