Generalized differential quadrature (GDQ) method is often used for static and dynamic analysis of structures due to its simplicity and low computational cost. The difficulty arises in the implementation of boundary conditions for higher-order differential equations. A few approaches exist to overcome this issue, but all are more complicated than the original GDQ, increasing the computational cost or having other limitations. In this paper, a novel approach is proposed where the order of the governing differential equations of Euler-Bernoulli and Reddy-Bickford beams is reduced from four to two by introducing a new dependent function. The generality and accuracy of the new approach are demonstrated through its application to the buckling and vibration analysis of different kind of composites, specifically beams made of functionally graded material (FGM), and porous material, considering various combinations of boundary conditions. High accuracy is achieved in comparison to literature.