Everywhere online there is how to calculate the Chi-Square density value given a confidence level: $\alpha$/p value; but I can not find how one calculates the inverse? How to calculate the $\alpha$/p-value knowing only the density value?
For example, if df = 4, and $\alpha$=0.95, then how does one calculate the $\chi^2_4$?
In R this would be
qchisq(0.95, 4)= 9.4877. What is the math behind this?