The sentence :
A dog has no trouble knowing where to scratch itself to kill a flea.
I think below sentences are more familiar to my mind where a preposition comes after the trouble.
A dog has no trouble with/in/of knowing where to scratch itself to kill a flea.
However, It seems the first sentence is a reduced relative clause. It means we can rewrite the sentence as below:
A dog has no trouble ( that it is knowing ) where to scratch itself to kill a flea.
Under this considerations, my question is why the author preferred to use or choose reduced relative clause rather to use a preposition? If these scenarios convey different meanings in a Native person (or a person expert in English )? The sentence has been driven from an academic text. Can we say using relative clauses are more preferable in academic or formal English ?