<s>[INST] Calculate the area enclosed by the curve and line Calculate the are enclosed by ${y = 2x - 1}$ and ${y=  x^2 + 6x + 2}$
First of all I combine the equations into:
${x^2 + 4x + 3 = 0}$
${(x + 3)(x + 1), x = -3,  x = -1}$
They intersect at ${(-3 -7) (-1, -3)}$
I would say that ${y = 2x  -1}$ is the top equation so to work out the area, I would use:
${\int_{-3}^{-1} (2x -1) - (x^2 + 6x + 2) dx}$
=> ${-{x^3\over 3} - 2x^2 - 3x}$
=> ${(-{1\over 3} - 2 + 3) - ({-27 \over 3} -18 + 9)}$
=> ${{2\over 3} - (-18)}$
=> ${18{2\over 3}}$
This is not the correct answer, can anyone point out where I have gone wrong?
 [/INST] First we calculate the intersection points. We know that as long as the line and the parabola intersect, the line will be on top, because the parabola opens upward.
To solve for the intersection points (which will be our limits), we do the following:
$$2x + 1 = x^{2} + 6x + 2$$
$$x^{2} + 4x + 1 = 0$$
$$x = \frac{-4 \pm \sqrt{12}}{2} = -2 \pm \sqrt{3}.$$
We need to evaluate the integral
$$\int_{-2 - \sqrt{3}}^{-2 + \sqrt{3}} \left(-x^{2} - 4x - 1\right)dx.$$
We do this as follows:
$$\left[-\frac{1}{3}x^{3} - 2x^{2} - x\right]_{-2 - \sqrt{3}}^{-2 + \sqrt{3}}$$
$$= \left(2\sqrt{3} - \frac{10}{3}\right) - \left(-2\sqrt{3} - \frac{10}{3}\right)$$
$$= \boxed{4\sqrt{3}}.$$
</s>