<s>[INST] Find the value of constants $c_1, c_2, c_3, c_4$ for which function $f: \mathbb{R} \rightarrow \mathbb{R}$ is differentiable The Problem:
Find the value of constants $c_1, c_2, c_3, c_4$ for which function $f: \mathbb{R} \rightarrow \mathbb{R} $ (written below) is differentiable:
$$
f(x) = \begin{cases}
    c_1 \arctan x + c_2 \cos x + \sin x       & \quad x < 0\\
    \ln(1+x^2) - x \ln 2 + 2^x  & \quad 0 \leq x \leq 1\\
    c_3 (x-1)(x-2)\cdots (x-2016) + c_4 (x+1) & \quad 1 < x \\
  \end{cases}
$$
Potential solution:
First I need to find values for which the function is continuous.
$\lim_{x \rightarrow 0^-}$ of 1st case should be equal to the 2nd case evaluated at $x=0$.
$$\lim_{x \rightarrow 0^-} c_1 \arctan x + c_2 \cos x + \sin x = \ln 1 + 1$$
$$\Rightarrow c_2 = 1 ,\ c_1 \in \mathbb{R}$$
2nd case evaluated at $x=1$  should be equal to $\lim_{x \rightarrow 1^+}$ of the 3rd case.
$$\ln 2 - \ln2 + 2 = \lim_{x \rightarrow 1^+} c_3 (x-1)(x-2)\cdots (x-2016) + c_4 (x+1)$$
$$\Rightarrow  c_4 = 1 ,\ c_3 \in \mathbb{R}$$
Solving finds the values of $c_2$ and $c_4$ for which the function is continuous. 
To find values for which it is differentiable I first need to find derivatives of each of the parts and then go through the previous process again. But, I don't know how to find the derivative of the 3rd case. Here's what I tried.
The derivative:
$$
f'(x) = \begin{cases}
    c_1 \frac{1}{1+x^2} - c_2 \cdot \sin x + \cos x       & \quad x < 0\\
    2x \cdot \frac{1}{1+x^2} - \ln 2 + \ln 2 \cdot 2^x & \quad 0 \leq x \leq 1\\
    ???\ \ c_3 (2016 x^{2015} + \ldots) + c_4 \ \ ??? & \quad 1 < x \\
  \end{cases}
$$
Repeating the same process with the derivative instead of original function:
$$\lim_{x \rightarrow 0^-} c_1 \frac{1}{1+x^2} - 1 \cdot \sin x + \cos x =  2\cdot0\frac{1}{1+0} - \ln2 + 2^0\ln 2$$
$$\Rightarrow c_1  = -1$$
Here's the problematic part:
$$ 2 \cdot \frac{1}{1+1^2} - \ln 2 + \ln 2 \cdot 2^1 = \lim_{x \rightarrow 1^+} c_3 (2016 x^{2015} + \ldots) + 1$$
$$c_3 = ???$$
Any ideas on how to find this derivative and then its limit? Is there a different approach for solving this problem?
 [/INST] $\lim_\limits{x\to 1^+} f'(x)$
We don't need to find the exact derivative of $c_3(x−1)(x−2)⋯(x−2016)+c_4(x+1)$
When we differentiate we get $ c_3 (x-2)\cdots(x-2016) + c_3(x-1) [(x-3)\cdots(x-2016) + (x-2)(x-4)\cdots]+c_4$
And as $x$ approaches $1, c_3(x-1)[\text{everything inside the brackets}] = 0$
leaving $c_3 (2015!) + c_4$
regarding your work on $c_1$
you calculated the derivatives correctly, but you made an error when you evaluated them in a neighborhood of 0.
$\lim_\limits{x=0^+} f'(x) = 2\cdot0\frac{1}{1+0} - \ln2 + 2^0\ln 2 = 0$ 
</s>