$a_1\le a_2\le \cdots \le a_n$ real numbers.
a) Minimize $\sum_{i=1}^n|x-a_i|$
b) Minimize $\max \{|x-a_i|, i=1,\cdots,n\}$
c) Minimize $\sum_{i=1}^n|x-a_i|^2$
d) Maximize $\Pi_{i=1}^n|x-a_i|$
a), if we take the derivative, we get
$$f(x) = \sum_{i=1}^n|x-a_i|\implies \frac{df}{dx} = \mbox{signal(x)}n$$
So the derivative is never $0$, but I can't say that a minimum for this funciton has to have derivative $0$ because this function is not continuously differentiable. However we can see that for $x>0$ the function is increasing and $x<0$ it is decreasing. I understand that the median is the point, but I need to prove analytically that $f$ indeed is smaller than $f$ in every other point. I've seen The Median Minimizes the Sum of Absolute Deviations (The $ {L}_{1} $ Norm) but I found no analytical proofs for the median being the minimizer, only explanations about how to find with some intuition that the median is smaller
b) I don't have an idea about this one
c) $$f(x) = |x-a_1|^2 + |x-a_2|^2 + \cdots + |a-x_n|^2$$
$$\frac{df}{dx} = 2|x-a_1| + \cdots + 2|x-a_n|$$
The derivative is always positive or 0, so the function is always increasing. This one is continuous so by making it equal to $0$ I should try to find points that satisfy the equality. I don't think there exists one, so I would say the derivative is always positive. How should I proceed?
d) The exercise gives no information about a bounary for $x$, so if I pick larger and larger $x$ shouldn't the funciton grow infinitely?
UPDATE:
b)
Let $x^* = \frac{a_1+a_n}{2}$. If $a_1<x<x^*$ then $\max\{|x-a_i|, i=1,\cdots,n\} = a_n-x$ which is decreasing. If $x>x^*$ then $\max\{|x-a_i|, i=1,\cdots,n\} = x-a_1$ which is increasing. Therefore the minimum must be at $x^*$. I think I need to argue better why, for example, $\max\{|x-a_i|, i=1,\cdots,n\} = a_n-x$
I need a more rigorous proof.