there are two ways this can happen

a) you pick a black ball from X and pick a white ball from Y

b) you pick a white ball from X and pick a white ball from Y

in (a)

A black ball is picked from bag X with probability 5/8.

bag Y then has 5 black balls and 7 white balls when the pick is made. Thus the probability of picking a white ball is 7/12.

The probability of this chain is thus 5/8 * 7/12 = 35/96

in (b)

A white ball is picked from bag X with probability 3/8

bag Y then has 4 black balls and 8 white balls. Thus the probability of picking a white ball is 7/12

The probability of this chain is thus 3/8 * 8/12 = 24/96

The overall probability of picking a white ball from bag Y is the sum of these two, i.e.

(35+24)/96 = 59/96