2
$\begingroup$

$$ 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) $$

  • 1
    Try considering even indices $n=2k$ and odd indices $n=2k+1$ separately2017-02-08
  • 0
    I tried mate, but I couldn't. What is supposed to be your $k$?2017-02-08
  • 0
    It's not true that "only when $n$ is a multiple of $3$, I'll have a negative sign". The next negative sign will be in the term corresponding to $n=7$, which is not a multiple of $3$. Look more carefully to describe the pattern correctly.2017-02-08
  • 0
    @zipirovich Yeah, you are correct. Sorry for that. But suppose that the pattern that I've mentioned is correct. Is it ok to define the series as I did? using if/else?2017-02-08
  • 0
    Now it's correct... but quite cumbersome, to be honest. Yes, we use piecewise functions if we have to. But if there's a shorter way to express the function, we should try to figure it out.2017-02-08
  • 1
    Every integer $n$ can be written uniquely as exactly one of either $2k$ or $2k+1$. You only need to consider the latter indices since you know the coefficients vanish for the former indices. So if $n$ is an odd integer, you can write $n=2k+1$ where $k=(n-1)/2$ and each such $k$ is an integer. If $n$ ranges as $1,3,5,7,\cdots$, then the corresponding $k$ ranges as $0,1, 2, 3,\cdots$.2017-02-08

1 Answers 1

1

As @MPW suggested, consider even indices $n=2k$ and odd induces $n=2k+1$ separately. Here $k$ will be a new running index, just like $n$ is. (Note that if $k=0,1,2,\ldots$, then $n=2k$ runs through all nonnegative even integers, and $n=2k+1$ runs through all nonnegative odd integers.)

For brevity, let $s(n)$ denote your function determining the sign for the three possible cases: $$s(n)=\begin{cases} 0 & \text{ if } n\text{ mod }2 = 0\\ -1 & \text{ if } n \in A\\ 1 & \text{ otherwise} \end{cases}$$

Since for all even $n$, the corresponding coefficient is zero, those terms can be dropped from summation, and it can be rewritten as $$\sum_{n=0}^{\infty} \frac{(\pi x)^n}{n!} \cdot s(n)=\sum_{n=0\\n\text{ odd}}^{\infty} \frac{(\pi x)^n}{n!} \cdot s(n)=\sum_{k=0}^{\infty} \frac{(\pi x)^{2k+1}}{(2k+1)!} \cdot s(2k+1),$$ by substituting $n=2k+1$ for odd $n$. (See the note in the first paragraph.)

Next, notice that for odd-numbered terms, the signs $+$ or $-$ alternate: $$ \begin{array}{l|ccccc} k & 0 & 1 & 2 & 3 & \cdots \\ \hline n=2k+1 & 1 & 3 & 5 & 7 & \cdots \\ \hline s(n)=s(2k+1) & 1 & -1 & 1 & -1 & \cdots \end{array} $$ You can notice that $s(2k+1)=(-1)^k$, which is a pretty standard way to indicate alternating signs, and it will give you the pretty standard expression for the final answer $$\sin(\pi x)=\sum_{k=0}^{\infty} \frac{(\pi x)^{2k+1}}{(2k+1)!} \cdot (-1)^k=\sum_{k=0}^{\infty} \frac{(-1)^k\pi^{2k+1}}{(2k+1)!}x^{2k+1}.$$

  • 0
    Perfect, Just PERFECT explanation... Now It ALL makes sense. Thanks you so much!2017-02-08