In this case the change is not monotonic, because every value of has two corresponding values of (one positive and negative). However, because of symmetry, both halves will transform identically, i.e.
In this case, the transformation is: , and its derivative is
So here:
And one gets the chi-squared distribution, noting the property of the gamma function: .
Derivation of the pdf for two degrees of freedom
There are several methods to derive chi-squared distribution with 2 degrees of freedom. Here is one based on the distribution with 1 degree of freedom.
Suppose that and are two independent variables satisfying and , so that the probability density functions of and are respectively:
and of course . Then, we can derive the joint distribution of :
Since the two variable change policies are symmetric, we take the upper one and multiply the result by 2. The Jacobian determinant can be calculated as[clarification needed]:
where the leading constant 2 is to take both the two variable change policies into account. Finally, we integrate out [clarification needed] to get the distribution of , i.e. :
Substituting gives:
So, the result is:
Derivation of the pdf for k degrees of freedom
Consider the k samples to represent a single point in a k-dimensional space. The chi square distribution for k degrees of freedom will then be given by:
where is the standard normal distribution and is that elemental shell volume at Q(x), which is proportional to the (k−1)-dimensional surface in k-space for which
It can be seen that this surface is the surface of a k-dimensional ball or, alternatively, an n-sphere where n=k-1 with radius , and that the term in the exponent is simply expressed in terms of Q. Since it is a constant, it may be removed from inside the integral.
The integral is now simply the surface area A of the (k−1)-sphere times the infinitesimal thickness of the sphere which is