How do you solve ac-bc-ad+bd

you could group it, then factor

ac-bc-ad+bd
= c(a-b) - d(a-b)
= (a-b)(c-d)

check it by expanding my answer.