  A {\em Motzkin path} of length $n$ is a lattice path from $(0,0)$ to $(n,0)$
in the plane integer lattice $\mathbb{Z}\times\mathbb{Z}$ consisting of
horizontal-steps $(1, 0)$, up-steps $(1,1)$, and down-steps $(1,-1)$, which
never passes below the x-axis. A {\em $u$-segment {\rm (resp.} $h$-segment
{\rm)}} of a Motzkin path is a maximum sequence of consecutive up-steps ({\rm
resp.} horizontal-steps). The present paper studies two kinds of statistics on
Motzkin paths: "number of $u$-segments" and "number of $h$-segments". The
Lagrange inversion formula is utilized to represent the weighted generating
function for the number of Motzkin paths according to the statistics as a sum
of the partial Bell polynomials or the potential polynomials. As an
application, a general framework for studying compositions are also provided.
