# 007B Sample Midterm 1, Problem 5 Detailed Solution

Find the area bounded by  $y=\sin(x)$ and  $y=\cos(x)$ from  $x=0$ to  $x={\frac {\pi }{4}}.$ Background Information:
1. You can find the intersection points of two functions, say  $f(x),g(x),$ by setting  $f(x)=g(x)$ and solving for  $x.$ 2. The area between two functions,  $f(x)$ and  $g(x),$ is given by  $\int _{a}^{b}f(x)-g(x)~dx$ for  $a\leq x\leq b,$ where  $f(x)$ is the upper function and  $g(x)$ is the lower function.

Solution:

Step 1:
We start by finding the intersection points of these two functions.
So, we consider the equation  $\sin x=\cos x.$ In the interval  $0\leq x\leq {\frac {\pi }{4}},$ the solutions to this equation are
$x=0$ and  $x={\frac {\pi }{4}}.$ Also, for  $0 we have

$\sin(x)<\cos(x).$ Step 2:
The area bounded by these functions is given by

$\int _{0}^{\frac {\pi }{4}}\cos x-\sin x~dx.$ Then, we integrate to get
${\begin{array}{rcl}\displaystyle {\int _{0}^{\frac {\pi }{4}}\cos x-\sin x~dx}&=&\displaystyle {\sin x+\cos x{\bigg |}_{0}^{\frac {\pi }{4}}}\\&&\\&=&\displaystyle {\sin {\bigg (}{\frac {\pi }{4}}{\bigg )}+\cos {\bigg (}{\frac {\pi }{4}}{\bigg )}-(\sin(0)+\cos(0))}\\&&\\&=&\displaystyle {{\frac {\sqrt {2}}{2}}+{\frac {\sqrt {2}}{2}}-1}\\&&\\&=&\displaystyle {{\sqrt {2}}-1.}\end{array}}$ ${\sqrt {2}}-1$ 