What is the difference in meaning when we use a gerund instead of a bare infinitive after the preposition "to"? [closed]

Solution 1:

Both of your examples are correct, but they do indeed have different meanings.

In your first example, to is a preposition followed by the object of the preposition—the gerund learning:

I devoted so much time to what?
I devoted so much time to learning this skill.

In your second example, to is an infinitive marker. Combined with the base verb, it’s called an infinitive of purpose. It means in order to [verb]:

I devoted so much time why?
I devoted so much time in order to learn this skill.

Solution 2:

To learning” is correct. Devotion is always to somebody or something. The infinitive “to learn” is out of place.