Light the first rope from both ends and the second rope from just one end. Once the first rope is completely burnt, you will know that thirty minutes have gone by and you will know that the second rope has thirty minutes left before it burns completely. As soon as the first rope is burnt, you light the other end of the second rope, which will double the rate of consumption and cut the remaining time of the rope in half, meaning that it will only take fifteen more minutes for the second rope to burn out completely. The thirty minutes from the first rope and the fifteen minutes from the second give you forty-five minutes.