Suppose $f$ is a differentiable function in $\mathbb{R}$ and $f''(x) = −f(x), \forall x \in \mathbb{R}$. Set $$g(x) = f(x) − f(0)C(x) − f'(0)S(x)$$ Prove that $$g''(x) = −g(x),\quad\forall x \in \mathbb{R}$$ and $$g^k(0) = 0, \quad\forall k \in \{0, 1, 2, \ldots\}$$
Note: $C(x) = \cos(x) = \frac {e^{ix}+e^{−ix}}{2}$ and $S(x) = \sin(x) =\frac {e^{ix}-e^{−ix}}{2i}$ where $i = \sqrt {-1}$ and $e^x = \sum_{n=0}^\infty \frac {x^n}{n!}$.
I derived $g(x)$ twice but it gives me $g''(x)= -f(x) +4f(0)C(x) + 4f'(0)S(x)$ I'm not sure what went wrong, maybe I made a mistake in the derivation process, but I can't seem to figure out where.
Since the leading coefficients of the C(x) and S(x) are constants, and g(x) is linear in C(x), S(x), and f(x), you simply need to show their individual functions also obey the sign property of f, that is $f'' = -f$. They do, you made an algebra mistake somewhere.