A and B both are very good;
A and B are both very good.
Both A and B are very good.
Both of A and B are very good.
Are there subtle differences between the four sentences above?
"Subtle differences?" Hmmmm.
Well, there are some simple differences; dunno how subtle they are. Depends.
I agree with @augurar that (4) is ungrammatical, except for unstressed them.
That leaves (rearranging the order a little to show the Q-float direction of both):
These all mean the same thing.
And here's a couple more sentences that these all come from, via conjunction reduction:
- A is very good.
- B is very good.
(or perhaps I should say "that all these come from", because that's Q-Float, too.)
Here's what's going on.
First, both means *all two;
that is, both has the same syntactic pattern as
X, which only occurs with
X > 2
-- all three of them, all 27 of them, both/all of them.
Second, both and all (and some, each, any, few, and quite a few more) are quantifiers.
Quantifiers are special words that normally modify noun phrases (as in [1.] above).
Third, in English there is a rule called "Quantifier-Float" that allows some (but by no means all)
quantifiers -- both or all in this case -- to detach themselves from the noun phrase that they bind,
and float away to an adverb niche in the verb phrase. Without, naturally, changing meaning.
That's what happened to [2.] and [3.] above;
those are the two available adverb niches in that verb phrase:
either right before the first auxiliary verb -- are -- or right after it.
That's all, really.
A and B both are very good. --> both is parenthetical, = "A and B, both, are very good."
A and B are both very good. --> fine
Both A and B are very good. --> A and B is parenthetical, = "Both, A and B, are very good."
Both of A and B are very good. --> No parenthetical. A and B = "them"
Yes, there's a distinct difference in meaning, the focus, that shifts between 'A and B', 'both' and 'very good': use as needed.