Joint distribution of $Y$ and $S^2-Y^2$

Let $$\{X_i\}_{i=1}^n\overset{iid}{\sim}\mathcal{N}(\mu,\sigma^2)$$. Let $$\{b_i\}_{i=1}^n$$ be a sequence of numbers so that $$\sum_{i=1}^nb_i=0$$ and $$\sum_{i=1}^nb^2_i=1$$. Define $$S^2=\sum_{i=1}^n(X_i-\bar{X})^2 \text{ and } Y=\sum_{i=1}^nb_iX_i$$.

What can you say about the joint distribution of $$Y$$ and $$S^2-Y^2$$?

I only can get the marginal distribution of $$Y\sim\mathcal{N}(0,\sigma^2)$$, $$S^2\sim\sigma^2\chi_{n-1}^2$$ and $$Y^2/\sigma^2\sim\chi^2_{1}$$. What can we say about the joint distribution of $$Y$$ and $$S^2-Y^2$$? I tried Basu's theorem, based on the fact that $$S^2$$ is complete and sufficient for $$\sigma^2$$ but I cannot show anything using this...

• Hint: you can simultaneously diagonalize the quadratic forms $S^2$ and $Y^2.$
– whuber
Feb 16 '21 at 16:38
• So $Y^2=b^TXX^Tb$ and $S^2 = X^TX-2X^T\bar{X}+\bar{X}^T\bar{X}$?
– Tan
Feb 17 '21 at 0:39
• Write the forms as matrices. For instance, $Y^2 = X^\prime(bb^\prime)X$ has matrix $bb^\prime.$
– whuber
Feb 17 '21 at 1:00