### Instruction:
Let $f$ be defined by  \[f(x) = \left\{
\begin{array}{cl}
3-x & \text{ if } x \leq 3, \\
-x^3+2x^2+3x & \text{ if } x>3.
\end{array}
\right.\]Calculate $f^{-1}(0)+f^{-1}(6)$.

### Response:

Let's calculate $f^{-1}(0)$. Ok. Since $f(x)$ is defined differently for $x\leq 3$ and $x>3$, we need to find the value of $x$ in each case. In the case that $x\leq 3$, $f(x)=3-x$, so we need to solve $3-x=0$ for $x$. So $x=3$ in that case. Now let's find $x$ in the case that $x>3$. Ok. In that case, $f(x)=-x^3+2x^2+3x$, so we need to solve $-x^3+2x^2+3x=0$ for $x$. That factors as $x(-x^2+2x+3)=0$, so either $x=0$ or $-x^2+2x+3=0$. Ok. We can solve $-x^2+2x+3=0$ for $x$ by using the quadratic formula. We get $x=\frac{-2\pm\sqrt{2^2-4(-1)(3)}}{2(-1)}$. So $x=\frac{-2\pm\sqrt{2^2+12}}{-2}$. That simplifies as $x=\frac{-2\pm 4}{-2}$. So this gives us $x=\frac{-2\pm 4}{-2}$. Then we get $x=\frac{2}{-2}$ or $x=\frac{-6}{-2}$. So $x=-1$ or $x=3$. But we said $x>3$. Right, so $x=3$ doesn't work. We then have to check whether $x=-1$ works. So we have to calculate $f(-1)$. We first check that $-1\leq 3$, so we use the formula $f(x)=3-x$. So $f(-1)=3-(-1)$. Therefore $f(-1)=4$. But we said that $f(x)=-x^3+2x^2+3x$ for $x>3$. So $x=-1$ does not work. Therefore $f^{-1}(0)=3$. Let's now calculate $f^{-1}(6)$. We need to solve $f(x)=6$ for $x$. So we need to solve the equation $-x^3+2x^2+3x=6$ for $x$. This equation is equivalent to $-x^3+2x^2+3x-6=0$. Ok. Let's use the rational root theorem. This theorem tells us that a rational root of this equation must be of the form $\frac{p}{q}$, where $p$ is a divisor of the constant term and $q$ is a divisor of the leading coefficient. The constant term is $-6$ and its divisors are $-1, -2, -3, -6, 1, 2, 3, 6$. The leading coefficient is $-1$ and its divisors are $-1, 1$. So a rational root must be of the form $\frac{p}{q}$, where $p$ is a divisor of $-6$ and $q$ is a divisor of $-1$. Since $q$ is a divisor of $-1$, it must be $-1$ or $1$. Let's first try $q=-1$. Then, $p$ must be a divisor of $-6$. Let's try $p=3$. So our first guess is $x=\frac{3}{-1}$. That is $x=-3$. Let's plug that into the equation and see if it works. If $x=-3$, then $-x^3+2x^2+3x-6=-(-27)+2(9)-3(-3)-6$. This is equal to $27+18+9-6$. So this is $48$, not $0$. Therefore, $x=-3$ is not a root. Then we can use the quadratic formula to find the roots of $x^2-3=0$ This gives us $x=\pm\sqrt{3}$ But we need to find the solution that is greater than $3$, since we want $x>3$ If $x \leq 3$, then we need to solve $f(x) = 3-x = 6$ for x $3-x = 6$ means $x = -3$, but $x$ must be $\leq 3$ That means $-3$ is the only solution for $x \leq 3$. Therefore, $f^{-1}(0) + f^{-1}(6) = 3 + (-3)$. This means that $f^{-1}(0) + f^{-1}(6) = 0$.

