... there are two d so d2
Yes, but be clear that when you say "two d" you mean d*d not 2d.
No. Look at what Alan did:
He multiplied 5d(outside the bracket) by 2(inside the bracket), like this:
5d X 2=10d, that's the first term.
Then he mutiplied 5d by the second term inside the bracket(3d) like this:
5d X 3d=15d^2. All he did was to multiply 5 X 3=15 and then d X d =d^2.
Then you just put them together:15d^2. Remember this means: 15 X d^2.
So the whole expression becomes: 10d - 15d^2