We have z2-z(z+3)+3z. We have to remember order of operation. First operation inside the parenthesis, then multiply/divide and finaly add/subtract.
Lets do this
[tex]z^2-z(z-3)+3z[/tex]
First we have to multiply -z by each argument inside the parenthesis.
[tex]z^2-z^2+3z+3z=6z[/tex]
Finally we can simplify z^2 with -z^2 and 3z with 3z to get the result 6z.