The question When should a verb be followed by a gerund instead of an infinitive? on English Language and Usage is what you need. The first answer contains lists, which I'll reproduce here
There is a copy of The Brief Penguin Handbook here;
the Verbs Followed by Gerunds or Infinitives section is here.
The only way to know is to memorize which verbs are followed by gerunds and which are followed by infinitives. The relevant categories are:
Verbs Followed by Infinitives
Most verbs are followed by infinitives.
If the verb is not found in the list below, it is probably followed by an infinitive.
Verbs Followed by Gerunds
The verbs in the following table all need to be followed by gerunds.
The students don’t enjoy going over the same rules again and again.
- admit (to)
- appreciate
- avoid
- be accustomed to
- be used to
- can’t help
- consider
- delay
- deny
- discuss
- dislike
- enjoy
- feel like
- finish
- get used to
- imagine
- keep (on)
- look forward to
- (not) mind
- miss
- postpone
- practice
- put off
- recommend
- regret
- report
- resent
- resist
- risk
- stop
- suggest
- tolerate
- understand
Verbs Followed by an Object Before the Infinitive Verb
I advise you to go to school early today.
- advise
- allow
- *ask
- authorize
- cause
- challenge
- convince
- encourage
- *expect
- force
- get
- help
- hire
- inform
- instruct
- invite
- *need
- order
- permit
- persuade
- *prepare
- *promise
- remind
- require
- teach
- tell
- train
- urge
- *want
- *warn
- *would like
*Some words can be used without an object as well as with an object.
I want him to go. I want to go.
Verbs Followed by Either Gerund or Infinitive
Sometimes the meaning changes according to the verb used.
He doesn’t remember giving the homework to Mr. Young.
He didn’t remember to give the homework to Mr. Young.
- attempt
- begin
- can (not) bear
- can (not) stand
- continue
- hate
- intend
- (dis)like
- love
- neglect
- prefer
- remember
- start
- try
Verbs Followed Only by the Simple Form (no “-ing” or “to”)
Four verbs are called causative verbs.
They are followed by an object; the verb after the object is always in the simple form:
- let: They let him go on the trip (instead of “let him to go”).
I let him take my book home for one night.
- make: We made her do her chores first.
I made my sister cry.
- help: She helped her finish her homework.
I helped him find the bookstore.
- have: The teacher had him stay after school.
I had my teacher explain the answers.
Verbs Followed by Either the Simple Form or the Gerund (no “to”)
Some verbs are called verbs of perception and are followed by either the simple form or the “-ing” form.
I see him going.
- notice: I notice him run to school every day.
I notice him running to school every day.
- watch: I watch him struggle with his homework.
I watch him struggling with his homework.
I hear him singing.
Others including: look at, observe, listen to, feel, smell.
be is a copular verb and it's used to connect the subject of the sentence to the complement - a subject complement.
The solution is easy.
The order will be delivered soon.
He is a policeman.
In the above sentences the verb be connects the subject to its complement. A complement need not be an adjective only, but anything that says something about the subject.
In sentence #1 the complement is an adjective. In sentence #2, the complement is past participle of verb (or can be viewed as an adjective), but in sentence #3 the complement is a noun phrase.
All these complements say something about the subjects. And hence they are called subject complement. A copular verb is the one that links the subject with its complement.
In your quoted sentence the complement is - to be out. This is an infinitive clause denoting the purpose of his scaling. out here is an adverbial modifying the verb be and referring to the position of the subject.
Rajnath gets stuck in lift, scales wall to be out.
Scales the wall so that Rajnath comes out.
Best Answer
Consider the following examples:
In the examples above we see infinitives occurring as the Complements of various adjectives. We cannot use -ing forms with the same meaning. The following examples are ungrammatical.
Notice that all of the examples above have very normal Subjects. The Subjects in the sentences above are all noun phrases.
Now look at these sentences. They are a bit more unusual:
These sentences all use clauses as Subjects. They either use infinitival clauses or -ing clauses as Subject. They also have adjectives as complements of the verb BE. These sentences are unusual. We don't like to use clauses as Subjects in English. We prefer to use special sentences called extraposition constructions. To do this we stick the meaningless word it in the Subject position. We then move the clause to the end of the sentence. If we do that with the examples above, we will see that the clause now appears after the adjective:
Although these clauses appear after the adjectives, they are not Complements of the adjectives. They appear after the adjectives outside the verb phrase. We call these Extraposed Subjects. (They aren't real Subjects though. The word it is the Subject in each of the examples above.)
Both -ing clauses and infinitive clauses can occur as Extraposed Subjects. The meaning of the sentences can be subtly different in each case. But they are both grammatical.
The Original Poster's example
The sentences above are all grammatical. We can use either infinitives or -ing clauses here. The reason is that these clauses are Extraposed Subjects. They are not Complements of the adjective wonderful.
Grammar Note
There is a very small group of adjectives which cannot normally take either infinitives or -ing forms as Complements. One of these adjectives is the word possible:
However, we can use these adjectives in extraposition constructions - but only with infinitives, not with gerunds: