When I see my German friend, I say "wie geht's, und du?" However, she corrects me by saying it's "und dir." In other ways, "und du" is ok. I don't understand the difference?
3 Answers
The complete form of the question you use to answer would be "Und wie geht es dir?" The personal pronoun is the object of the sentence and takes dative case. To find out the correct case, one can refer to test questions: "Wie geht es wem/was?" 'wem', as you may know, indicates dative case and thus you have to use "dir" instead of "du".
The initial question in complete form is "Wie geht es dir?". You answer "Gut, und dir?".
In questions like "Wie alt bist du?" you answer "25, und du?" Because, as explained, here the object stands in nominative case: "Wie alt ist wer/was?"
As bouscher mentioned in his answer, you shorten the question by taking "wie geht es" part out. The parts in parentheses may not be said but keep in mind that it is also more polite to build a whole sentence.
A: Wie geht es dir?
B: danke, mir geht es gut und (wie geht es) dir?
The conversation would also be like that
A: Wie geht es dir?
B: Alles (geht) gut bei mir. Und bei dir?
Analogy to English
I think an analogy is in order here:
Wie geht es [dir]?
Translated word for word:
How goes it [to you]?
If I were to say,
How goes it [you]?
That does not make much sense, does it?
If I were to say
How goes it [to you]?
, although rarely used, is clearly the better choice.
Du, auch!
Direct speech which implies "du"
Schlaf gut[, du]!
Sleep good[, you]!
Du auch!
Notes
Nominative Case (that which is named>subject): you / du
Dative Case (that to which may be given>indirect object): to you / dir
Imperative Case (bidding): implies you / du
Accusative (that which is accused>direct object): you / dich