# "We want to find:" #
# \qquad \qquad \qquad int \ ( 1 /{ 1 + sin x + cos x } ) \ dx. #
# "We can proceed as follows:" #
# \qquad int \ 1 /{ 1 + sin x + cos x } \ dx #
# \qquad \qquad \quad \ = \ int \ ( 1 /{ 1 + sin x + cos x } ) cdot ( { 1 - ( sin x + cos x ) } /{ 1 - ( sin x + cos x ) } ) \ dx #
# \qquad \qquad \qquad = \ int \ { 1 - ( sin x + cos x ) } /{ ( 1 + sin x + cos x ) ( 1 - ( sin x + cos x ) ) ) \ dx #
# \qquad \qquad \qquad = \ int \ { 1 - ( sin x + cos x ) } /{ 1 - ( sin x + cos x )^2 ) \ dx #
# \qquad \qquad \qquad = \ int \ { 1 - ( sin x + cos x ) } /{ 1 - ( sin^2 x + 2 sinx cos x + cos^2 x ) } \ dx #
# \qquad \qquad \qquad = \ int \ { 1 - ( sin x + cos x ) } /{ 1 - ( sin^2 x + cos^2 x + 2 sin x cos x ) } \ dx #
# \qquad \qquad \qquad = \ int \ { 1 - ( sin x + cos x ) } /{ 1 - ( 1 + 2 sin x cos x ) } \ dx #
# \qquad \qquad \qquad = \ int \ { 1 - ( sin x + cos x ) } /{ color{red}cancel{1} - color{red}cancel{1} - 2 sin x cos x } \ dx #
# \qquad \qquad \qquad = \ - int \ { 1 - ( sin x + cos x ) } /{ 2 sin x cos x} \ dx #
# \quad = \ - int \ ( { 1 } /{ 2 sin x cos x } - { color{red}cancel{ sin x } } /{ 2 color{red}cancel{ sin x } cos x } - { color{red}cancel{ cosx } } /{ 2 sin x color{red}cancel{ cosx } } ) \ dx #
# \quad = \ - int \ ( { 1 } /{ sin 2 x } - { 1 } /{ 2 cos x } - { 1 } /{ 2 sin x } ) \ dx #
# \quad \ = \ - int \ ( csc 2 x - 1/2 sec x - 1/2 csc x ) \ dx #
# \quad \ = \ - ( - 1/2 ln | csc 2 x + cot 2 x | - 1/2 ln | sec x + tan x | #
# \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad + 1/2 ln | csc x + cot x | ) #
# \quad \ = \ 1/2 ( \ ln | csc 2 x + cot 2 x | + ln | sec x + tan x | #
# \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad - ln | csc x + cot x | \ ) #
# \quad \ = \ ln \sqrt{ { | csc 2 x + cot 2 x | cdot | sec x + tan x | } / { | csc x + cot x | } } #
# \quad \ = \ ln \sqrt{ { | { 1 + cos 2 x } / { sin 2 x } | cdot | { 1 + sin x } / { cos x } | } / { | { 1 + cos x } / { sin x } | } } #
# \quad \ = \ ln \sqrt{ | { { 1 + cos 2 x } / { sin 2 x } cdot { 1 + sin x } / { cos x } } / { { 1 + cos x } / { sin x } } | } #
# \quad \ = \ ln \sqrt{ | { 1 + cos 2 x } / { sin 2 x } cdot { 1 + sin x } / { cos x } cdot { sin x } / { 1 + cos x } | } #
# \quad \ = \ ln \sqrt{ | { ( sin^2 x + cos^2 x ) +( cos^2 x - sin^2 x ) } / { sin 2 x } cdot { 1 + sin x } / { cos x } cdot { sin x } / { 1 + cos x } | } #
# \quad \ = \ ln \sqrt{ | { color{red}cancel{ sin^2 x } + cos^2 x +cos^2 x - color{red}cancel{ sin^2 x } } / { sin 2 x } cdot { 1 + sin x } / { cos x } cdot { sin x } / { 1 + cos x } | #
# \quad \ = \ ln \sqrt{ | { color{red}cancel{ 2 } color{red}cancel{ cos^2 x } } / { color{red}cancel{ 2 } color{red}cancel{ sin x } color{red}cancel{ cos x } } cdot { 1 + sin x } / { color{red}cancel{ cos x } } cdot { color{red}cancel{ sin x } } / { 1 + cos x } | } #
# \quad \ = \ ln \sqrt{ | { 1 + sin x } / { 1 + cos x } | }\quad . #
# "So, at last !! :" #
# \quad \ int \ ( 1 /{ 1 + sin x + cos x } ) \ dx \ = \ ln \sqrt{ | { 1 + sin x } / { 1 + cos x } | } + C \quad. \quad \ square #