Is the "dir" in "Ich glaube an dich." in accusative case while "dich" in "Ich glaube dich." in dative case, not the other way?
I encounter this in Duolingo and it seems very quirky and counter-intuitive.
"Glauben" can take both a dative and an accusative object. The person you believe must be in the dative, and what you believe in the accusative. Example:
Ich glaube dir deine Erklärung.
The accusative object is often a subordinary clause (Objektsatz). Example:
Ich glaube dir, dass das keine Absicht war.
With the preposition "an" things are different. In that case, you must use the accusative after "an".
In German language, you should not only learn the verb but also its details like whether it is seperable or not, takes dative or accusative, accepts a preposition or not, must take an object or not necessarily and so on.
In your question, glauben takes dative and because of this reason, it should be;
Ich glaube dir
or if you want to emphasize "believing with taste of the trust", the verb glauben takes preposition an and in such a case, you can also say;
ich glaube an dich
And you can also ask why did preposition an take an accusative instead of dative. It would require a huge explanation but briefly, I can say some prepositions take accusative, some prepositions take dative and some prepositions are two-way prepositions, meaning they can take either accusative or dative based on the situation. The preposition an, which glauben takes, is also one of the two-way prepositions and in case of glauben, it takes accusative instead of dative, resulting ich glaube an dich instead of ich glaube an dir.