3. Using the notation $\frac{\pi}{2}-x=t$ we get

$I=\int_{0}^{\frac{\pi}{2}} \frac{\cos ^{2} t+\cos t}{\cos t+\sin t+1} \mathrm{dt}=\int_{0}^{\frac{\pi}{2}} \frac{1+\cos t+\sin t-\sin ^{2} t-\sin t}{\cos t+\sin t+1} \mathrm{dt}=$

$\int_{0}^{\frac{\pi}{2}}\left(1-\frac{\sin ^{2} t+\sin t}{\cos t+\sin t+1}\right) d t=\frac{\pi}{2}-I$

Thus $2 I=\frac{\pi}{2}$ and $I=\frac{\pi}{4}$

$.7 p$
3. Calculate:

$$
I=\int_{0}^{\frac{\pi}{2}} \frac{\sin ^{2} x+\sin x}{\sin x+\cos x+1} d x
$$