# Also I would suggest a better way: rewriting the function as 3(x^2-4x+11/3) 3(x^2-4x+4-4+11/3) 3(x^2-4x+4 -1/3) 3(x-2)^2 -1 This is also just completing the square