How to solve problems with the distrbutive property with variables?