The current that enters an element is shown. Find the charge that enters the element in the time interval 0 < t < 20 s.

Image from: J. D. Irwin and R. M. Nelms, Basic engineering circuit analysis, 10th ed. Hoboken, NJ: John Wiley, 2011.
Solution:
The charge that enters the element can be found by finding the area under the graph. There are two ways to do so. The first is to simply find the area of the square and the triangle and add it together. The second is to find the equation of the straight segment, and then the equation of the negative slop line, and take the integral. We will use the first method since this is a simple graph.
Area of the red square:
(Remember, 10 mA = 0.01 A)
Area of the blue triangle:
(Remember, area of a triangle is \dfrac{1}{2}bh, where b is base and h is height)
Thus, the total charge that enters the element is 0.15 C.