Home » Blog » Find values of constants so that the derivative of a function exists

Find values of constants so that the derivative of a function exists

Consider the function f defined by

    \[ f(x) = \begin{cases} \sin x & \text{if } x \leq c, \\ ax+b & \text{if } x > c. \end{cases} \]

Find values for the constants a and b such that the derivative f'(c) exists.


We know that f'(c) exists if and only if

    \[ \lim_{h \to 0} \frac{f(c+h) - f(c)}{h} \]

exists. This limit exists if and only if the two one-sided limits exits and are equal:

    \[ \lim_{h \to 0^+} \frac{f(c+h) - f(c)}{h} = \lim_{h \to 0^-} \frac{f(c+h) - f(c)}{h}. \]

Using the definition of f, we then evaluate these limits,

    \begin{align*}  && \lim_{h \to 0^+} \frac{a(c+h)+ b - \sin c}{h} &= \lim_{h \to 0^-} \frac{\sin (c+h) - \sin c}{h} \\ \implies && \lim_{h \to 0^+} \left(\frac{ac+b- \sin c}{h}\right) + a &= \lim_{h \to 0^-} \frac{\sin c \cos h + \sin  h \cos c - \sin c}{h} \\ \implies && \lim_{ h \to 0^+} \left(\frac{ac+b - \sin c}{h}\right) + a &= \lim_{h \to 0^-}\left( \frac{\sin c \cdot \left( \cos h - 1 \right)}{h} \right) + \cos c. \end{align*}

In simplifying the right hand side we used that \lim_{h \to 0} \frac{\sin h}{h} = 1. Furthermore, for the limit on the left to exist we must have ac+b - \sin c = 0 (otherwise the limit will diverge as h \to 0). Now for the expression on the right, we claim the limit in the expression is 0. We can see this because

    \begin{align*}  \lim_{h \to 0^-} \frac{\sin c (\cos h - 1)}{h} &= \sin c \lim_{h \to 0^-} \frac{\cos h - 1}{h} \\  &= \sin c \lim_{h \to 0^-} \frac{\cos (0 + h) - \cos 0}{h} \end{align*}

But this limit is the derivative of \cos x at x = 0. Since (\cos x)' = -\sin x and \sin 0 = 0, this term is indeed 0.
So, coming back to our original equations we then have,

    \[ \lim_{ h \to 0^+} \left(\frac{ac+b - \sin c}{h}\right) + a &= \lim_{h \to 0^-}\left( \frac{\sin \left( \cos h - 1 \right)}{h} \right) + \cos c \quad \implies \quad a = \cos c. \]

Furthermore, since we already established that ac + b - \sin c = 0 we have,

    \[ b = \sin c - c \cos c. \]

Therefore, the expressions for a and b we are asked to find are,

    \[ a = \cos c, \qquad b = \sin c - c \cos c. \]

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):