Exact probability density function using multivariate transformation: Applied to static and dynamic stochastic mechanical system