Answer
$51.3^\circ$
Work Step by Step
As shown in figure 12.37, the ladder is in equilibrium which means that the net force exerted on it and the net torque exerted on it are zeros.
Thus,
$$\sum F_x=0,\;\sum F_y=0$$
and $$\sum \tau=0$$
So,
$$\sum F_x=n_2-f_s=0$$
Hence,
$$n_2=f_s=\mu_sn_1\tag 1$$
$$\sum F_y=n_1-m_{\rm ladder}g=0$$
Hence,
$$n_1=m_{\rm ladder}g\tag 2$$
Plugging into (1);
$$n_2 =\mu_s m_{\rm ladder}g\tag 3$$
We will find the torque around the end that touches the ground. We chose counterclockwise to be the positive direction.
$$\sum\tau_{\rm ground-end}=n_1(0)+f_s(0)+m_{\rm ladder}g(d_1)-n_2(d_2)=0$$
Hence,
$$ m_{\rm ladder}gd_1-n_2 d_2 =0\tag 4$$
From the geometry of the figure below, we can see that $\sin\theta=\dfrac{d_2}{L}$ where $L$ is the length of the ladder. Hence, $d_2=L\sin\theta\tag 5$
And, from the small triangle, $\cos\theta=\dfrac{d_1}{\frac{1}{2}L}$, hence $d_1=\frac{1}{2}L\cos\theta\tag 6$
Plugging (5) and (6) into (4);
$$ m_{\rm ladder}g(\frac{1}{2}L\cos\theta)-n_2(L\sin\theta) =0 $$
Multiplying both sides by 2;
$$ m_{\rm ladder}g L\cos\theta -2n_2 L\sin\theta =0 $$
Plugging from (3);
$$ \color{red}{\bf\not} m_{\rm ladder}\color{red}{\bf\not} g \color{red}{\bf\not} L\cos\theta -2\mu_s \color{red}{\bf\not} m_{\rm ladder}\color{red}{\bf\not} g\color{red}{\bf\not} L\sin\theta =0 $$
$$ \cos\theta =2\mu_s \sin\theta $$
Hence,
$$\tan\theta=\dfrac{1}{2\mu_s}$$
$$\theta=\tan^{-1}\left[\dfrac{1}{2\mu_s}\right] =\tan^{-1}\left[\dfrac{1}{2\times 0.4}\right]$$
$$\theta_{\rm minimum}=\color{red}{\bf 51.3}^\circ$$