Use uniroot()
.
uniroot(function(x) dbeta(x, 1, 2)-dnorm(x, 0, 1), c(0, 1))
## $root
## [1] 0.862456
##
## $f.root
## [1] 5.220165e-05
##
## $iter
## [1] 3
##
## $estim.prec
## [1] 6.103516e-05
This solves an equation dbeta(x, ...) == dnorm(x, ...)
w.r.t. x
(in the inverval [0,1], as this is the support of a beta distribution), i.e. finds the root of dbeta(x, ...) - dnorm(x, ...)
. The resulting list's root
field gives you the answer (more or less precisely).