The best method that will work for any quadratic equation is to use the quadratic formula: x = (-b±√(b² - 4ac))/2a, this will work for any quadratic of the form ax² + bx + c = 0.
As for the last equation in the attachment, that is a cubic equation, these are much trickier to solve and as such the formula is much longer and very complicated. Therefore it is easier to see if it can be broken down into a linear term and a quadratic. This can be done by substituting integer values of x into the equation to see if it holds true. If both sides of the equation are equal for a given value of x then the equation ax³ + bx² + cx + d can be rewritten as (Ax + B)(px² + qx + r). This can then be put into the quadratic formula mentioned above.