(N/A) For figure $(a)$:
Time period,$T = 2 \, s$
Amplitude,$A = 3 \, cm$
At time $t = 0$,the particle $P$ is at the negative $y$-axis. The angle made by the radius vector $OP$ with the positive $x$-axis is $\phi = -\frac{\pi}{2}$ (or $\frac{3\pi}{2}$).
The equation of simple harmonic motion for the $x$-projection is given by $x = A \cos \left( \frac{2\pi t}{T} + \phi \right)$.
Substituting the values: $x = 3 \cos \left( \frac{2\pi t}{2} - \frac{\pi}{2} \right) = 3 \cos \left( \pi t - \frac{\pi}{2} \right) = 3 \sin(\pi t) \, cm$.
For figure $(b)$:
Time period,$T = 4 \, s$
Amplitude,$A = 2 \, m$
At time $t = 0$,the particle $P$ is at the negative $x$-axis. The angle made by the radius vector $OP$ with the positive $x$-axis is $\phi = \pi$.
The equation of simple harmonic motion for the $x$-projection is given by $x = A \cos \left( \frac{2\pi t}{T} + \phi \right)$.
Substituting the values: $x = 2 \cos \left( \frac{2\pi t}{4} + \pi \right) = 2 \cos \left( \frac{\pi t}{2} + \pi \right) = -2 \cos \left( \frac{\pi t}{2} \right) \, m$.