With effect from 1st April 2018, the long term capital gain is applicable on mutual funds and the rate of tax is 10%. This will be applicable on the capital gains realised on the mutual fund units sold after keeping them for more than one year. For example, if one has purchased mutual funds on 14th Dec 2017 and sold them on 2nd May 2018 then long term capital gains tax will be applicable as the MF units are held for more than a year.
For SIP mode of mutual fund investments year wise acquisition cost will be considered and the gain will be calculated for every year separately.
These are done by the computer software programs but I can give a rough idea of how it is done.
In the example you have given, the SIP amount is Rs 5000. So, your first year investment is Rs 60000. Against this, you might have acquired some units say 600. After 20 years you have sold these units for say Rs 1.5 lakh. So, the capital gain is Rs 1.5 lakh - Rs 60000 = Rs 90000. On this one has to pay 10% tax amounting to Rs 9000.
Same thing you have to do for the units acquired in successive years and all taxes to find out the total amount. Remember when doing with a software, these calculations will be done for each of the SIP units separately and adding them for the whole year but that is a finer point and for our understanding we can work out as I explained earlier.
Please note that in a favourable market the NAV of MF units will go on increasing gradually and the SIP amount of Rs 5000 will be able to acquire lessor and lessor number of units with the time. So by calculating the tax year wise all these variations will be taken care of.
Knowledge is power.