# Solving a system of forced, coupled, differential equations

Given a system of forced, coupled, differential equations $$\ddot{x}(t) + \dot{x}(t) + \omega_{z}^{2} x(t) = F_{0} \cos(\omega_{0} t) y(t)$$ $$\ddot{y}(t) + \omega_{y}^{2} y(t) = F_{0} \cos(\omega_{0} t) x(t)$$ which I have solved it with pen and paper.

I'd like to see if Mathematica agrees with me using DSolve. If I follow the same algebraic steps I used to solve the system by hand, but using Mathematica to verify the steps, I get the same result as my pen and paper approach (but that doesn't rule out my method was wrong).

When solving the system by hand I chose solutions $$x(t) = A e^{-i \omega_{x} t} X(t) \quad {\text{and}} \quad y(t) = B e^{-i \omega_{y} t} Y(t)$$ where I make the assumption $$\ddot{X}(t) = \ddot{Y}(t) = 0$$.

My Mathematica approach is

x[t] = A Exp[-I wx t] X[t];
y[t] = B Exp[-I wy t] Y[t];

X''[t] = 0;
Y''[t] = 0;

xSystem = D[x[t], {t, 2}] + D[x[t], t] + wz^2 x[t] == F0 Cos[w0 t] y[t]
ySystem = D[y[t], {t, 2}] + wy^2 y[t] == F0 Cos[w0 t] z[t]

DSolve[
{
xSystem , ySystem ,
X[0] == X0, X'[0] == vX0, Y[0] == Y0, Y'[0] == vY0
},  {X[t], Y[t]}, t
]


This returns the error:

For some branches of the general solution, the given boundary conditions lead to an empty solution


What am I missing? I am also open to other alternatives, DSolve is simply the approach i first reached for.

• What do you think will happen to your ode's when you add X''[t] = 0; Y''[t] = 0; ? Try xSystem /. X''[t] -> 0; ySystem /. Y''[t] -> 0 and you will see they become first order odes's now in X and Y. Basically you deleted the second order derivatives from your odes. I have no idea why you did that, but If you remove X''[t] = 0; Y''[t] = 0; then it will solve them (with some internal warnings from Solve. Commented Jan 10, 2023 at 11:45
• If you want to set this condition X''=Y''=0 then first solve the ode's for X and Y as second order odes', then take second derivatives of the solutions found, and only then set up this equation. i.e. do it after solving. not before solving. Commented Jan 10, 2023 at 11:54
• Okay removing the X''[t] = 0; Y''[t] = 0;' did indeed improve things, albeit with a strange integral identity in the solution. Could you show me what you mean in your second comment? Commented Jan 10, 2023 at 12:32

Could you show me what you mean in your second comment?

This is little too long for comment. But basically solve the system, then set up your equation you wanted. I admit I do not understand why you are doing this. i.e. what is the point of $$X''(t)=0,Y''(t)=0$$ but you know better than me about this.

ClearAll["Globals*"]
x[t_] := A Exp[-I wx t] X[t];
y[t_] := B Exp[-I wy t] Y[t];
xSystem = D[x[t], {t, 2}] + D[x[t], t] + wz^2 x[t] == F0 Cos[w0 t] y[t]
ySystem = D[y[t], {t, 2}] + wy^2 y[t] == F0 Cos[w0 t] z[t]
ode = {xSystem, ySystem}
ic = {X[0] == X0, X'[0] == vX0, Y[0] == Y0, Y'[0] == vY0};
{solX, solY} = DSolveValue[{ode, ic}, {X[t], Y[t]}, t];


And now your equations are

eq1 = D[solX, {t, 2}] == 0;
eq2 = D[solY, {t, 2}] == 0;


They are very long and complicated with integrals in them.

If you explain better why you wanted these equations may be this will help. But the above does what you want.