When tensors transform covariantly, they transform the same way that the basis vectors eμ transform. When tensors transform contravariantly, they transform the opposite way that the basis vectors transform.
As an example, consider the Cartesian coordinate system:
and we transform the bases eμ→e~μ:
e~μ=2eμ
The vector has to stay invariant (xμeμ=x~μe~μ=2x~μeμ). Considering the vector x:
xμeμxμx~μ=2x~μeμ,=2x~μ,=21xμ.
For our vector x=2ex+3ey, the transformed components would be:
x~xx~yx=1,=23,=e~x+23e~y.
In general when transforming the coordinates xμ→x~μ a general tensor Tαβ...γδ...→T~αβ...γδ... is transformed as follows:
Two notes: the partial derivatives have one upper and one lower index, so we are employing the Einstein summation convention. The second note: I am using latin and greek letters. I am using latin indices for space components and greek indices for spacetime components in general relativity. Here they are used for simplicity and don't have any special meaning.
We can make sense of the above relationship by considering a vector x parametrized by λ and its tangent vector dλdx. By chain rule:
dλdx=∂xμ∂xdλdxμ=dλdxμeμ.
Now, consider a transformation xμ→x~μ. The tangent vector is equal to:
dλdx=∂x~μ∂xdλdx~μ=dλdx~μe~μ.
We can apply chain rule on the last part:
dλdx~μe~μ=∂xν∂x~μdλdxνe~μ,
implying the component dλdx~μ in the new basis e~μ is equal to:
dλdx~μ=∂xν∂x~μdλdxν,
Now, consider a covector df:
df=∂xμ∂fdxμ=∂xμ∂fϵμ.
Now, consider a transformation xμ→x~μ. The covector is now equal to:
df=∂x~μ∂fdx~μ=∂x~μ∂fϵ~μ.
And similarly, we can apply chain rule on the last part:
∂x~μ∂fϵ~μ=∂xν∂f∂x~μ∂xνϵ~μ,
implying:
∂x~μ∂f=∂xν∂f∂x~μ∂xν.
For the transformation xμ→x~μ, the partial derivatives ∂x~μ∂xμ form the Jacobian which is used for covariant transformation: