Answer
(a). $ a^{2} - 3a -4$
(b). $ \cos^{2}\theta - 3\cos\theta -4$
Work Step by Step
(a). Given expression is-
$ (a+1) (a-4)$
= $ a^{2} -4a +a -4$
( By FOIL method)
= $ a^{2} - 3a -4$
(b). Given expression is-
$ (\cos\theta+1) (\cos\theta-4)$
= $ \cos^{2}\theta -4\cos\theta +\cos\theta -4$
( By FOIL method)
= $ \cos^{2}\theta - 3\cos\theta -4$