2
$\begingroup$

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?

$\endgroup$
3
  • 2
    $\begingroup$ 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. $\endgroup$ Mar 19, 2019 at 18:42
  • 1
    $\begingroup$ Maple can solve analytically. $\endgroup$ Mar 19, 2019 at 20:48
  • $\begingroup$ Mathematica 12.0 can't solve. $\endgroup$ Apr 12, 2019 at 16:31

1 Answer 1

3
$\begingroup$

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]))}
*)
$\endgroup$
1
  • $\begingroup$ Yeah, I got the same solutions by manually eliminating x and sonving a single differential equation. Thanks. $\endgroup$
    – Rodrigo
    Mar 20, 2019 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.