Generating Functions - Mess with coefficients Question:
a) Find the coefficient of $x^n$ at the following generating function: $ne^{2x}$
b) Find the coefficient of $\frac{x^n}{n!}$ at the following generating function: $n \cos x$

My Approach:
It has been proved that $e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!}$ and that $\cos x = \sum_{n=0}^{\infty} (-1)^n\frac{x^{2n}}{(2n)!}$.
Therefore, for (a) we have:
$$
e^{2x}=\sum_{n=0}^{\infty} \frac{(2x)^n}{n!}
$$
Taking the derivative with respect to $x$:
$$
2e^{2x}=\sum_{n=0}^{\infty} n\frac{2^n\cdot x^{n-1}}{n!}
$$
Multiplying by $x$:
$$
2xe^{2x}=\sum_{n=0}^{\infty} n\frac{2^n\cdot x^n}{n!} = \sum_{n=0}^{\infty}\frac{2^n \cdot x^n}{(n-1)!}
$$
Therefore:
$$
\frac{2^n}{(n-1)!}
$$
is the coefficient... But that's the coefficient for the function $2xe^{2x}$. I don't know if I am missing something, but it's not clear to me what $n e^{2x}$ is... I did the same thing for (b), but I'll hide the details.
Maybe that $n$ is just a constant with different index, and therefore we're actually looking for:
$$
n e^{2x} = n (\sum \frac{2^k x^k}{k!}) \underbrace{\rightarrow}_{\text{Coef. of }x^k} \frac{n 2^k}{k!}
$$
... But I can't think about that because we're asked to find the coefficient of $x^n$, and therefore the index of the infinite series that represent $e^x$ is $n$... What a MESS!
Can someone please clarify to me what is going on with that $n$ multiplying the functions in terms of $x$?
Thank you!
 A: It  is sufficient to clarify a.) since we can use the same arguments for b.). It is convenient to use the coefficient of operator $[x^k]$  to denote the coefficient of $x^k$ in a series.

At first we look at a specific case, for  instance  $n=5$:
  
  
*
  
*Find the coefficient of $x^5$ at the following generating function $5e^{2x}$.
This is easy to calculate, since we have no notational difficult situation.
  \begin{align*}
\color{blue}{[x^5]\left(5e^{2x}\right)}&=5[x^5]\sum_{k=0}^\infty \frac{(2x)^{k}}{k!}\\
&=5\cdot\frac{2^5}{5!}\\
&\,\,\color{blue}{=\frac{4}{3}}
\end{align*}

Now the problem a.)

  
*
  
*Find the coefficient of $x^n$ at the following generating function $ne^{2x}$.
Note that $n$ is a variable independent of any series representation of $e^{2x}$. When expanding the series we conveniently use an index variable which is different to $n$.
\begin{align*}
\color{blue}{[x^n]\left(ne^{2x}\right)}&=n[x^n]\sum_{k=0}^\infty \frac{(2x)^{k}}{k!}\tag{1}\\
&=n\cdot\frac{2^n}{n!}\\
&\,\,\color{blue}{=\frac{2^n}{(n-1)!}}
\end{align*}

Note: The index variable $k$ in (1) is a so-called bound variable. This means that the scope (i.e. range of validity) is determined by the sigma-operator $\sum$ and the operator precedence rules.
In fact it is even correct to write
\begin{align*}
\color{blue}{n}e^{2x}&=\color{blue}{n}\sum_{n=0}^\infty \frac{(2x)^n}{n!}\tag{2}
\end{align*}
where the factor $\color{blue}{n}$ outside the sum is a free variable different to the bound index variable $n$ of the sigma-operator $\sum$. But of course this is a misuse of notation and strictly to avoid in order to support readability of the text.
Side note: A great example of a notational misuse is given by Richard P. Stanley in this MO post.
