Resizing a partition on El Capitan 10.11.6?
The command below should remove disk0s5.

sudo diskutil erasevolume "Free Space" "" /dev/disk0s5


The command below should remove disk0s4.

sudo diskutil erasevolume "Free Space" "" /dev/disk0s4


The next command expands your Macintosh HD volume (disk0s2) to contain the free space. This command will also automatically move the Recovery HD volume (disk0s3) to the end of the drive.

sudo diskutil resizevolume /dev/disk0s2 R



  Note: I am not sure if the prefix sudo is necessary. (But, it will do no harm if you include the sudo)


There are more complex steps that can be employed to remedy your problem, but I will not post these steps unless the one of the commands given above fails to work.