Maclaurin Series confusion Using the Maclaurin expansion formula:
to find the Maclaurin series for $sin(3x)$, I can get the correct answer by using $x^n$ in the formula above (in the tail-end of the formula).
Similarly, to expand $e^(-x)$, I can get the correct answer by using $x^n$.
But to expand $\frac{1}{(1+2x)}$, I can't get the correct answer by using $x^n$, instead I have to use $(2x)^n$ to get the correct answer.
Why is this so? Shouldn't I have to put $(3x)^n$ into the formula to expand $sin(3x)$, and $(-x)^n$ for $e^(-x)$ as well then? Am I doing something wrong?
Just to be sure, here is my working for all three problems:
No. 1. $f(x) = sin(3x)
f(0)=0;  f'(0)=3; f''(0)=0; f'''(0)=-27; f''''(0)=0; f'''''(0)=243$
$sin(3x)= sum of f^(n)(0)/n!*(x^n)
= 3x - (27/3!)x^3 + (243/5!)x^5 +...
No. 2. f(x) = e^(-x)
f(0)=1, f'(0)=1, f''(0)=1, f'''(0)=1
e^(-x)= sum of f^(n)(0)/n!*(x^n) = 1 - x + x^2/2! - x^3/3! +...
No. 3. f(x) = 1/(1+2x)
f(0)=1, f'(0)=-1, f''(0)=2, f'''(0)=-6
1/(1+2x)= sum of f^(n)/n!*(x^n) = 1 - x + x^2 - x^3 +...  (wrong)
or 
1/(1+2x)= sum of f^(n)(0)/n!*(2x^n) = 1 - 2x + 4x^2 - 8x^3 +...$ (correct)
I understand that substituting the X values into the standard Maclaurin series formulas for sin(x), e^x, and 1/(1+x) is easier, but I really rather use the general Maclaurin formula to expand the functions. I'd really appreciate it if someone could tell me what I'm doing wrong here, why I need to use a new X value (i.e. 2x) to expand the polynomial but not for the trigonometric or exponential functions.
 A: In both the first two cases, we can readily obtain the Maclaurin series in two ways:


*

*We can start with the Maclaurin series for the basic function--$\sin x,e^x$ respectively--then replace all $x^n$ appropriately--by $(3x)^n$ and $(-x)^n$ respectively.

*We can explicitly determine all derivatives of the functions and compute the Maclaurin series directly.


If we take the latter approach, you should note (for example) that if $f(x)=\sin(3x)$ and $g(x)=\sin x$, then we will have $f^{(n)}(x)=3^n\cdot g^{(n)}(3x)$ for all $n\ge 0,$ due to the chain rule. Consequently, $$\begin{align}f(x) &= \sum_{n=0}^\infty\frac{f^{(n)}(0)}{n!}x^n\\ &= \sum_{n=0}^\infty\frac{g^{(n)}(0)\cdot 3^n}{n!}x^n\\ &= \sum_{n=0}^\infty\frac{g^{(n)}(0)}{n!}(3x)^n\\ &= g(3x),\end{align}$$ as we should expect.
The same ideas work for the function $f(x)=\frac1{1+2x}.$ We could explicitly calculate derivatives of all orders (which is tedious), or (more simply) we could begin with the function $g(x)=\frac1{1-x},$ which has a geometric series as its Maclaurin series, namely $$g(x)=\sum_{n=0}x^n$$ for all $\left|x\right|<1.$ Observing then that $f(x)=g(-2x),$ we then find that $$f(x)=\sum_{n=0}^\infty(-2x)^n=\sum_{n=0}^\infty(-2)^nx^n.$$ I leave it to you to confirm that $f^{(n)}(0)=(-2)^n\cdot n!$ for all $n\ge 0$ (don't forget the chain rule!), so that both approaches once again bear the same fruit. The formula for $f(x),$ though, will hold whenever $\left|-2x\right|<1,$ or equivalently whenever $\left|x\right|<\frac12.$ Aside from that, nothing is different from the first two cases (whose basic and transformed series are everywhere convergent).
A: There are two ways of finding the correct series:


*

*Find the series for $\sin t$, $\operatorname{e}^t$ and $\frac{1}{1-t}$ and then substitute $t=3x$, $t=-x$ and $t=-2x$, resp.

*Use $\operatorname{f}(x)=\sin 3x$, $\operatorname{f}(x)=\operatorname{e}^{-x}$ and $\operatorname{f}(x)=\frac{1}{1+2x}$ in the red formula that you posted.


Both approaches will give you exactly the same answers for these three functions.
