Let be a smooth function on, and a standard Brownian motion. This paper derives expressions for the distributions of the variables and , where is given. The present formulas contain an expected value of a Brownian functional. It is seen that this can be computed, principally, using Feynman-Kac's formula. Further, the paper discusses in the present framework the familiar examples with linear and square root boundaries. Moreover the approach provides in some extent explicit solutions for the second-order boundaries.