As we know that,
The swing will work as the simple pendulum, so from the diagram given below.

(a) Let the maximum displacement = a
So, here A is the amplitude,
let the time period of the swing is T,
ϕ= phase difference
so y=asin(T2πt+ϕ)

(b) The above is am example of Damped force ocsillations.