Analytical solutions to magneto-electro-elastic beams