Via the semi-inverse method, variational principles are established for the Drinfeld-Sokolov-Wilson (DSW) equation. Based on the obtained variational formulations, exact solitary solution and exact singular periodic wave solution can be obtained using the variational approach.