i am trying to implement a gradient descent algorithm to find possible solutions of an equation
example equation: 2x^2 + 5x + 2 = 0
the minimum of this function is at x=-1.25 which is not the actual solution
in order to get around this, i decided to square the equation
(2x^2 + 5x + 2)^2 = 0
now, the actual solutions have a slope of 0, but the x=1.25 has a slope of 0 as well
how do i get around this