Yes, you can use the quadratic formula for every
quadratic equation.
Now, it can be also important to know why you're calculating the discriminant. Probably you'll lear more about that.
But if you calculate:

which can be solved with the quadratic formula, you're calculing the point(s) where the parabola intersects the x-axis, because there

, now you can distinguish tree cases:
-

, the parabola doesn't intersects the x-axis at all, so there are no intersect points and so no solution.
-

, there parabola intersects the x-axis, there are two equal solutions.
-

, the parabola intersects the x-axis, there are two different intersect points and so two different solutions.