Simple formulas for the natural frequencies of non-uniform cables and beams