# Question about testing a specific difference between two means - hypothesis testing

I know with hypothesis testing, if you are wanting to see if there is a statistical difference between 2 means you set it up with $H_0: \mu_1=\mu_2$ and $H_A:\mu_1\neq\mu_2$ But what about if you were interested in testing whether the means differ by an exact value, say by 5. How would you set that up? Can it even be done with a t test?

Take a $100(1-\alpha)\%$ confidence interval about $\mu_1-\mu_2$. Reject $H_0\colon\{\mu_1-\mu_2=5\}$ when $5$ is not in the confidence interval. This provides an hypothesis testing of $H_0$, having $\alpha$ as significance level.
$H_0: \mu_1=\mu_2+5$ ie. $\mu_1$ is 5 more than $\mu_2$ (or $\mu_2=\mu_1+5$, $\mu_2$ is 5 more than $\mu_1$)
$H_A:\mu_1\neq\mu_2+5$ (or $\mu_2\neq\mu_1+5$)
Your test statistic would then be $t=\frac{\bar{X_1}-(\bar{X_2}+5)}{s_{\bar{X_1}-\bar{X_2}}}$ where $s_{\bar{X_1}-\bar{X_2}}$ is the standard error of $\bar{X_1}-\bar{X_2}$.