Pensare di is used when an action follows it: Penso di dirle che la amo. Pensare a is used when some noun follows: Penso a lei. Pensare without preposition is used when it's a supposition: Penso lei sarà una moglie magnifica. Penso che when it's description: ti ha piaciuto lei? Sì, penso che è bellissima. It's not the general rule but an approximation.
"Are you thinking of me," would use "stai" instead of "stavi". It's a rotten trick on the part of the lesson writers, because there's no need to combine gerunds with the past imperfect. You could just say "Pensavi a me," to get the exact same meaning. It's annoying, but just watch for it in this section, because apparently whoever wrote it thinks that using the imperfect in an utterly pointless way will help us pay attention.
Pay attention because using this formula - imperfect of "stare" + gerund - as in that sentence, is very common in Italian. Although you think it's pointless, this is the language. Also, sometimes "stare + gerund" and "imperfect" are not interchangeable, because the meaning of the sentence can be different.
Are you thinking = Stai pensando (present)
Were you thinking = Stavi pensando (past)
Compared with the imperfect, the construction "present/imperfect of verb stare + gerund" has the purpose to underline the progress of the action, in the present or in the past. If you lived in Italy, you could hear how both of them are use in the language. When you know better Italian, you'll be also able to understand the difference and when they are interchangeable and when aren't.
Pensavi (past) = You thought (sometimes you were thinking)
Stavi pensando (past) = You were thinking (sometimes you thought)
It just depends from the context.
nerevarine1138, I'm Italian. I don't speak only about what I hear in my region. I grow up in Italy, I always have been reading Italian books and newspapers, watching Italian television, etc. I know my language, I studied it, a lot. And when I'm not sure about a rule, I search it.
So, if you want to read about that, in Italian, here's some links about the Italian gerund and the periphrastic structures: http://www.treccani.it/enciclopedia/gerundio_(Enciclopedia_dell'Italiano)/ http://www.treccani.it/enciclopedia/strutture-perifrastiche_(Enciclopedia_dell'Italiano)/
But you're wrong. You have to study better the Italian imperfect. Many times "you thought" means "pensavi". I'm absolutely sure.
Only an example:
"Pensavi che l'Italiano fosse facile" (You thought the Italian language was easy) is really different from "Stavi pensando che l'Italiano fosse facile". Because the first only expresses your thought in the past, in general, and can work alone, but the second refers to a particular time that you have to specify (e.g. "Stavi pensando che l'Italiano fosse facile quando ti sei reso conto che così non è - you were thinking the Italian language was easy when you realised that it wasn't").
But the thing is that I have lived in Italy and seen it go either way, trending more towards the imperfect being used rather than the imperfect and a gerund. Now, this was in Tuscany, so I accept that some regions may do it differently. But the thing is that "pensavi" doesn't mean "you thought", because the imperfect always implies an ongoing action.
when this was an english sentence to be translated into Italian, I tried using pensando and was marked wrong. If I used "di" in my response instead of "a", DL should have shown me I needed "a" instead of giving me a response of - mi pensavi? (and not using a gerund at all)
Grammatically it's correct, but the meaning can be different. e.g. If I tell you I have to choose someone for a job and you want to respond "Are you thinking of me?", in Italian you won't say "Mi stavi pensando?", but "Stavi pensando a me?", because you need to emphasize the object of thinking.