$$ f(x) = sin(\pi x) $$
Find the correspondent Maclaurin series for the function $f(x)$.
Here's my approach:
Since Maclaurin series is defined as: $$ \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!}x^n $$
If I try to find a relation between $\frac{f^{(n)}(0)}{n!}$ for every $n^{th}$ derivative,and by doing that, I'll be able to define the correspondent Maclaurin series, and that's what I did:
$$ \frac{f(0)}{0!} = sin(\pi 0) = 0\\ \frac{f'(0)}{1!} = \pi cos(\pi 0) = \pi\\ \frac{f''(0)}{2!} = - \pi^2 sin(\pi 0) \cdot \frac{1}{2!} = 0\\ \frac{f^{(3)}(0)}{3!} = - \pi^3 cos(\pi 0) \cdot \frac{1}{3!} = \frac{-\pi^3}{6}\\ \frac{f^{(4)}(0)}{4!} = \pi^4 sin(\pi 0) \cdot \frac{1}{4!} = 0 $$
And then, since the following structure above is going to loop, I tried to find a pattern, and that's what I've got:
I saw that for every even number $n$, the equation of my series needs to return $0$.
I also saw that the sequence of numbers $A = \left\{ -1,3,7,11...\right\}$ defined by $$ A_n = -1 + 4n \text{ \ } \forall n \ge 0 $$ is the only possible numbers, besides $-1$, where my $n^{th}$ term of my series will have a negative value, hence when $n \in A$ we'll have a negative sign.
And of course, saw that the absolute value of $\frac{f^{(n)}(0)}{n!}$ is going to follow: $$ \frac{\pi^n}{n!} $$
Now my point is, how can I express that patterns in terms of $n$ in one equation to substitute $\frac{f^{(n)}(0)}{n!}$ ?
The best that I've got is:
$$ \sum_{n=0}^{\infty} \frac{(\pi x)^n}{n!} \cdot \left( \begin{cases} 0 & \text{ if } n\text{ mod }2 = 0\\ -1 & \text{ if } n \in A\\ 1 & \text{ otherwise} \end{cases} \right) $$