Time complexity analysis of quantum algorithms via linear representations for nonlinear ordinary and partial differential equations