The function image passes through the symmetry point (4,0) about x=2.
So let y=ax(x-4)
y=a(x-2)^2-4a
Because there is a maximum value of 2.
Open down
A "0"
When x=2, take the maximum value -4a=2.
So a=- 1/2.
therefore
Analytical formula y =-x 2/2+2x