Topology optimization of differentiable microstructures