We are analyzing the interval [−π,π]. If you sketch sinx and cosx on the same coordinate plane, you will see them crossing each other.
The function f(x)=max{sinx,cosx} acts as a path that always chooses the higher ground. Whenever sinx>cosx, we follow the sine curve; when cosx>sinx, we follow the cosine curve. This creates a composite, jagged boundary.
The Intersection Points
To determine where to switch our path, we solve sinx=cosx, which simplifies to tanx=1.
Within the interval [−π,π], this equality occurs at:
x=−43πandx=4π
These are the critical junctions where our function changes its identity. Mark these points clearly; they serve as the signposts for our integration.
The Hidden Trap of the x-axis
We are calculating the area enclosed by the curve and the x-axis. Because the area must be positive, we must be vigilant about regions where the function dips below the x-axis.
The function cosx crosses the x-axis at x=−2π. To ensure the area is positive, we must take the absolute value of the function, splitting our journey into four distinct intervals:
[−π,−43π],[−43π,−2π],[−2π,4π],and[4π,π]
The Integration
For the first two intervals, the function lies below the x-axis, so we integrate the negative of the function. For the last two, the function is above the axis, so we integrate normally.