I am having trouble with the following equation from Russel and Norvig's AI textbook:
For the first equality, I believe they are converting to joint probability, using marginalization, and then using the chain rule. However, I am not entirely sure where they get the second equality from. When I do it, I don't see how to break up the $ P(X|d,h_i) $ term and I think that is the key issue. Could anyone help with this?