Semilinear hyperbolic equations and the dynamics of gut bacteria