S is a function in terms of θ
when taking the first derivative of the both side of S,we get
dS in terms of dθ.
dθ 是对θ 作微分