The chemical reactions and pathways involving dihydrofolate, the dihydroxylated derivative of folate.