From my textbook, by using distributive law, its able to simplify:
$[(p \land \lnot q) \lor (p \land q)] \land q$
To:
$[p \land (\lnot q \lor q)] \land q $
I don't know how to get to this step, and here is how I've tried by distributing the first expression :
$[(p \lor p) \land (p \lor q) \land (\lnot q \lor p) \land (\lnot q \lor q)] \land q$
If I try continue to expand this, it will become very complex. I think I'm doing this in the wrong way and I will appreciate it very much if anyone can explain how the textbook got the simplified answer.
Thanks



The Distributive law goes both ways, because it is an equivalence.
That is, using the Distributive Law you can go from $p \land (\neg q \lor q)$ to $(p \land \neg q) \lor (p \land q)$, but you can use that same Distributive Law to go from the latter to the former, and that is what they did here.
I believe the name is somewhat to blame for the fact that so many students, like you, only think of the Distributive Law going one way, because going from $(p \land \neg q) \lor (p \land q)$ to $p \land (\neg q \lor q)$ does not feel like Distribution, but rather as a kind of 'Un-Distribution' or 'Reverse Distribution', or maybe even 'Taking out a common Factor' ... but it is still called Distribution in logic.