It works because 7 x 9 x 10 is the same thing as 7 x 90, since 9 x 10 is just 90. So basically he is just writing more but the answer will still be the same.
I took a picture of the work instead ^^
With 10 more butter sticks Alan can bake 15 cakes if I'm not mistaken