I want to solve:

With boundary condition y(0)=y(a)=0.

First part is very easy using constant coef. which give:

Obviously the two boundary condition give two different answer. The book just gave:

My understanding is the general solution is a combination of the two solution that satisfy both boundary conditions. But in this case, each solution meet only one of the boundary condition and not the other. The general solution is the linear combination of the two solution which will not meet either one of the boundary condition!!!

Please help me clarify this. Thanks