An approach using a beta distribution. Let $Y \sim \mathsf{Beta}(2,1).$
Then $X = Y+1.$ Results are the same as in @heropup's Answer (+1).
The quartiles of $Y$ are as follows (using R) are
$1/2$ for the lower quartile, $\sqrt{2}/2$ for the
median, and $\sqrt{3}/2$ for the upper quartile.
The IQR is $(\sqrt{3} - 1)/2.$
Also, the lower
quartile for $X$ is $1.5$ and the IQR for $X$ is
the same as for $Y.$ [In R, qbeta
is the quantile function (inverse CDF) of a beta distribution.]
qbeta(c(1,2,3)/4, 2, 1)
[1] 0.5000000 0.7071068 0.8660254
sqrt(1:3)/2
[1] 0.5000000 0.7071068 0.8660254
Simulation: By simulation of a million realizations of $X$ in R, we
can get good approximations to the quartiles, accurate
to about three significant digits--and a figure for
illustration.
set.seed(223)
x = 1 + rbeta(10^6, 2, 1)
median(x); IQR(x)
[1] 1.706684 # aprx 1.7071
[1] 0.3666178 # aprx 0.8660
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.001 1.499 1.707 1.666 1.866 2.000
hdr = "Simulated values of 1+BETA(2,1) with Quartiles"
hist(x, prob=T, br=30, col="skyblue2", main=hdr)
curve(dbeta(x-1, 2, 1), add=T, lwd=3, col="orange")
abline(v=quantile(x, c(1:3)/4), col="darkgreen", lwd=2)
