x <- rexp(10000) y <- sqrt(x) hist(y, probability=TRUE) dy <- 2*y*exp(-y^2) points(dy ~ y, pch=46, col="red")