Take for example this very simple differential equation with complex coefficients:
\begin{equation}\tag{1} f'(t) = - i f(t) \end{equation}
where t is a real variable. The solution is $f(t)=c e^{-i t}$. Since in Physics only real quantities have sense, a physicist would take only the real part of this solution, i.e. $f(t)= \cos(t)$. However, it is easy to see that $f(t)=\cos(t)$ is not a solution of (1) anymore. So, the question is: Of which equation is $f(t)=\cos(t)$ the solution? Is there a connection with Eq.(1) ?
PS. If one looks for real $f$ solutions, then from Eq.(1) we must have $f'(t)=0$ and $-i f(t)=0$, i.e. $f(t)=0$, which is another different solution ! Which is the correct answer ?
Take $f(t)= \cos(t)$ as a solution for the given differential equation is indeed wrong.
The differential equation associated to this (kind of) solution is the harmonic oscillator equation
$$f''(t) = - f(t) $$
which is related to the the given differential equation by the fact that
$$f''(t)=(f'(t))'=(- i f(t) )'=-if'(t)=-i(-if(t))=-f(t)$$