Negative polarity items, such as at all, can appear in both negative clauses and yes/no questions, as in the Original Poster's examples. In general they can't appear in positive ones:
- Has the condition changed at all?
- The condition hasn't changed at all.
- *The condition has changed at all. (positive clause: ungrammatical)
Positive polarity items, such as somewhat, can appear in positive clauses and yes/no questions. In general, they don't appear in negative ones:
- Have the conditions changed somewhat?
- The conditions have changed somewhat.
- *The conditions haven't changed somewhat. (negative clause: ungrammatical)
A good question here would be:
Why can negative and positive polarity items appear in yes/no questions?
The reason seems to be that a yes/no question entertains two distinct possibilities; the positive proposition corresponding to the answer "yes", and the negative proposition corresponding to the answer "no". So the question in (1), Has the condition changed at all inherently allows for two possibilities: that it has changed and that it hasn't. It is the second negative possibility which allows us to use negative polarity item at all in the question.
Similarly (4) involves two possibilities, that the conditions have changed and that they haven't. It is the first of these that permits us to use somewhat.
Now consider the if-clause in a conditional:
- If his condition improves somewhat, call me.
- If his condition improves at all, call me.
Here the word if tells us that there are two possibilities: that his condition improves and that it doesn't. The first possibility means we can use positive polarity item somewhat, the second means that we can use the negative polarity item at all.
The Original Poster's example
If a boy is at all difficult, most mothers will find it more and more difficult to control their son.
The if-clause allows for two possibilities, that a boy may be difficult and that he may not. As with most conditional if-clauses, we can therefore use both negative polarity items such as at all and positive polarity ones like somewhat:
If a boy is somewhat difficult, most mothers will find it more and more difficult to control their son.
Positive and negative polarity items are complicated! The advice to use at all or any only in negative sentences and questions is generally helpful, but it is not a rule. For example, you can also use them in conditional if-clauses.