In many cases, if and whether can be used interchangeably without affecting the meaning.
In the following situations, speakers prefer using IF.
(I asked them, "Are you leaving?")
I asked them if they were leaving.
|SLIGHTLY LESS FORMAL|
I asked him if he is going to visit. (informal context)
(I asked him whether he would visit. (more formal))
I asked him questions if he was not too busy.
I asked him questions when he was not too busy.
In the following situations, speakers prefer using whether.
|WITH WORDS USED IN FORMAL CONTEXTS|
We inquired whether the President would attend the summit meeting. (investigate, explain, examine, study, decide, determine)
|WHEN STRESSED IN SPEECH|
We must ask ourselves whether we will accept failure.
|BEFORE "OR NOT" / REGARDLESS|
We are leaving whether you like it or not. (no option exists)
|DOUBT + "OR NOT" / ALTERNATIVE|
We don't know whether we are going or not. (doubt, can't say, be uncertain— about an alternative)
|BEFORE AN INFINITIVE|
We can't decide whether to leave or to stay.
|AFTER A PREPOSITION|
We were worried about whether you would like it.
|AFTER "THE QUESTION IS…"|
The main question is whether they are going also. (the problem is, the undecided point is)
|INITIAL POSITION / SUBJECT|