<s>[INST] Taylor series of $f(x) = \cos x$ centered at $\frac{\pi}{4}$ I am asked to find the Taylor Series that represent the function $f(x) = \cos x$ centered at $\frac{\pi}{4}$.
My process
Finding the first few derivatives and establishing a pattern. Given that sine and cosine functions go back and forth, there needs to be two formulas (sums) to produce all the terms. The even and odd ones are:
$$f^{(2k)}(x) = (-1)^k \cdot \cos(x)$$
$$f^{(2k+1)}(x) = (-1)^{k+1} \cdot \sin(x)$$
Therefore,
$$f^{(2k)} \left( \frac{\pi}{4} \right) = (-1)^k \cdot \frac{1}{\sqrt{2}}$$
$$f^{(2k+1)} \left( \frac{\pi}{4} \right) = (-1)^{k+1} \cdot \frac{1}{\sqrt{2}}$$
The sums will be
$$\sum_{k = 0}^{\infty} (-1)^k \cdot \frac{1}{\sqrt{2}} \frac{\left( x - \frac{\pi}{4}\right)^k}{k!}$$
$$\sum_{k = 0}^{\infty} (-1)^{k+1} \cdot \frac{1}{\sqrt{2}} \frac{\left( x - \frac{\pi}{4}\right)^k}{k!}$$
Now, my question is the following: how do I combine these? Do I need to look at both and try to establish a pattern, which would lead me to the sum shown on the mark scheme? Or is there some algebraic manipulation that I can do in order to get the answer?
Markscheme's answer
$$\frac{\sqrt{2}}{2} \sum_{k = 0}^{\infty} \left( -1 \right)^{\frac{k(k+1)}{2}} \cdot \left( x - \frac{\pi}{4}\right)^k \cdot \frac{1}{k!}$$
Thank you.
Edit
I believe I've found a solution. Interesting to see that, when you combine two sums, the terms show up two by two.


 [/INST] You basically want the periodic sequence
$$
a_0=1,a_1=1,a_2=-1,a_3=-1,a_4=1,a_5=1,a_6=-1,\dotsc
$$
which obeys the recursion $a_{k+4}=a_k$, with the given initial terms. The characteristic equation is $t^4-1=0$, so the roots are $1,i,-1,-i$ and the general solution is therefore
$$
a_k=\alpha+\beta(-1)^k+\gamma i^k+\delta(-i)^k
$$
and we need
$$
\begin{cases}
\alpha+\beta+\gamma+\delta=1 \\
\alpha-\beta+i\gamma-i\delta=1 \\
\alpha+\beta-\gamma-\delta=-1 \\
\alpha-\beta-i\gamma+i\delta=-1
\end{cases}
$$
from which $\alpha+\beta=0$ and $\alpha-\beta=0$. You can compute $\gamma$ and $\delta$ and using Euler's and De Moivre's formulas, we end up with the essentially obvious
$$
a_k=\cos\dfrac{k\pi}{2}+\sin\dfrac{k\pi}{2}=2\cos\frac{\pi}{4}\cos\Bigl(\frac{k\pi}{2}-\frac{\pi}{4}\Bigr)=\sqrt{2}\cos\frac{2k\pi-\pi}{4}
$$
the last steps using the sum-to-product formulas. Thus you can rewrite your series in the compact form
$$
\cos x=\sum_{k=0}^\infty \Bigl(\cos\frac{2k\pi-\pi}{4}\Bigr)\frac{1}{k!}\Bigl(x-\frac{\pi}{4}\Bigr)^k
$$
</s>