Find the integral by interpreting the integral in terms of sums and/or differences of areas of elementary figures. 
Problem: You are given the four points in the plane $A=(2,−5)$, $B=(7,1)$, $C=(12,−7)$, and $D=(14,1)$. The graph of the function $f(x)$ consists of the three line segments AB, BC and CD. Find the integral $\int_2^{14} f(x) dx$ by interpreting the integral in terms of sums and/or differences of areas of elementary figures.

I understand that I need to find the slopes of AB, BC and CD using $m=\frac{y_2-y_1}{x_2-x_1}$. I've recently studied Integration, Integration by substitution and Integration by parts. How do I use the slopes to $\int_2^{14} f(x) dx$ ? I don't understand how to apply it.
Any tips would help, if this pisses you off, please move on.
 A: As we know, integral can be interpretted as a net area under the curve, so as you are asked in the question, you just need to carefully decompose $f(x)$ into elementary figures and then compute their areas.
In your example, it would seem to be logical to write the integral as
$$
\int_2^{14} f(x)dx = \int_2^{7} f(x)dx + \int_7^{12} f(x)dx + \int_{12}^{14} f(x)dx
$$
since these are exactly the line segments between 4 points. However, we can note that $f(x)$ changes its sign three times, which is important for us since the integral is a net area. So more convenient way would be to first find zeroes of $f(x)$ and then divide the segment $[2, 14]$ according to these zeroes.
First zero clearly is between 2 and 7. Since the slope of the line between A and B is $(1-(-5))/(7-2) = 6/5$, we find that $f(x) = 0$ when $y = 6x/5 + -7.4, y = 0$, so $x = 37/6$.
Similarly, the second zero is between 7 and 12, on that segment $f(x)$ can be written as $y = -8x/5+12.2$, so $f(x) = 0$ when $x = 61/8$.
Finally, the third zero is between 12 and 14, on that segment $f(x)$ can be written as $y = 4x-55$, so $f(x) = 0$ when $x = 55/4$.
Now we can write
$$
\int_2^{14} f(x)dx = \int_2^{37/6} f(x)dx + \int_{37/6}^{61/8} f(x)dx + \int_{61/8}^{55/4} f(x)dx + \int_{55/4}^{1} f(x)dx
$$
and note that each of these four integrals represents an area of a triangle, which can easily be computed. Namely, on $[2, 37/6]$ the height is $-5$ (y-coordinate of the point A) while the length is $37/6-2 = 25/6$, thus the area is $-5*25/6*1/2 = -125/12$. Doing the same operations with other parts we will get areas $1 * (61/8-37/6) * 1/2 = 35/48$, $-7 * (55/4-61/8) * 1/2 = -343/16$ and $1 * (14 - 55/4) * 1/2 = 1/8$, so the total area would be $-125/12+35/48-343/16+1/8 = -31$.
