If you replace the 45 with a 40 you will engage 2 1/2 fewer teeth with the chain. Therefore you should remove 2 links and make up the half by moving the rear axle. You cannot remove three links unless you have a special link. If you have an odd number of links now you will find the special link on the chain. By link, I mean every space in the chain. You should have 99.
Theoretically, your top speed will increase by the rario of 45/40 or about 12%. If you go 25 now you may go 28 with the sprocket change. Hardly worth it unless you go with a front sprocket of 18 teeth also. I cannot say now how much torque is required to drive the combination of 18 front and 40 rear, but I am going to try it Thursday. I have the present combination of 14 front and 45 rear and a 1.5 hp engine. I will put 18 front and 40 rear Thursday. The advantage of changing both sprockets is that the old chain can be used. If you want, I will let you know how it works out.