Is the differential, dp, exact or not?
Your function $p$ is a function of the independent variables $V$ and $T$ i.e., $p(V,T)$. The other variables, $a$, and $R$ are constants.

Let me rewrite the differential as

$$\mathrm{d}p = A(V)\,\mathrm{d}T + B(T,V)\,\mathrm{d}V$$

where

$$A(V) = \frac{R}{V}$$

and

$$ B(T,V) = \left( \frac{2a}{V^3} - \frac{RT}{V^2} \right) $$

A differential is exact if

$$\left( \frac{\partial A}{\partial V} \right)_T = \left( \frac{\partial B}{\partial T} \right)_V $$

Note that subscripts denote that the variable is being held constant during the partial differentiation. The problem already told us what our $A$ and $B$ terms are, and I wrote them out explicitly above. Now, we just need to take the appropriate partial differentials and compare. If they are equal, then $\mathrm{d}p$ is exact!

Writing out the formulas took awhile, it seems a shame to stop now... A little bit of differentiating, remembering to hold the appropriate variables constant during differentiation leads to

$$\left( \frac{\partial A}{\partial V} \right)_T = -\frac{R}{V^2}$$

$$\left( \frac{\partial B}{\partial T} \right)_V = -\frac{R}{V^2}$$

If the two partial derivatives are the same, the differential is exact. I will let you be the judge.