if $X=\sum_{i=1}^{n} a_{i}$ is a random variable that follows normal distribution $\mathcal{N}(\mu,\sigma)$.
Is it possible to find the distribution of the variable $Y$: $$Y=\sum_{i=1}^{n} a_{i} \cos(i\theta)$$
Because we can not split the sum I can not see if there is another trick.
Thank you.
In general I do not think you will be able to get a simple closed formula for the distribution.
However, under the assumption that each of the terms $a_i$ are independent, then we can get an expression for the Moment Generating Function. This is then sufficient for deriving the mean, variance etc. of the distribution.
We first note the following fact: If $X$ and $Y$ are independent random variables and $X + Y$ is normally distributed, then both $X$ and $Y$ are normally distributed (according to this post, a proof is in Feller's book An Introduction to Probability Theory and Its Applications).
As such, we can assume that each of the $a_i \sim \mathcal{N}(\mu_i, \sigma^2_i)$, where
$$\sum_{i=1}^n \mu_i = \mu, \qquad \sum_{i=1}^n \sigma_i^2 = \sigma^2.$$
Then we can compute the moment generating function (making use of the independence of the $a_i$) to be
\begin{align*} \varphi(s) \,\colon & = \mathbf{E}\left[ \exp\left( s \sum_{i=1}^n a_i \cos(i \theta) \right) \right] \\ & = \prod_{i=1}^n \mathbf{E}\left[ \exp\left( a_i \cos(i \theta) \right) \right] \\ & = \prod_{i=1}^n \exp \left( s \mu_i \cos(i \theta)+ \frac{s^2}{2} \sigma_i^2 \cos^2(i \theta)\right) \\ & = \exp \left( s \sum_{i=1}^n \mu_i \cos(i \theta) + \frac{s^2}{2} \sum_{i=1}^n \sigma_i^2 \cos^2(i \theta) \right). \end{align*}