We investigate the source of energy emission in galaxies using a sample of galaxies in the Stripe 82 field. This sample includes 380 objects detected by X-Ray emission. Our main objective is to find the amount of galaxies dominated by emission from active galactic nuclei (AGN), those dominated by emission from star formation, and composite galaxies with emission from both sources. We fit the Sloan Digital Sky Survey spectra of each galaxy with the four emission lines Hα, Hβ, [NII], and [OIII] to find the flux value of each line. We plot the ratio of [OIII]/Hβ vs [NII]/Hα which shows the number of galaxies dominated by AGN emission and emission from star formation, as well as composite galaxies. We also show how X-ray luminosity correlates with ionization source, and we examine whether the fraction of AGN changes with redshift. The resultant BPT diagram shows that most of the galaxies in our sample are dominated by AGN emission, as expected since this is an X-ray selected sample, while a minority are composites or dominated by star formation.