the solution of $\lambda u''(x) = u(x)$ is $u(x)=\{sin(n\pi x)\}_{n=1}^\infty$ in my text it says: the solution of $\lambda u''(x) = u(x)$ is $u(x)=\{sin(n\pi x)\}_{n=1}^\infty$with boundary condition u(0)=u(1)=0
how do I know that this set contains all solutions? What if their is some weird function satisfying this equation.
 A: Well, I just want to extend what I've written in comments.
I assume that you know how to solve higher order linear differential equations and how general solution could be written depending on associated characteristic equation. If you don't, please read this, for example.
Returning back to your question.
Suppose that $\lambda$ is real. We want to solve the BVP $u(0)=u(1)=0$ for equation $\lambda u'' = u$.
There could be three possibilities: $\lambda > 0$, $\lambda = 0$ and $\lambda < 0$. 


*

*Case $\lambda = 0$ is very trivial: equation transforms to $u \equiv 0$ and it is not interesting at all.

*If $\lambda > 0$ then general solution could be written as $u(x) = C_1 \cdot \exp{\frac{x}{\sqrt{\lambda}}} + C_2 \cdot \exp{\left (-\frac{x}{\sqrt{\lambda}} \right)}$. Let's show that in this case there's only trivial solution (i.e. $u(x) \equiv 0$) to our BVP. BVP generates system of homogeneous linear equations with matrix
\begin{pmatrix}
1 & 1 \\
\exp{\frac{1}{\sqrt{\lambda}}} & \exp{\left ( -\frac{1}{\sqrt{\lambda}} \right )}
\end{pmatrix}
The determinant of this matrix is $2 \sinh{\left(-\frac{1}{\sqrt{\lambda}}\right)}$ and it's never zero, so there is only a trivial solution to this system $\Rightarrow$ $C_1 = C_2 = 0$ and only $u(x)\equiv 0$ satisfies BVP.

*The last case is $\lambda < 0$. The general solution could be written as $u(x) = C_1 \cos{\frac{x}{\sqrt{\lambda}}} + C_2 \sin{\frac{x}{\sqrt{\lambda}}}$. Let's solve BVP. Plugging $x = 0$ gives $C_1 = 0$ and plugging $x=1$ gives $C_2 \sin \frac{1}{\sqrt{\lambda}} = 0$. Since we are trying to find non-trivial solution, $C_2 \neq 0$ and we came to equation $\sin \frac{1}{\sqrt{\lambda}} = 0$. From it we obtain that $\frac{1}{\sqrt{\lambda}} = \pi n, \; n \in \mathbb{N}$.


The final conclusion is that this BVP could be solved only for specific values of $\lambda$, namely for those which satisfy $\frac{1}{\sqrt{\lambda}} = \pi n$ for some integer $n$. The only functions that are solutions of this BVP are those of form $C \sin  n \pi x$.
