Here is a list of known compatible CPUs for the Inspiron N5040. This is NOT all of the compatible CPUs, just CPUs I know are compatible.

This how-to guide shows the removal and installation of the CPU Processor on the Inspiron 15 (N5040 / N5050 / M5040). If you need any of the parts spoken about they are linked at the bottom of the post. A small phillips head and flat head screw driver is the only tool needed for this repair.