# Sum of squares of non-standard Gaussians

I am looking for the derivation of the density and CDF of the sum

$$Y=\sum_{i=1}^{N}(X_i)^2$$

where $$X_i \sim \mathcal{N}(0,\sigma^2)$$. This problem has been addressed in this question and in this question however the explanation provided in the comment refers to a section of the Wikipedia page of the Noncentral chi-squared distribution that apparently has been changed since the comment was posted. Any reference to papers or textbooks is very appreciated.

• Those other quetions deal with noncentral chi-square distributions. Yours is not about a noncentral chi-square distribution, but only about a scaled chi-square distribution, so it's simpler than those. Dec 21 '19 at 5:16

Note: $$k=N$$ throughout the answer.
It is well-known that the standard chi-squared distribution with $$k$$ degrees of freedom has probability density function $$f_{\sum_{i=1}^{N}Z_i^2}(z)= \frac{z^{\frac{k}{2}-1} e^{-\frac{z}{2}}}{ 2^{\frac{k}{2}}\Gamma(\frac{k}{2})} \mathbb{I}_{z>0}.$$
We may write $$Y=\sum_{i=1}^{N}(\sigma Z_i)^2=\sigma^2 \sum_{i=1}^{N}Z_i^2$$, where the $$Z_i$$'s are independent and identically distributed standard normal variables. ($$Z_i=\frac{X_i}{\sigma}$$ for all i.)
By the change of variables formula applied to the monotonic function $$g(y)=\sigma^2 y$$, we have, $$f_{Y}(y)= \frac{1}{\sigma^2}f_{\sum_{i=1}^{N}Z_i}(\frac{y}{\sigma^2})= \frac{1}{\sigma^2} \frac{ (\frac{y}{\sigma^2})^{\frac{k}{2}-1} e^{-\frac{\frac{y}{\sigma^2}}{2}}}{ 2^{\frac{k}{2}}\Gamma(\frac{k}{2})} \mathbb{I}_{y>0}.$$ See https://en.wikipedia.org/wiki/Probability_density_function for a reminder on the change of variables formula.