you have 2 equations to work with
1st eq. w + y = 40
2nd eq. w=9y
multiply everything in 1st equation by 9 to get
9w + 9y = 360
rearrange 2nd equation to w-9y=0
now add 9w + 9y = 360 to w-9y = 0
to get 10w=360
dive both sides by 10 to get w=36 white cars