Let $ f(x):= \Bigl \{ \frac{3}{x-3}$ if $x\leq 2$
$ax^2+b+2x$ if $x \gt 2$
So what i said is the function has to be continous. So i said $\frac{3}{2-3}=-3=4a+4+b$
Then i said the left derivative and the right should be equal. I dont know if this is the right solution. The definition of differentiable doesnt mention left and right hand limits.
It follows by taking derivatives $-3=4a$
My question is: Are my thoughts correct? What are requirements for a piecewise function to be differentiable? Sorry i couldnt format the piecewise function correctly
[Posted as an answer by request of the OP.]
In order for the function to be differentiable, the values of the two pieces must be equal at $x = 2$, and the derivatives of the two pieces must also be equal at $x = 2$.
The former condition tells us that
$$ \left. \frac{3}{x-3} \,\right|_{x=2} = \boxed{-3 = 4a+4+b} = \left. (ax^2+2x+b)\, \right|_{x=2} $$
and the latter condition tells us that
$$ \left. \frac{d}{dx} \, \frac{3}{x-3} \, \right|_{x=2} = \left. -\frac{3}{(x-3)^2} \, \right|_{x=2} = \boxed{-3 = 4a+2} = \left. (2ax+2) \,\right|_{x=2} = \left. \frac{d}{dx}\, (ax^2+2x+b)\, \right|_{x=2} $$
Then solving the two equations
$$ 4a+b = -7 \\ 4a = -5 $$
yields the proper coefficients for the pieces to match.