Skip to main content
3 of 4
added 11 characters in body
Bill
  • 12.4k
  • 13
  • 15

I haven't found a way to get DSolve to crack it, so turn to NDSolve

a=1;d=2;
sol={y[t],x[t]}/.NDSolve[{
  I y'[t] == Cos[a t] Exp[-I d t] x[t], I x'[t] == Cos[a t] Exp[I d t] y[t],
  y[0]==1,x[0]==1}, {y[t], x[t]}, {t,0,2}][[1]];
Plot[{Re[sol[[1]]],Im[sol[[1]]],Re[sol[[2]]],Im[sol[[2]]]},{t,0,2}]

which instantly gives you plots of the real and complex components of x and y.

Some people think everyone should use NDSolveValue and some think NDSolve, some people use {x,y} and some use {x[t],y[t]}. There are several different ways of doing almost anything in Mathematica. Pick a method that you can remember and use dependably without making too many mistakes.

Bill
  • 12.4k
  • 13
  • 15