Long way:
2(x-3)(x+3) = 2(x*x + 3*x - 3*x - 3*3)
2(x-3)(x+3) = 2(x^2 - 9)
2(x-3)(x+3) = 2x^2 - 2*9
2(x-3)(x+3) = 2x^2 - 18
Shortcut way:
Using formula (x+a)(x-a) = x^2 - a^2, where a = 3, in the case of (x+3)(x-3), so we have
(x+3)(x-3) = x^2 - 9.
Then, we multiply that by 2, which gives 2x^2 - 18.