$ = \left( {1 + \sin \theta \cos \theta } \right) - \cos \theta \left( {\sin \theta - \cos \theta } \right) + 1\left( { - {{\sin }^2}\theta + 1} \right)$
$ = 1 + \sin \theta \cos \theta + \sin \theta \cos \theta + {\cos ^2}\theta - {\sin ^2}\theta + 1$
$ = 2 + 2\sin \theta \cos \theta + \cos 2\theta $
$ = 2 + \sin 2\theta + \cos 2\theta \,\,\,\,\,\,\,\,\,......\left( 1 \right)$
Now, maximum value of $(1)$
is $2 + \sqrt {{1^2} + {1^2}} = 2 + \sqrt 2 $
and minimum value of $(1)$ is
$2 - \sqrt {{1^2} + {1^2}} = 2 - \sqrt 2 $.