# Two sample t-test with equal variance - two equations

The equation for this test is the following (that's how it is stated in most texts). I got a proof that it indeed has a t-distribution:

$$T=\frac{(\bar{X}-\bar{Y})-(\mu_x-\mu_y)}{S_p\sqrt{\frac{1}{n}+\frac{1}{n}}}$$

However, I've also seen it in the following form:

$$T=\frac{(\bar{X}-\bar{Y})}{S_p\sqrt{\frac{1}{n}+\frac{1}{n}}}$$

How can we prove that also the second test has a t-distribution? Why some books describe the test with the second equation?

Under the null hypothesis, $H_o: \mu_x = \mu_y$, so the equations are identical.
• @user4205580 & mandata Without context it's hard to say, but my guess is the first formula is meant to test the null hypothesis $E(X) - E(Y) = \mu_X - \mu_Y$. Still, in both cases the statistic is t-distributed under the null hypothesis. – A. Donda Aug 13 '15 at 18:18