Solution 1:

To delete CoreStorage volumes you have to use the CLI:

  • please backup your volume "mainHD"
  • boot to Internet Recovery Mode (hit altcmdR immediately after the start-up chime)
  • open Disk Utility and check/repair mainHD
  • quit Disk Utility , open in the menubar Utilities/Terminal.app and enter diskutil cs deleteVolume LVUUID to delete the Logical Volume
    in your case: diskutil cs deleteVolume B3E1FCD6-ACAB-4152-AEB5-71F41C329C17

  • and then
    diskutil cs delete LVGUUID to delete the Logical Volume Group
    in your case: diskutil cs delete C2BDDBCA-73CF-473C-B9DA-E5682EF29610. Your LGV will be converted to a simple, empty volume with the name "Untitled".

  • enter diskutil list and sudo gpt -r -vvv show -l /dev/disk0
    result of the latter (start blocks and block sizes differ because the example disk is half as big as yours & some parts of the output are omitted):

    ...
             40       409600      1  GPT part - "EFI System Partition"
         409640    244763224      2  GPT part - "mainHD"
      245172864      1269536      3  GPT part - "Recovery HD"
      246442400    242522776      4  GPT part - "Untitled"
      488965176      1269536      5  GPT part - "Recovery HD"
    ...  
    
  • enter diskutil unmountDisk /dev/disk0
  • then remove any partition except those with index 1 and 2 (EFI and mainHD) with sudo gpt remove -i IndexNumber disk0
  • enter diskutil resizeVolume disk0s2 0b to expand it to the full size.
  • enter exit and quit Terminal
  • open Disk Utility, check/repair mainHD again and quit afterwards
  • reboot to main HD
  • rebuild Recovery HD with Recovery Partition Creator 3.8 or by just reinstalling Mavericks 10.9.5 (don't use 10.9.4 or earlier!). Your data and apps will be preserved.