  A semidiscrete Galerkin finite element method applied to time-fractional
diffusion equations with time-space dependent diffusivity on bounded convex
spatial domains will be studied. The main focus is on achieving optimal error
results with respect to both the convergence order of the approximate solution
and the regularity of the initial data. By using novel energy arguments, for
each fixed time $t$, optimal error bounds in the spatial $L^2$- and $H^1$-norms
are derived for both cases: smooth and nonsmooth initial data.
