Area between two functions My question is from Apostol's Vol. 1: One-variable calculus with introduction to linear algebra textbook.

Page 94. Exercise 16. Let $f(x)=x-x^2$, $g(x)=ax$. Determine $a$ so that the region above the graph of $g$ and below the graph of $f$ has area $\frac{9}{2}.$

My attempt at a solution. I tried following: $$a(S)=\int_{x_1}^{x_2}[f(x)-g(x)]\mathrm dx=\int_{x_1}^{x_2}x\mathrm dx-\int_{x_1}^{x_2}x^2\mathrm dx-a\int_{x_1}^{x_2}x\mathrm dx=\frac{x_2^2-x_1^2-a(x_1^2-x_2^2)}{2}-\frac{x_2^3-x_1^3}{3}=9/2$$ but this approach gets me nowhere, I graphed both functions, and I realize that $a$ must be negative but without boundaries, on integral, how should I find out what $a$ is, because $a$ changes as $x_1,x_2$ change. Please explain or give some hints.

By graphing the two functions, we can see that the region represented by the volume is:
$$f(x) - g(x) = x-x^2 - ax$$
In order to find the points of intersection, we must set the two graphs equal to one another:
$$x-x^2 = ax \Leftarrow\Rightarrow \ x^2 + x(a - 1) = 0 \Leftarrow\Rightarrow\ x(x + a - 1) =0$$
Therefore, $x = 0 , 1 - a$
Constructing our integral:
$$\int_{0}^{1-a} (x-x^2 - ax)dx = \left[\frac{x^2}{2} - \frac{x^3}{3} -\frac{ax^2}{2}\right]_{0}^{1-a} = \frac{(1-a)^2}{2} - \frac{(1-a)^3}{3} - \frac{a(1-a)^2}{2} = \frac{9}{2}$$
Simplifying we get:
$$\frac{(1-a)^3}{6} = \frac{9}{2}\Leftarrow\Rightarrow 2(1-a)^3 = 54 \Leftarrow\Rightarrow (1-a)^3 = 27$$
Therefore, $a = -2$
