Viete's formulas exist for all algebraic equations. `x_1+x_2+x_3=-b/a` is one of the formulas for 3rd degree polynomial equation (for quadratic equation equivalent formula is `x_1+x_2=-b/a,` that's the reason you get 0 - there are only two solutions to quadratic equation).

Now to prove the formula.

First we write general cubic equation.

`ax^3+bx^2+cx+d=0`

Now because of the fundamental theorem of algebra this is equivalent to

`a(x-x_1)(x-x_2)(x-x_3)=0`

Multiply terms in first two parethesis.

`a(x^2-(x_1+x_2)x+x_1x_2)(x-x_3)=0`

Now multiply terms in remaining two parentesis.

`a(x^3-x_3x^2-(x_1+x_2)x^2+x_3(x_1+x_2)x+x_1x_2x-x_1x_2x_3)=0`

Group the terms with the same power of `x` and multiply everything by `a.`

`ax^3-a(x_1+x_2+x_3)x^2+a(x_1x_2+x_1x_3+x_2x_3)x-ax_1x_2x_3=0`

Since this equation is equivalent to the first equation it follows that

`-a(x_1+x_2+x_3)=b`

`x_1+x_2+x_3=-b/a`

You can similarly prove other Viete's formulas.

` ` `x_1x_2+x_1x_3+x_2x_3=c/a`

`x_1x_2x_3=-d/a`

Q.E.D.