Quantum algorithm for solving linear differential equations: Theory and experiment