Step 1: Relationship between potential energy and displacement.
The potential energy \( PE \) in SHM is proportional to the square of the displacement, given by:
\[
PE = \frac{1}{2} k x^2
\]
where \( x \) is the displacement and \( k \) is the spring constant.
Step 2: Graph of potential energy.
Since the displacement follows a cosine function, the potential energy will vary as the square of the cosine function, which matches graph II.