I performed a Ritz analysis on 1-D Laplace equation and my results are diverging from the exact results. So is numerical oscillation is the only cause or can it be because of any other reason?
Laplacian operator is an unbounded operator over the continuum. Explicitly, its spectrum is unbounded. Consequently, operators (such as Hamiltonians in quantum mechanics) that involve this operator are so-called ill-conditioned, that is they have a large condition number. When one perturbs such operators (and such perturbations are always there where one deals with these operators numerically, with finite precision), the consequent errors tend to diverge on iteration. There are solutions to this problem, and very rigorous ones where the operator at hand is either positive or negative definite. In such cases, one can so-called precondition the problem to be solved, and the methods of constructing the relevant preconditioning operator (based on some variant of the incomplete Cholesky decomposition of the operator at hand) can be rigorously shown to be numerically stable. For the relevant details, you may consult the excellent book Matrix Computations, by Golub & Van Loan (Johns Hopkins, 3rd edition).
What I understand is that you are solving y'' = 0 with y(a) = alpha and y(b) = beta, is n't it? What are your trial functions ? Diverging means when you increase the internal nodes or trial functions you get more error? It should not happen here.
Besides the answer of Dr. Farid, your question has remembered me an old paper that once was useful to me. It may not fit exactly in your case, where there are not only oscillations but divergence, but you may find it interesting:
Don't suppress the wiggles—They're telling you something!