In a textbook on quantum field theory I come across the following differential equation.
$$ i \partial_t U(t) = H(t) U(t) $$
I would say that the solution to this equation would be
$$U(t) = e^{-i \int_0^t dt H(t) }$$
Since
$$ \partial_t e^{-i \int_0^t dt H(t) } = \partial_t ( -i\int_0^t dt H(t))e^{-i\int_0^t dt H(t) } = -i H(t) e^{-i\int_0^t dt H(t) } = -i H(t) U(t)$$
exactly as desired.
However the solution in the textbook states:
$$ T(e^{-i\int_0^t dt H(t) })$$
where T stands for the time order parameter. In other words the solution should be
$$ U(t) = 1 -i \int_0^t dt_1 H(t_1) + \frac{1}{2}(-i)^2 \int_0^{t} \int_0^{t} dt_t dt_2 T(H(t_1)H(t_2)) + \cdots $$
where $T(H(t_1)H(t_2))$ equals $H(t_1)H(t_2)$ if $t_1<t_2$ and $H(t_2)H(t_1)$ otherwise.
So why is this the correct solution? What goes wrong in the reasoning above?
Your solution is only correct if the ODE is scalar, that is $U$ is one-dimensional, or all matrix values of $H(t)$ commute with each other.
In the more general non-commuting case the exponential formula is wrong and you need to apply the time order operation.