Differentiability and analyticity of topological entropy for Anosov and geodesic flows