Calculating area trapped between $g(x)=\frac{8x}{\pi}+\frac{\sqrt{2}}{2}-1$ and $f(x)=\sin(2x) $ I want to calculate the area trapped between $f(x)$ and $g(x)$ while
$$
0\leq x\leq\frac{\pi}{4}
$$
$$
g(x)=\frac{8x}{\pi}+\frac{\sqrt{2}}{2}-1, \qquad f(x)=\sin(2x)
$$
I`m given a clue to remember that:
$$
\sin\left(\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2}
$$
What I tried:
I compared $f(x)$ and $g(x)$ and didn't find success. I tried to create new function $h(x)=g(x)-f(x)$ to find the cut points but got stuck as well.
 A: The given functions are:
$$ f(x) = \sin 2x, \ \ g(x) = {8 x \over \pi} + {\sqrt{2} \over 2} - 1$$
It is easy to note that
$$
f\left({\pi \over 8} \right) = \sin {\pi \over 4} = {\sqrt{2} \over 2} \ \ \mbox{and}
\ \ f\left({\pi \over 8} \right) = 1 + {\sqrt{2} \over 2} - 1
= {\sqrt{2} \over 2}.
$$
Hence, $f$ and $g$ intersect at $x = {\pi \over 8}$ in the region $\left[ 0, {\pi \over 4} \right]$.
Moreover, $f(x) \geq g(x)$ in the region $0 \leq x \leq  {\pi \over 8} $.
Also, $g(x) \geq f(x)$ in the region $ {\pi \over 4}  \leq x \leq  {\pi \over 4} $.
Hence, the area between the curves $f$ and $g$ is found as
$$
I = I_1 + I_2
$$
where
$$
I_1 = \int\limits_{0}^{\pi \over 8} \ [f(x) - g(x)] \ dx, \ \ \
I_2 = \int\limits_{\pi \over 8}^{\pi \over 4} \ [g(x) - f(x)] \ dx.
$$
A simple integration yields
$$
I_1 = {1 \over 2} - {\sqrt{2} \over 4} - {\pi \over 16} -
\left( {\sqrt{2} \over 2} - 1 \right) {\pi \over 8} \tag{1}
$$
and
$$
I_2 = {3 \pi \over 16} +
\left( {\sqrt{2} \over 2} - 1 \right) {\pi \over 8} - {\sqrt{2} \over 4}. \tag{2}
$$
Adding $(1)$ and $(2)$, we get
$$
I = I_1 + I_2 = {1 \over 2} + {\pi \over 8} - {\sqrt{2} \over 2} = {\pi \over 8} + {1 - \sqrt{2} \over 2},
$$
which is the required area of intersection between $f$ and $g$ in the region, where $0 \leq x \leq {\pi \over 4}$.

A: As you defined it, $h(x) = \frac{8}{\pi}x + \frac{\sqrt{2}}{2} -1 - \sin(2x)$.
Since $h(0)=\frac{\sqrt{2}}{2} -1 <0$ and $h(\frac{\pi}{4}) = \frac{\sqrt{2}}{2} +1>0$, $h$ has at least one root in $[0,\frac{\pi}{4}]$.
Also, $h'(x)=\frac{8}{\pi}-2\cos(2x) \ge \frac{8}{\pi}-2>0$, so $h$ is strictly increasing and therefore its root is unique.
Drawing inspiration from the clue, evaluate $h(\frac{\pi}{8})=0$. This should allow you to correctly define the integrals that define the area trapped between the two functions.
