Let $f(x)=x^3-x^2$. For a given value of $x$, the graph of $f(x)$, together with the graph of the line $c+x$, split the plane up into regions. Suppose that $c$ is such that exactly two of these regions have finite area. Find the value of $c$ that minimizes the sum of the areas of these two regions.
My Attempt:
Let $x_1,x_2,x_3$ be the roots of the equation $x^3-x^2=c+x$
So, $x_1+x_2+x_3=1$; $x_1x_2+x_2x_3+x_3x_1=-1$; $x_1x_2x_3=c$
Also, $x^4=2x^2+(c+1)x+c$
Let S be the sum of the two areas.
$$S=\int_{x_1}^{x_2}(x^3-x^2-x-c)dx+\int_{x_2}^{x_3}(c+x-x^3+x^2)dx=1-x_2^2+\frac{9c+1}{12}(1-3x_2)$$ I am not able to get $S$ entirely as function of $c$ or $x_2$
Your solution so far is correct. To express $S$ in terms of one variable, we note that $$ x_2^3-x_2^2 - x_2 -c = 0 \iff x_2^3-x_2^2 - x_2 = c. $$ Hence, by doing a bit of simplifying after substituting this value of $c$ in your last line, we see that $$ S = -\frac{9}{4}x_2^4 + 3x_2^3 + \frac{1}{2}x_2^2 -x_2 +\frac{13}{12}.$$ As such, we find the roots of the first derivative to find the stationary points, that is, $$ S' = -9x_2^3 + 9x_2^2 + x_2 -1 = (1-3x_2)(1+3x_2)(x_2-1) = 0 $$ implying that $x_2 = \pm1/3, 1$. Substituting these values in the second derivative $$ S'' = -27x_2^2+18x_2 + 1$$ gives us that $S''(1/3) = 4 > 0, S''(-1/3) = -8 < 0$ and $S''(1) = -8 < 0$. Hence, the minimum occurs when $x_2 = 1/3$. Finally, we can conclude that $$ c = (1/3)^2(1/3 -1)-1/3 = -11/27. $$