# System of coupled differential equations

I am trying to solve the following system of equations, but I get as the output the command itself.

eq1=D[y[t],t]==I*w1*y[t]-I*k*Exp[I*w*t]*Exp[I*\[Phi]]*x[t];
eq2=D[x[t],t]==-I*w2*x[t]+I*k*Exp[-I*w*t]*Exp[-I*\[Phi]]*y[t];
DSolve[{eq1, eq2},{x[t],y[t]},t]


Is there anything wrong with the code?

• The code works fine if you replace w with 0, so I suspect that this is simply a problem that Mathematica can't solve analytically. – Michael Seifert Mar 19 at 18:42
• Maple can solve analytically. – Mariusz Iwaniuk Mar 19 at 20:48
• Mathematica 12.0 can't solve. – Mariusz Iwaniuk Apr 12 at 16:31

The problem can also be solved by eliminating x from the system first:

xfunc[t_] = x[t] /. First@Solve[eq1, x[t]];

ysol[t_] = y[t] /. First@DSolve[eq2 /. x -> xfunc, y, t]

(*
E^(1/2 I t (w + w1 - w2 + I Sqrt[-(w + w1 - w2)^2 - 4 (-k^2 - w w1 + w1 w2)])) C[1] +
E^(1/2 t (I (w + w1 - w2) + Sqrt[-(w + w1 - w2)^2 - 4 (-k^2 - w w1 + w1 w2)])) C[2]
*)

xsol[t_] = x[t] /. First@DSolve[eq1 /. y -> ysol, x, t]

(*
{(1/k)(-(1/2) I E^(-I t w - I ϕ) Sqrt[
4 k^2 - w^2 + 2 w w1 - w1^2 + 2 w w2 - 2 w1 w2 -
w2^2] (E^(1/
2 I t (w + w1 - w2 +
I Sqrt[4 k^2 - w^2 + 2 w w1 - w1^2 + 2 w w2 - 2 w1 w2 - w2^2])) C[1] -
E^(1/2 t (I (w + w1 - w2) + Sqrt[
4 k^2 - w^2 + 2 w w1 - w1^2 + 2 w w2 - 2 w1 w2 - w2^2])) C[2]) -
1/2 E^(-I t w -
I ϕ) (w - w1 -
w2) (E^(1/2 I t (w + w1 - w2 +
I Sqrt[4 k^2 - w^2 + 2 w w1 - w1^2 + 2 w w2 - 2 w1 w2 - w2^2])) C[1] +
E^(1/2 t (I (w + w1 - w2) + Sqrt[
4 k^2 - w^2 + 2 w w1 - w1^2 + 2 w w2 - 2 w1 w2 - w2^2])) C[2]))}
*)

• Yeah, I got the same solutions by manually eliminating x and sonving a single differential equation. Thanks. – Rodrigo Mar 20 at 11:31