If $f(x)$ is differentiable for all real numbers, then what is the value of $\frac{a+b+c}{2}$? 
If $f(x)=\begin {cases} a^2 + e^x & -\infty <x<0 \\ x+2 & 0\le x \le 3 \\ c -\frac{b^2}{x} & 3<x<\infty \end{cases}$, where $a,b,c$ are positive quantities. If $f(x)$ is differentiable for all real numbers, then value of $\frac{a+b+c}{2}$ is

Left hand derivative at $x=0$
$$Lf’(0) =\lim_{h\to 0} \frac{2 - (a^2 +e^{-h})}{h}$$
For limit to exist, $2-a^2=0 \implies a=\pm \sqrt 2$
$$L f’(0)=1$$
Right hand derivative at $x=0$
$$R f’(0) =\lim_{h\to 0} \frac{ h+2 -2}{h} =1$$
Left hand derivative at $x=3$
$$Lf’(3) =\lim_{h\to 0} \frac{5- (3-h+2)}{h}=1$$
And
$$Rf’(3) =\lim_{h\to 0} \frac{ c -\frac{b^2}{3+h}-5}{h}$$
For limit to exist, $c=h$
$$Rf’(3) =\lim_{h\to 0} \frac{b^2}{(3+h)(h)}=\infty$$
Where am I going wrong?
 A: In order to be differentiable everywhere, $f$ must be continuous.  As $f$ is a piecewise continuous function:
To solve for $a$, in the last step using the fact that $a$ is positive
$$\lim_{x\rightarrow0^-}f(x)=\lim_{x\rightarrow0^+}f(x)$$
$$\lim_{x\rightarrow0^-}(a^2+e^x)=\lim_{x\rightarrow0^+}(2+x)$$
$$a^2+e^0=2+0$$
$$a^2=1$$
$$a=1$$
Similarly, we can solve for $c$ in terms of $b$:
$$\lim_{x\rightarrow3^-}f(x)=\lim_{x\rightarrow3^+}f(x)$$
$$\lim_{x\rightarrow3^-}(2+x)=\lim_{x\rightarrow3^+}(c-\frac{b^2}{x})$$
$$2+3=c-\frac{b^2}{3}$$
$$c=5+\frac{b^2}{3}$$
Now, we take into account that $f$ is differentiable at $x=3$ (and using the fact that $b$ is positive):
$$\lim_{x\rightarrow3^-}f'(x)=\lim_{x\rightarrow3^+}f'(x)$$
$$\lim_{x\rightarrow3^-}1=\lim_{x\rightarrow3^+}\frac{b^2}{x^2}$$
$$1=\frac{b^2}{9}$$
$$b=3$$
$$c=5+\frac{b^2}{3}=5+3=8$$
Therefore $\frac{a+b+c}{2}=\frac{1+3+8}{2}=6$
A: First see my comment, and Peter Foreman's comments.
As $x \to 3^-$ (that is, as $x$ approaches 3 from below) 
$f'(x) = 1.$
Also, $f(3) = 5.$
As $x \to 3^+$:
$f(x) \to c - \frac{b^2}{3}.$
$f'(x) \to \frac{b^2}{3^2}.$
Thus, $\frac{b^2}{3^2} = 1 \Rightarrow b^2 = 9.$
Further, $c - \frac{b^2}{3} = 5 \Rightarrow c - 3 = 5.$
Addendum: sneaking in intuition expansion through the back door
Taking a bird's-eye view, neither $a$ nor $c$ will have any effect on any LHS or RHS derivatives.  Therefore, the derivative constraint will only affect $b.$
Consequently, $a$ and $c$ can be interpreted as "free-form" variables whose only purpose is to raise or lower the corresponding segment of the overall function to ensure continuity.
