For a given multivariate pdf $f$ (mainly the gaussian one) I'm looking to compute a minimal rectangular confidence region for a given level $\alpha$. For example, I would like to solve problems of the type $$\min \|x\|^2$$ such that $$\int_{-x_1}^{x_1}\cdots\int_{-x_n}^{x_n}f(y)dy=1-\alpha.$$ Of course, I could write a Lagrangian and solve it numerically. However I was wondering: are there specific algorithms tailored for this problem? (and related ones, for example different lower/upper bounds, norm replaced by average, etc...). And do you know of any libraries that perform these calculations, for example for the normal distribution (preferably in R or C++)? I couldn't find any and I was quite surprised since it looks like a pretty natural problem to me.