NOTE: BEFORE DOING ANYTHING BEST RESOURCE IS BACKUP_BACKUP_BACKUP
Not an answer, can not comment because of lack of reputation.
Following further info might help ubuntu community to understand problem and give you solution. To that effect edit your question.
a.What is the mode of your PC, i.e. either of UEFI or LEGACY. (this is the most important because, booting from both is very different.)
b.can you please provide, the partition details using live USB/CD with help of gparted.
Possible Solution: (only if your existing system is on Legacy Mode not UEFI & assuming you want to go with something else option of installation)
Go for try ubuntu option.
Open gparted.
Make an extended partition.(Entire 40 GB)
a. now, make partition for Swap (recomm:twice of installed RAM), home (as per req)
b. then start the installation, select the remaining unallocated click "+", then make "/" [root] partition.
[Important]- Then select where you want to install boot loader (i.e. Grub) [this will effectively rewrite MBR with Ubuntu's boot loader. Hence be careful.
And finally as you already have Win 8.1, which most of the time is on EFI (or UEFI)mode, could please consider this & possible duplicate