Let the square of function f (x) = x (x-a) have a maximum at x = 2, and find the value of real number a

Let the square of function f (x) = x (x-a) have a maximum at x = 2, and find the value of real number a

F (x) = x (x - a) = x ^ 2 - AX = (x - A / 2) ^ 2 - A ^ 2 / 4 when x = A / 2, f (x) has a minimum. So x = A / 2 = 2 = = > A = 4. Min [f (x)] = - A ^ 2 / 4 = - 4 ^ 2 / 4 = - 4