The differentiation of $ \sin, \cos$ through a Taylor Series

502 Views Asked by At

This question has been asked quite a lot on math SE, however, please before you mark this as a duplicate carry on reading, I will try to highlight my doubts and concerns as clear as possible.

First in class we had the following theorem:

Let $(a_n)_{n \in \mathbb{N}}$ be a sequence in $\mathbb{R}$. Let $R > 0$ such that $f(x)=\sum_{n=0}^{+ \infty} a_nx^n$ converges absolutely for $|x|< R$, then $f(x)$ is differentiable and $\forall x \in ]-R,R[$ the derivative is $f'(x)=\sum_{n=1}^{+ \infty} na_nx^{n-1}$

I do understand the meaning of this theorem, however, when it comes to applying it I seem to end up at horrible wrong results. What puzzles me the most is (and I won't link the specific cases in here) that I have seen many answers on math SE and other online resources where people differentiate the sum without raising the initial value from $n=0$ to $n=1$ and neither shift the index, however they always seem to succeed to show what they want with this approach.

Example (No Problem here, works perfect):

Without thinking much about it and just using and intuitive understanding of the theorem given above I differentiate the following: $$ \cos'(x)= \left(\sum_{n=0}^{+ \infty} \frac{(-1)^n x^{2n}}{(2n)!} \right)'=\sum_{n=1}^{+ \infty} \frac{(-1)^n2nx^{2n-1}}{(2n)!}=\sum_{n=1}^{+ \infty} \frac{(-1)^nx^{2n-1}}{(2n-1)!}$$ notice the index which I am about to shift now (using $i=n-1$ and replacing it in my mind) $$ \implies \cos '(x)= \sum_{n=0}^{+ \infty} \frac{(-1)^{n+1}x^{2n+1}}{(2n+1)!}=-\sum_{n=0}^{+ \infty} \frac{(-1)^nx^{2n+1}}{(2n+1)!}=-\sin(x)$$ things work out perfectly here obviously but when it comes to the same exercise with $\sin$ however I seem to fail

Example 2 (Here I struggle) $$\sin'(x)= \left(\sum_{n=0}^{+ \infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} \right)'=\sum_{n=1}^{+ \infty} \frac{(-1)^n(2n+1)x^{2n}}{(2n+1)!}=\sum_{n=1}^{+ \infty} \frac{(-1)^nx^{2n}}{(2n)!}$$ Things look seemingly good so far, but I yet still have to shift the index, I did this above with luck so why not here? $$ \implies \sin'(x)=\sum_{n=0}^{+ \infty} \frac{(-1)^{n+1}x^{2n+2}}{(2n+2)!}=-\sum_{n=0}^{+ \infty} \frac{(-1)^nx^{2n+2}}{(2n+2)!}\neq \cos(x)$$

Questions:

$\bullet$Where is my mistake in the second example? Was my approach in example one only a lucky goal? $\bullet$Why are there so many people not increasing the index when they differentiate a sum? Is this a correct approach and when yes, for which cases?

$\bullet$ What would be the correct, mathematical rigorous approach to solve this problems? Do I always have to define $a_n$ first? i.e. for the second example define $$a_n:=\frac{(-1)^nx^{n+1}}{(2n+1)!}$$ I have tried this method and my result was even worse then before.

4

There are 4 best solutions below

2
On BEST ANSWER

In the theorem you have $x^n$, but in the series you have $x^{2n}$ and $x^{2n+1}$. In the theorem you drop the $n=0$ term because that's the constant term (whose derivative is zero); in the case of cosine, the $n=0$ term is again the constant term, so it works out; but in the case of sine it's the $x^1$ term. To apply the theorem very carefully for cosine: let $$ a_n = \begin{cases} (-1)^{n/2}/n! &\text{if $n$ even,} \\ 0 &\text{if $n$ odd.} \end{cases} $$ Then $$ \cos'(x) = \left(\sum_{n=0}^\infty a_n x^n\right)' = \sum_{n=1}^\infty na_n x^{n-1} = \sum_{n=0}^\infty (n+1)a_{n+1} x^n $$ and then note that $$ (n+1)a_{n+1} = \begin{cases} (-1)^{(n+1)/2}/n! &\text{if $n$ odd,} \\ 0 &\text{if $n$ even.} \end{cases} $$

0
On

You misunderstood why you go from $\sum\limits_{n=0}^\infty$ to $\sum\limits_{n=1}^\infty$. It's not that you're getting rid of the lowest power term, as you have done. But rather that you're getting rid of the $x^0$ term, which is constant. So when you differentiate $\sin(x)$, you don't get rid of the $n=0$ term, because that's the $x^1$ term.

5
On

When you take the derivative of sine, note that the Taylor expansion is $(0,1,0,-1,0,1,\ldots)$. By writing sine as $\sum_{n=0}^\infty \frac{(-1)^nx^{2n+1}}{(2n+1)!}$, you are not expressing it in its canonical Taylor form. By shifting the index in deriving sine, you are shifting $n$ by $2$. This might be easier to see if you write it out:

$$\begin{align}\sin x&=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!}\ldots\\ \frac{\text d(\sin x)}{\text dx}&=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\frac{x^8}{8!}\ldots\tag{1}\end{align}$$

But your sum neglects the $1$ in $(1)$.

In general, it's usually easier to write $f'(x)=\sum_{n=0}^\infty na_nx^{n-1}$ anyway, since the first term is $0$ and you don't run the risk of forgetting terms.

As TonyK kindly pointed out, take care to note that the above sum does not evaluate definitely at $x=0$ since it has a $0^{-1}$ term in it, hence this identity should be taken with a pinch of salt.

2
On

This is wrong:

$$\sin'(x)= \left(\sum_{n=0}^{+ \infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} \right)'=\sum_{n=1}^{+ \infty} \frac{(-1)^n(2n+1)x^{2n}}{(2n+1)!}$$

The point of discarding the derivative of the first term $a_0x^0$ is simply that the derivative of a constant term is zero, so it can be left out. Otherwise the first term would be $0 \times a_0x^{-1}$, which is a nuisance because it's undefined at $x = 0$.

But your first term here is not a constant, because your exponent is $2n+1$ instead of $n$. If you just write out a few terms and differentiate them, all will become clear.