>>732
730 の最後の式では、確率密度の積分 ∫f(x) dx = 1 の dx の部分が
抜けてしまっています。
hist を用いる場合、dx に相当する値は
diff(hist(x, prob=T)$breaks) で求めることができます。

x <- rnorm(500)
h <- hist(x, prob=T)
sum(h$density * diff(h$breaks))