Find the area using integrals 
What is the area defined by the curves $y = \sin x$ and $y = \cos x$ for $0 < x < \frac{\pi}{4}$?

I think it's $$\int_{0}^{\frac{\pi}{4}} [\cos x - \sin x]\, \mathbb{d}x$$ but I'm not sure if my step is right or not.
 A: Notice that $\cos(0)=1,\sin(0)=0$ now find the points for which the two curves intersect:
$$\sin(x)=\cos(x)\Rightarrow \tan(x)=1$$
$$x=\arctan(1)=\pi/4$$
What this means is that for: $0\le x\le \pi/4,\,\cos(x)\ge\sin(x)$. And so if you want the area between two functions that is the same as the integral of the greater function minus the integral of the lesser function, in this case:
$$\int_0^{\pi/4}\cos(x)dx-\int_0^{\pi/4}\sin(x)dx$$
So yes you are correct. If you did it the other way around you would simply end up with a negative value and since we are considering area here it is clear that the sign is just wrong
A: Yes, your integral is correct.  If you have two curves above the $x$-axis on an interval $[a,b]$, then the area between them is given by $$\int_{a}^{b}(\text{top curve} - \text{bottom curve})\,dx.$$
A: To concur with you, and demonstrate visually, I graphed both functions from $-\pi$ to $\pi$:

Between $x= 0$ and $x=\pi/4$, we see that $y=\cos x > y= \sin x$.  So your set up is spot on.  By noting $$\int_{o\to {\pi/4}} (\cos x- \sin x)\,\mathrm dx,$$
we find the area below $y = \cos x$ and subtract the area below $y=\sin x$, giving us the area between the two curves, on that interval.
