# Coupled Differential equation with integral of its parameters

everyone, I have a set of coupled differential equations as is shown below,

and these equations actually describe the interaction of a two-level atom (amplitude is ce(t)) and single-photon (photon with wavevector k and amplitude c(k,t)) in a one-dimensional waveguide. We can easily find the analytical solution by bringing the second formula into the first formula and changing the order of integration, then we can obtain the following equations

But I want to directly solve the equations numerically via Mathematica, I know it's difficult to do since we need solve an infinite number of differential equations in principle. I have searched the solution on stack exchange and find the following solutions,

and I write the coupled differential equations in Mathematica as follows

\[Kappa] = 1;
NDSolve[{ce'[t] == -I*(Sqrt[\[Kappa]]*Integrate[ck[k, t], {k, -3, 3}]),
D[ck[k, t], t] == -I*(k*ck[k, t] + Sqrt[\[Kappa]] ce[t]),
ck[k, 0] == 1/(k + 3*I/2), ce[0] == 0}, {ce[t], ck[k, t]}, {t, 0,
10}, {k, -3, 3}]


and the error happens,

so how can I write down the coupled differential equations with parameters that have integrals?

First, all the searched for functions must have the same arguments. With this you can not simply write "ce' " but you have to write: D[ce[k,t],t]:
\[Kappa] = 1;

• Thank you so much for your reply, I think writing the program in your way can let the program runs in Mathematica without errors, however, I think it also changes the original equations? Since ce(k,t) should originally be independent on k, but I will obtain different evolutions of |ce(t)| for different k Apr 3, 2021 at 13:03