Let \(\psi(x,t)\) be the wave function which has the sinusoidal form we have used in the book.
\begin{equation*}
\psi(x,t) = A \cos(kx - \omega t +\phi).
\end{equation*}
We will determine the values of the constants in this form of the wavefunction.
\begin{equation*}
\omega = 2\pi f = 20 \pi \ \text{rad/s},
\end{equation*}
We find \(k\) from the given \(f\) and \(v\) we determine from the data.
\begin{align*}
\amp v = \sqrt{\frac{100\ \text{N}}{0.1\ \text{kg/m}}} = \sqrt{1000}\ \text{m/s}.\\
\amp k = \frac{2\pi}{\lambda} = \frac{2\pi f}{v} = \frac{20\pi}{ \sqrt{1000}} = 1.99\ \text{rad/m}.
\end{align*}
The amplitude is given as
\begin{equation*}
A = 2\ \text{cm}.
\end{equation*}
From the initial condition at \(x=0\) we will be able to fix \(\phi\text{.}\)
\begin{equation*}
(2\ \text{cm})\cos\phi = 1\ \text{cm}\ \ \Longrightarrow\ \ \phi = \pi/3.
\end{equation*}
Therefore, the wave function is
\begin{equation*}
\psi(x,t) = (2\ \text{cm}) \cos\left[(1.99\ \text{rad/m}) x - (20 \pi \ \text{rad/s}) t +\pi/3 \right].
\end{equation*}