<s>[INST] 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?
 [/INST] 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.$
</s>