In this case, we have , and the general solution is of the form .
The condition implies that , and the condition implies that or .
This last condition will be true whenever for = 1, 2, 3, ....
We can instruct Maple to verify this reasoning as follows:
> H:='H': de2 := diff(H(x),x$2)=-omega^2*H(x);
> sol2 := dsolve(de2,H(x));
> H:=unapply(rhs(sol2),x);
> solve({H(0)=0,H(Pi)=0},{omega,_C2});
Note that it is up to us to notice that other values of also work.