# Thread: differentiability and continuity question

1. ## differentiability and continuity question

A function f(x) is defined to equal cos(ax) + b for x>=0 and 2 – x3 for x < 0, where a and b are constants. It is known that this function is differentiable everywhere. Find all possible values of a and b

My answer was that a could be anything and b has to have a value of 2. Could someone confirm this. Thank you.

2. Originally Posted by geometry101
A function f(x) is defined to equal cos(ax) + b for x>=0 and 2 – x3 for x < 0, where a and b are constants. It is known that this function is differentiable everywhere. Find all possible values of a and b

My answer was that a could be anything and b has to have a value of 2. Could someone confirm this. Thank you.
So we have

$f(x)=\left\{ \begin{array}{ll} -x^3+2 & \mbox{ if } {x<0}\\ \cos(ax)+b & \mbox{ if }{x\geq{0}}\end{array}\right.$

Now for it to be differentiable we must have that

$\lim_{x\to{0^{-}}}f(x)=\lim_{x\to{0^+}}f(x)$

and $\lim_{x\to{0^-}}f'(x)=\lim_{x\to{0^+}}f'(x)$

Now can you see what to do?