The maximum swing either side of the rest position is +/- 15cm where a positive swing is to the right and a negative swing is to the left. So we want an amplitude of 15cm.
The pendulum takes 2 seconds to swing from the left to the right which is half a phase (a full phase is a swing to the left and then back to the right).
A full phase on the cosine curve is `2pi` on the x-axis, so a half phase is
Hence, to get the correct phase length we equate `t = (2x)/pi` where `t` is the time in seconds and `x` is the number of `pi`-radians on a standard cosine graph (when ` ``x=pi`, `t=2`).
Now `f(x) = cosx`
So `f(t)prop cos(pi/2 t)`
We wan` `t an amplitude of 15cm so
`f(t) = 15cos(pi/2t)` answer