We use the EAGLE (Evolution and Assembly GaLaxies and their Environments) simulations, with the 50 co-moving Mpc a side box, with and without the effect of active galactic nuclei (AGN) to study dark matter distribution and stellar density in central galaxies. The simulations allow us to study cosmological structures at various redshifts which are chosen at 0, 0.27 and 0.87. We study the brightest cluster galaxy (BCG) in the largest galaxy cluster at these redshifts. The dark matter profile of the galaxy in the simulation with AGN exhibits a flat core, while its counterpart in the simulation without AGN is cuspy at all redshifts. The stellar density in the galaxy resembles the corresponding dark matter profile at all radii. At outer radii, the stellar density profile in the simulation with AGN changes dramatically from high to low redshift. We conclude that the energetic process of AGN in the simulation can effect both the stellar and dark matter components in central galaxies. As the box size is relatively small and the result is based on only central galaxies of small clusters, the study does not cover a wide dynamic range. The baryonic feedback effect on dark matter needs to be further explored on larger scales for cosmologists to correctly constrain cosmological parameters.