Question on Fredholm alternative in an ODE 
I am playing with this example and try to understand how to use Fredholm alternative theorem to determine what values of $\beta$ that yield existence of
a solution to this problem. And if solutions exist, how many are there?
Take $L = 2$. So, this ODE only has solutions when $\beta = 1$? and how many there are?
Edit1: @Voliar, I try to use mathematicia to do a test when $\beta = 10$
s = NDSolve[{u''[x] + (Pi/2)^2 u[x] == 10 + x, u[0] == 0, u[2] == 0}, 
  u, {x, 0, 2}]
Plot[Evaluate[u[x] /. s], {x, 0, 2}, PlotRange -> All]
It still give me a graph.
 A: About non-uniqueness.
Let $u$ be a solution of your problem. Consider
$$
w = u + \alpha \sin (\pi x/L).
$$
Then $w$ will be also a solution for any $\alpha \in \mathbb{R}$. Indeed:
$$
\frac{d^2 w}{d x^2} + \left(\frac{\pi}{L}\right)^2 w - (\beta+x) \\
= 
\underbrace{\frac{d^2 u}{d x^2} + \left(\frac{\pi}{L}\right)^2 u - (\beta+x)}_\text{=0, since u is a solution}
+ 
\alpha \underbrace{\left(\frac{d^2 \sin (\pi x/L)}{d x^2} + \left(\frac{\pi}{L}\right)^2 \sin (\pi x/L)\right)}_\text{=0, since sinus is the eigenfunction} = 0.
$$
Hence, $w$ is a solution. And there are infinitely many of them due to $\alpha \in \mathbb{R}$.

Ok, let me show that there is a theoretical impossibility to obtain a solution for $\beta \neq 1$.
Denote $\varphi_1 = \sin \pi x /2$ - the first eigenfunction. 
Let $\beta \neq 1$ and there exists a solution $u$ of nonhomogeneous problem.
Let us multiply
$$
\varphi_1'' + (\pi/2)^2 \varphi_1 = 0
$$
by $u$ and integrate over $(0,2)$. Then you will get (using zero boundary conditions)
$$
-\int_0^2 \varphi_1' u'\, dx  + (\pi/2)^2 \int_0^2 \varphi_1 u \, dx = 0.
$$
Now let us do the same for $u$: multiply the nonhomogeneous problem by $\varphi_1$ and integrate. Hence, we get
$$
-\int_0^2 \varphi_1' u'\, dx  + (\pi/2)^2 \int_0^2 \varphi_1 u \, dx = \int_0^2 (\beta + x) \varphi_1 \neq 0.
$$
Therefore, we get a contradiction with the previous equality. Thus, $\beta = 1$ is the only possibility, where you can obtain a solution.
