the second statement should be written as
$\displaystyle ((p\wedge \neg q)\vee q)\wedge((p\wedge \neg q)\vee \neg p)$
this follows from the first statement using distributive law
Boolean algebra (logic) - Wikipedia, the free encyclopedia
But wouldn't that distribute as $\displaystyle [(p \vee q ) \wedge ( \neg q \vee q)] \wedge [(p \vee \neg p) \wedge ( \neg q \vee \neg p )]$ which isn't the same as the prior step
yes you are right. you have further used the distributive law.
further you can see that
$\displaystyle q\vee \neg q \;\;\mbox{and}\;\; p\vee \neg p $
are tautologies. so we can further simplify as
$\displaystyle (p\vee q)\wedge (\neg p \vee \neg q)$