An upper bound on the energy of graphs is obtained using the spectral moments of the eigenvalues of the adjacency matrix associated with the graph, utilizing the method of Lagrange multipliers and properties of cubic equations