How can I know when should I use whether or if in a sentence? I can not see any difference between whether and if. When should I use each? For me, they are the same and I am not sure if there is a difference.
1. If (conditional clause) acts as an adverbial phrase meaning "in this case":
- If you find a dragon, you will be scared.
- You will be scared if you find a dragon. (=You will be scared in this case)
2. Whether (conditional clause with OR required) acts as an adverbial phrase meaning "in any case":
- Whether you find a dragon or a unicorn, you will be scared. (depending on context, this tends to imply you will certainly find one or the other)
- Whether or not you find a dragon, you will be scared.
- You will be scared whether or not you find a dragon. (=You will be scared in any case)
3. Whether (conditional clause with OR optional) can also act as a noun phrase meaning "this fact":
- I'm asking whether you found a dragon (or not). (=I'm asking this true-or-false fact)
- Think about whether you really want to explore that cave. (=Think about this true-or-false option)
4. In less formal use, the use of whether as in (3) to create a noun phrase is often replaced by if:
- I'm asking if you found a dragon (or not). (=I'm asking this fact)
- Think about if you really want to explore that cave.
Sometimes a single sentence could fit many or all of these uses, such as,
Please tell me if/whether you found a dragon.
While they are almost interchangeable, there are indeed subtle differences:
'Whether' supports the conjunction 'or' for choice while 'if' traditionally does not, so although the sentences often seem to have the same meaning, you should use 'if' where the sentence is conditional and 'whether' where it presents two possibilities.
Tell me if you'll be in town at the weekend. - Here, you only need to notify the speaker if you do decide to go to town. "I will be in town at the weekend."
Tell me whether you'll be in town at the weekend (or not). - Here, whatever you choose to do at the weekend, you should tell the speaker. "I will/won't be in town at the weekend" (I prefer to include the 'or not', though some choose to elide.)
Also, a more modern answer might be that 'whether' is considered more formal, though I fear this may be in the same way 'whom' is considered by some more formal.
Hope that helps.