2.1. Find all values of $a$ for which the quadratic function $f(x)=a x^{2}-2 a x+1$ takes values, the modulus of which does not exceed 2, at all points of the interval $[0 ; 2]$. In your answer, specify the total length of the intervals to which the found values of $a$ belong.
Answer: 4 (the desired set of values for $a:[-1 ; 0) \cup(0 ; 3]$).

Solution. For the function $f(x)$ to be quadratic, it is necessary that $a \neq 0$. The vertex of the parabola, which is the graph of the given function, is located at the point $(1 ; 1-a)$. Since $f(0)=f(2)=1$, the condition of the problem is satisfied if $|1-a| \leqslant 2$, i.e., $-1 \leqslant a \leqslant 3$. Therefore, the desired set of values for $a$ is the union $[-1 ; 0) \cup(0 ; 3]$, and the total length of these intervals is 4.