Consider the function $f(z)$ defined by the series $$f(z):=\sum_{n=0}^{\infty}e^{-nz}\cos (nz).$$
I am asked to find the domain of $f$ defined by the convergence of the series.
To find the radius of the convergence, we need to firstly transform the summand into the form of power series.
So I simply wrote down the formula as: \begin{align*} e^{-nz}\cos(nz)&=\Big(\sum_{k=0}^{\infty}\dfrac{(-nz)^{k}}{k!}\Big)\Big(\sum_{\ell=0}^{\infty}\dfrac{(-1)^{\ell}}{(2\ell)!}(nz)^{2\ell}\Big)\\ &=\Big(\sum_{k=0}^{\infty}\dfrac{(-1)^{k}n^{k}}{k!}z^{k}\Big)\Big(\sum_{\ell=0}^{\infty}\dfrac{(-1)^{\ell}n^{2\ell}}{(2\ell)!}z^{2\ell}\Big)\\ &:=\Big(\sum_{k=0}^{\infty}a_{k}z^{k}\Big)\Big(\sum_{\ell=0}^{\infty}b_{\ell}z^{2\ell}\Big)\\ &=\sum_{m=0}^{\infty}\Big(\sum_{\substack{k+2\ell=m \\ k,\ell\geq 0}}a_{k}b_{\ell}\Big)z^{m}. \end{align*}
But then I don't know how to proceed, as then if I sum over $n$, the coefficients are still not clear enough to calculate the radius of convergence.
Did I head to a wrong direction?
Since this question is related to complex analysis and power series, after searching around the forum, I am still not sure if I've asked a duplicated question. If so, please point it out and I will close the question.
Thank you!
Edit 1:
Given the discussions under my post and two answers, here is some editions here.
(1) I am sorry for forgetting to mention that $z\in\mathbb{C}$. Thus, it seems not sufficient to argue only for $z\in\mathbb{R}$.
(2) This problem has a follow-up part (b) asking me to argue if $f(z)$ can be extended analytically to a larger domain. If so, I need to find the maximal domain of the extension and classify its singularities. Therefore, I think we need to find a power series expansion of $f(z)$ and then "return" it to a function, just like what Viktor Glombik suggested.
I am currently trying to show what Viktor Glombik could not prove, and I would post my proof here if I came up one.
Thank all of you so much for your discussion and answers!
Edit 2:
Following the idea of Viktor Glombik, I think I prove the whole problem now. In this edition, I will first post the whole problem and then post my proof. The proof greatly follows Viktor Glombik.
Consider the function $f(z)$ defined by the series $$f(z):=\sum_{n=0}^{\infty}e^{-nz}\cos(nz).$$ (1) Find the domain of $f$ defined by the convergence of the series.
(2) Can $f$ be extended analytically to a larger domain? If so, find the maximal domain of the extension and classify its singularities.
Proof (1):
Note that $$\cos (nz)=\dfrac{e^{inz}+e^{-inz}}{2},$$ so that we have $$\sum_{n=0}^{\infty}e^{-nz}\cos(nz)=\dfrac{1}{2}\sum_{n=0}^{\infty}e^{(i-1)nz}+\dfrac{1}{2}\sum_{n=0}^{\infty}e^{-(i+1)nz}.$$
Both sums are geometric sum with $$r_{1}=e^{(i-1)z},\ r_{2}=e^{-(i+1)z},$$ which converges if and only if $$|r_{1}|<1,\ \text{and}\ |r_{2}|<1.$$
Write $z:=x+iy$ for $x,y\in\mathbb{R}$, then we have $$|r_{1}|=\Big|e^{i(x-y)}e^{-y-x}\Big|=\Big|e^{-(y+x)}\Big|=e^{-(y+x)},$$ and $$|r_{2}|=\Big|e^{i(-x-y)}e^{y-x}\Big|=\Big|e^{y-x}\Big|=e^{y-x}.$$
Then, we have $$|r_{1}|<1\implies e^{y+x}>1\implies y+x>0\implies y>-x,$$ $$|r_{2}|<1\implies e^{y-x}<1\implies y-x<0\implies y<x.$$
Thus, the domain of the convergence is the set $$\mathcal{A}:=\{z\in\mathbb{C}:-\Re(z)<\Im(z)<\Re(z)\}.$$
Proof (2):
Now, define the partial sums $$S_{1,k}:=\dfrac{1}{2}\sum_{n=0}^{k}r_{1}^{n},\ S_{2,k}:=\dfrac{1}{2}\sum_{n=0}^{k}r_{2}^{n}.$$
Then, by the summation formula of geometric series, we have $$S_{1,k}=\dfrac{1}{2}\times\dfrac{1-r_{1}^{k+1}}{1-r_{1}},\ S_{2,k}=\dfrac{1}{2}\times\dfrac{1-r_{2}^{k+1}}{1-r_{2}}.$$
Now, for all $z\in\mathcal{A}$, taking $k\rightarrow\infty$ yields us $$f(z)=\dfrac{1}{2}\Big(\dfrac{1}{1-e^{(i-1)z}}\Big)+\dfrac{1}{2}\Big(\dfrac{1}{1-e^{-(i+1)z}}\Big).$$
It is then clear that the singularities are those $z\in\mathbb{C}$ that make \begin{align*} &e^{(i-1)z}=1,\ \text{or}\ e^{-(i+1)z}=1 \\ \iff &(i-1)z=2k\pi i,\ \text{or}\ (i+1)z=-2k\pi i,\ k\in\mathbb{Z}.\\ \iff &z=(1-i)k\pi,\ \text{or}\ z=-(1+i)k\pi,\ k\in\mathbb{Z}. \end{align*}
Therefore, for all $z\in\mathbb{C}\setminus\Big(\{z=(1-i)k\pi,\ k\in\mathbb{Z}\}\cup\{z=-(1+i)k\pi,\ k\in\mathbb{Z}\}\Big),$ $$f(z):=\dfrac{1}{2}\Big(\dfrac{1}{1-e^{(i-1)z}}\Big)+\dfrac{1}{2}\Big(\dfrac{1}{1-e^{-(i+1)z}}\Big)$$ is an analytic continuation of $f(z)$.
I think I did not understand the point of this question before because I thought it was asking me to give the radius of the convergence, but it was actually asking me to simply give a domain.
Also, the idea of using geometric series is brilliant, credit to Viktor.
Because you asked how to find the series expansion of your function: Since $\cos(nz) = \frac{e^{i n z} + e^{-i n z}}{2}$, we have $$ \cos(nz) e^{-nz} = \frac{e^{-(i + 1)nz} + e^{(i - 1)nz}}{2}. $$ Now, we can just use those series definitions to get \begin{align} \cos(nz) e^{-nz} & = \frac{1}{2} \left( \sum_{k = 0}^{\infty}\frac{(-(i + 1)n z)^k}{k!} + \sum_{k = 0}^{\infty}\frac{((i - 1)n z)^k}{k!}\right) \\ & = \frac{1}{2} \left( \sum_{k = 0}^{\infty}\frac{(nz)^k}{k!} \left((-(i + 1))^k + ((i - 1))^k\right)\right) \\ & = \frac{1}{2} \left( \sum_{k = 0}^{\infty}\frac{(nz)^k}{k!} 2^{\frac{k}{2} + 1} \cos\left(\frac{3 \pi k}{4}\right)\right) \\ & = \sum_{k = 0}^{\infty}\frac{\left(\sqrt{2}nz\right)^k}{k!} \cos\left(\frac{3 \pi k}{4}\right). \end{align} Now we know that $\cos\left(\frac{3 \pi k}{4}\right) \in \left\{ 0, \pm 1, \pm \frac{1}{\sqrt{2}}\right\}$ for $k \in \mathbb{N}$.
When summing over all $n$, we can split the sum use the properties of the geometric sum and obtain (for $e^{\Re(z) \pm \Im(z)} > 1$) \begin{align} \sum_{n = 0}^{\infty} \cos(nz) e^{-nz} & = \frac{1}{2} \sum_{n = 0}^{\infty} \frac{e^{-(i + 1)nz} + e^{(i - 1)nz}}{2} = \frac{1}{2} \left(\frac{e^{(1 + i) z}}{e^{(1 + i) z} - 1}\right) - \frac{1}{2} \frac{e^z}{e^{i z} -e^z}\\ & = \frac{e^z (e^{2 i z} - 2 e^{(1 + i) z} + 1)}{2 (e^{i z} - e^{z}) (e^{(1 + i) z} - 1)} = \frac{1}{2 (e^{(1 + i) z} - 1)} + \frac{e^{i z}}{2 (e^z - e^{i z})} + 1. \end{align}