Closed-form trigonometric solution of inhomogeneous beam-columns: buckling problem