Calculating the area For the two graphs $ \frac{x^3+2x^2-8x+6}{x+4} $ and $ \frac{x^3+x^2-10x+9}{x+4} $, calculate the area which is confined by them;
Attempt to solve: Limits of the integral are $1$ and $-3$, so I took the definite integral of the diffrence between $ \frac{x^3+2x^2-8x+6}{x+4} $ and $ \frac{x^3+x^2-10x+9}{x+4} $ since the latter is a graph of a lower-degree polynomial than the first one, but as a result I got a strange negative area result, which is quite funny since the offical answer is $12 -5 \ln5$...
What am I doing wrong? 
Note that in this exercise you need to somehow imagine the two graphs by yourself without the use of any comupters programs or whatever. Hence it is not as trivial to evalutae the position of each graph to the other...
 A: @Mary knows that because $$\frac{x^3+2x^2-8x+6}{x+4} - \frac{x^3+x^2-10x+9}{x+4}=\frac{x^2+2x-3}{x+4}=\frac{(x-1)(x+3)}{x+4}$$ and since on $-3<x<1$ so the last fraction in negative. A simple figure could clear the point.

A: For $-3<x<1$:
$$\frac{x^3+2x^2-8x+6}{x+4} < \frac{x^3+x^2-10x+9}{x+4}$$
So you have to calculate the integral of the difference $\frac{x^3+x^2-10x+9}{x+4}-\frac{x^3+2x^2-8x+6}{x+4}$ to find the area.
EDIT:
$$\frac{x^3+x^2-10x+9}{x+4}-\frac{x^3+2x^2-8x+6}{x+4}=\frac{-x^2-2x+3}{x+4}=-\frac{x^2+4x-2x}{x+4}+\frac{3}{x+4}=-\frac{x(x+4)}{x+4}+\frac{2x}{x+4}+\frac{3}{x+4}=-x+2\frac{x+4-4}{x+4}+\frac{3}{x+4}=-x+2-\frac{5}{x+4}$$
$$\int_{-3}^1 -x+2-\frac{5}{x+4} dx=[-\frac{x^2}{2}+2x-5\ln{|x+4|}]_{-3}^1=-\frac{1}{2}+2-5\ln{5}+\frac{9}{2}+6+5 \ln{1}=12-5\ln{5}$$
A: According to my calculations, you should get the right result by calculating the difference of integrals from $-1$ to $3$, but you must subtract the first one from the second, or take the absolute value of what you get.
However, for future reference, when calculating the area confined between the graphs of say the two integrable functions $f(x)$ and $g(x)$ you must break the integrals where $f(x)-g(x)$ changes sign.
e.g.: if you want to calculate the area confined by your two functions, from $-3$ to $2$, you woud do $$\mid\int_{-3}^{1}f(x)dx-\int_{-3}^{1}g(x)dx\mid+\mid\int_{1}^{2}f(x)dx-\int_{1}^{2}g(x)dx\mid$$
Don't forget to take the absolute value of each difference of integrals, or substract the lesser one from the greater one.
So, as a rule of thumb for this kind of exercises, see if the difference of functions has any roots, and if it has, see if the difference changes its sign when going from the left to the right of one root.
The answer is indeed $12-5\ln 5$.

(this is a plot of the functions, the orange area is $12-5\ln 5$)
A: There are a few things you can pick up from these answers that could be very helpful in future problems.
When you first looked at the problem, you decided to integrate
 $$ \frac{x^3+2x^2-8x+6}{x+4} - \frac{x^3+x^2-10x+9}{x+4}.$$
You expected this to produce a positive number. But in fact if you evaluate
this difference at $x = 0$ you will easily see that the difference is negative.
So you should expect to get a negative answer from the integration of
that difference between the functions unless the
two graphs cross each other somewhere else in the interval $-3 < x < 1$.
Which brings up the point that you really should know where the graphs cross, for
otherwise you might not get the correct answer. (You might subtract part of the area from
the rest, instead of adding all the area together.)
So you must look for zeros of the difference between functions.
That's why it's so important that
$$\frac{x^3+2x^2-8x+6}{x+4} - \frac{x^3+x^2-10x+9}{x+4} = 
\frac{(x - 1)(x + 3)}{x+4}.$$
This tells you where the zeros are: at $x = 1$ and at $x = -3$.
You now know that the first curve is below the second curve over the entire interval
in question, so you can simply take the second function minus the first function (which is positive) and integrate it from $x = -3$ to $x = 1$. The rest of the task is simply to compute that integral correctly.
You don't really need to draw a beautiful graph, you just need to know a few facts about it, namely whether it's one function above the other the whole way or whether the functions cross (and if so, where they cross). The rest of it is all equations and integrals.
A: Note that
$$
\left|\frac{x^2+2x-3}{x+4}\right| = -x + 2 - \frac{5}{x+4},\ \textrm{for}\ x \in [-1,3].
$$
So we obtain
\begin{eqnarray}
\int_{-3}^1 dx \left| \frac{x^2+2x-3}{x+4} \right|
&=& \int_{-3}^1 dx \Big( -x +  2 - \frac{5}{x+4} \Big)\\
&=& \left[ - \frac{1}{2} x^2 + 2 x - 5 \ln(x+4) \right]_{-3}^1\\
&=& \Big( - \frac{1}{2} + 2 - 5 \ln(5) \Big) - \Big( - \frac{9}{2} - 6 - 5 \ln(1) \Big)\\
&=& 12 - 5 \ln(5).
\end{eqnarray}
