If a function $f$ defined on $[a,b]$ has an antiderivative $F$ and is Riemann integrable, there is a surprisingly simple way to evaluate the following definite integral regardless of the nature of $f$.
Suppose $a = x_0 \lt x_1 \lt x_2 \lt x_3 \lt \cdots \lt x_n = b$ is a partition of $[a,b]$. We seek to setup a Riemann sum connected to this partition, which requires we choose some $x_i^*$ in the $i^{th}$-subinterval $[x_{i-1},x_i]$ for each $i = 1,2,\ldots,n$.
Consider the aforementioned antiderivative $F$. Note, as $F$ is differentiable on $[a,b]$ (with $F'(x) = f(x)$), $F$ must be both continuous and differentiable on each subinterval $[x_{i-1},x_i]$. (Remember, differentiability on a closed interval implies continuity on that same interval.)
Consequently, the conditions of the mean value theorem relative to $F(x)$ and each subinterval $[x_{i-1},x_i]$ are satisfied. There must then exist some $c_i$ in each such interval where
$$F'(c_i) = \frac{F(x_i) - F(x_{i-1})}{x_i - x_{i-1}}$$Let us choose $x_i^* = c_i$ for each $i = 1,2,\ldots,n$, and note that $x_{i}-x_{i-1} = \Delta x_i$ and $F'(c_i) = F'(x_i^*) = f(x_i^*)$. Thus,
$$f(x_i^*) = \frac{F(x_i) - F(x_{i-1})}{\Delta x_i}$$Now consider what this means for the definite integral $\int_a^b f(x)\,dx$:
$$\begin{array}{rcl} \displaystyle{\int_a^b f(x)\,dx} &=& \displaystyle{\lim_{||\Delta|| \rightarrow 0} \sum_{i=1}^n f(x_i^*) \Delta x_i}\\\\ &=& \displaystyle{\lim_{||\Delta|| \rightarrow 0} \sum_{i=1}^n \frac{F(x_i) - F(x_{i-1})}{\Delta x_i} \cdot \Delta x_i}\\\\ &=& \displaystyle{\lim_{||\Delta|| \rightarrow 0} \sum_{i=1}^n \left[ F(x_i) - F(x_{i-1} \right] \quad \quad \scriptsize{\textrm{ which is a telescoping sum that collapses to...}}}\\\\ &=& F(x_n) - F(x_0)\\\\ &=& F(b) - F(a) \end{array}$$This result allows us to evaluate a definite integral by simply finding an antiderivative and evaluating the difference between the values of this antiderivative at the endpoints of the interval in question! This result is so powerful and important, it forms one half of the Fundamental Theorem of Calculus.
(The fundamental theorem of calculus is actually two closely-related theorems; the result just proven is traditionally the second of these two.)As a useful aid when evaluating definite integrals using this result, let us adopt the following notation
$$F(x)\,\bigg\rvert_a^b = F(b) - F(a)$$Let's take a look at two quick examples:
Evaluate $\displaystyle{\int_0^{\pi/2} \cos x\,dx}$
Evaluate $\displaystyle{\int_2^6 (3x^2-5x)\,dx}$