product of divisors of n as a power of n.

I am trying to prove that
$$\prod_{d|n}{d}=n^\frac{d(n)}{2},$$
where $d(n)$ is the number of divisors of $n$.

My initial thought was to say let $\{d_i\}_{i=1}^k$ be the set of all divisors of $n$. This means that $d(n)=k$. But $d(n)=(\alpha_1+1)(\alpha_2+1)…(\alpha_m+1)$ when we define $n=p_1^{\alpha_1}p_2^{\alpha_2}…p_m^{\alpha_m}$. So $m<k$.

Now the divisors of $n$ are just the product of prime powers with some combination of the primes/prime powers removed. For example, a divisor, $d_i=\frac{n}{p_j^{\alpha_l}}$. The product of these divisors will yield $n^k$ in the numerator, and $n^i$ in the denominator with $i<k$ since the denominator will contain all $p_j^{\alpha_j}$. But how to show that it is exactly $n^\frac{d(n)}{2}$ is escaping me.

Solutions Collecting From Web of "product of divisors of n as a power of n."

Let our product be $P$. Then
$$P=\prod_{d|n} d.$$
But we also have
$$P=\prod_{d|n} \frac{n}{d}.$$
Thus
$$P^2=\prod_{d|n} \left(d\cdot \frac{n}{d}\right)=\prod_{d|n} n=n^{d(n)}.$$

There is a much simpler way to solve this.

Let $S = \lbrace d\vert n, d \leq \sqrt{n}\rbrace$ and $S’ = \lbrace d\vert n, d >\sqrt{n}\rbrace$. Note that $S \cup S’$ is the set of all divisors of $n$ and that $S \cap S’ = \emptyset$.

So for every $d \in S$ we have a unique $d’ \in S’$ such that $dd’ = n$.

$$\prod_{d\vert n} d = \prod_{d\in S}d \prod_{d’\in S’}d’$$

So, if $n$ is not a perfect square, $S$ and $S’$ have the same amount of elements: $d(n)/2$. Therefore we can pair up the elements in $S$ and in $S’$ such that $d_kd’_k = n$.

$$\prod_{d\in S}d \prod_{d’\in S’}d’ = \prod_{d_k \in S, d’_k \in S’} d_kd’_k = n^{\vert S’\vert} = n^{d(n)/2}$$.

If $n$ is a perfect square, we can do the same pairing, but we will have an extra element in $S$ without a pair, that is precisely $\sqrt{n}$ so we would have:

$$\prod_{d\in S}d \prod_{d’\in S’}d’ = \sqrt{n}\prod_{d_k \in S, d’_k \in S’} d_kd’_k = \sqrt{n}n^{\vert S’\vert} = \sqrt{n}n^{[d(n)-1]/2} = n^{d(n)/2}$$

$\square$