If no subject (I) is used in "if clause", the verb will chang into v-ing or v-ed form. That depends on whether the verb action is performed actively or passively by the agent/subject( "I" ).
Actively, use v-ing:
"If I do homework, I will improve."--> If doing homework, I will improve.
Passively, use v-ed:
“If I am told to do homework, I will improve.” -->If told to do HW, I will improve.
(For above cases, even the "if " can be omitted! )
In one word, the verb form depends on its relationship with the later agent and no verb infinitive can be used in subordinate sentences.