<s>[INST] let $f(x) = \left\lbrace\begin{array}{ll} x^2+3x, &x \geq1\\ x^2-3x+6, & x<1 \end{array}\right.$ then find the limit… Let 
$f(x) =
\begin{cases}
x^2+3x,  &x \geq1\\[2ex]
x^2-3x+6, & x<1
\end{cases}$
Then find the
$$\lim_{h \to0} \frac{f(1)-f(1-h^2)}{h^2}=?$$

My Try :
$$f(1)=4$$
$$f(1-h^2)=(1-h^2)^2-3(1-h^2)+6=h^4-h^2+4=h^2(h^2-1)+4$$
So we have :
$$\lim_{h \to0} \frac{h^2(h^2-1)}{h^2}=-1$$
it is right ?
 [/INST] Yes, it's right (with a minor slip, check your algebra). For computing $f(1)$ you have to use the “upper branch”, so
$$
f(1)=1^2+3\cdot 1=4
$$
whereas, since $h^2>0$ when computing the limit, $1-h^2<1$ and $f(1-h^2)$ requires following the “lower branch”, so
\begin{align}
f(1-h^2)
&=(1-h^2)^2-3(1-h^2)+6\\[4px]
&=1-2h^2+h^4-3+3h^2+6\\[4px]
&=4+h^2+h^4
\end{align}
Then
\begin{align}
f(1)-f(1-h^2)
&=4-4-h^2-h^4\\[4px]
&=-h^2-h^4
\end{align}
and
$$
\frac{f(1)-f(1-h^2)}{h^2}=-1-h^2
$$
so the limit is $-1$.
</s>