Since the question is asking about the area of a region in the plane, we must be careful not to compute a singed area. The easiest way to do this is to use an absolute value.

By drawing a picture, we see that

and

, which shows us that there is some

for which

. This is precisely

. Therefore, we have
![{\displaystyle {\begin{aligned}A&=\int _{0}^{\frac {\pi }{4}}|\sin(x)-\cos(x)|\;\mathrm {d} x+\int _{\frac {\pi }{4}}^{\pi }|\sin(x)-\cos(x)|\;\mathrm {d} x\\&=\int _{0}^{\frac {\pi }{4}}(\cos(x)-\sin(x))\;\mathrm {d} x+\int _{\frac {\pi }{4}}^{\pi }(\sin(x)-\cos(x))\;\mathrm {d} x\\&={\big [}\sin(x)+\cos(x){\big ]}_{x=0}^{x={\frac {\pi }{4}}}+{\big [}-\cos(x)-\sin(x){\big ]}_{x={\frac {\pi }{4}}}^{x=\pi }\\&={\sqrt {2}}-1+1+{\sqrt {2}}\end{aligned}}}](https://wiki.ubc.ca/api/rest_v1/media/math/render/svg/f15d919da1593ca2ee1a02d92d3a5592dba665e4)
We find then that the area enclosed between the two curves is
.