1

I was solving these DEs

$\frac{dx}{dt} = -y+t$
$\frac{dy}{dt} = x-t$

Doing it by elimination they become

$x''+x = t+1$
$y''+y = t-1$

...for $x$ and $y$ respectively. If I solve those I get

$x = c_1\cos(t) + c_2\sin(t) + t + 1$
$y = c_1\cos(t) + c_2\sin(t) + t - 1$

Now, it makes sense to me that the general solution (Cos and Sin part) is the same for both cases, but the solution says

$x = c_1\cos(t) + c_2\sin(t) + t + 1$
$y = c_1\sin(t) - c_2\cos(t) + t - 1$

And this happens with the solutions of a few other problems too, so I'm not quite convinced it's just a print error. Am I doing something wrong?

Nick Matteo
  • 9,316
Mitch
  • 45
  • @Moo So to verify I should check $Cos(t)c2-Sin(t)c1+1 = -Cos(t)c1-Sin(t)c2-t+1-t$ ? What do I do if they're not? Find a value of c1 and c2 that makes them equal and correct the ones I got? – Mitch Dec 06 '16 at 21:23
  • @Moo So I can just make the signs of the terms with constants be positive or negative when I want in order to make LHS = RHS? That looks pretty cheaty. I guess that would mean that there are several different ways to write an answer. – Mitch Dec 06 '16 at 21:39

2 Answers2

3

Let's check your answers: $$x = c_1\cos t + c_2\sin t + t + 1\\y = c_1\cos t + c_2\sin t + t - 1$$ So $$x' = -c_1\sin t + c_2 \cos t + 1$$ while $$-y + t = -c_1\cos t - c_2\sin t + 1$$ The only case where these two are the same for all $t$ is when $c_1 = c_2 = 0$.

Now, let's try the given solution: $$x = c_1\cos t + c_2\sin t + t + 1\\y = c_1\sin t - c_2\cos t + t - 1$$

$x'$ is the same as before, but $$-y + t = -c_1\sin t + c_2\cos t + 1$$ which is equal to $x'$.

And $$y' = c_1\cos t + c_2\sin t - 1$$ which is also $x - t$.

So their solution works and yours does not.

"Makes sense to me" is not the best means of evaluating your work. You may have overlooked something, like the impact of that minus sign in $$\frac d{dt}\cos t = -\sin t$$ and that differentiating cosine and sine swaps which functions are associated with $c_1$ and $c_2$.

Paul Sinclair
  • 45,932
3

What you are doing wrong is taking the constants $c_1$ and $c_2$ you used to write the "general" solution for $x(t)$ and re-using them to write the general solution for $y(t)$.

Even though you separated $x$ and $y$ they still have to satisfy your original "mixed" equations. By re-using $c_1$ and $c_2$ you are assuming that if, say through the addition of some initial conditions, we find that the co-efficient on the $sin$ term in $x$ is 3, then the the co-efficient on the $sin$ term of $y$ must also necessarily be 3. Nothing justifies this.

Here's what you should do:

  • Separate them, just like you did
  • Write the general solution for $x(t)$, using $c_1$ and $c_2$
  • Then write the general solution for $y(t)$, using new co-efficients $c_3$ and $c_4$
  • Substitute these solutions back into the original equations to see what restrictions this places on the $c$'s. If this yields something complicated all you can do is state this as a requirement for your $x$ and $y$ to be solutions. Or it might be simple and let you re-write some of the $c$'s in terms of others, and you can eliminate those $c$'s completely.

I haven't worked out the details, but I'll bet that in your case the last step will give you $c_1 = c_3$ and $c_2 = -c_4$, so eliminating $c_3$ and $c_4$ will give you the given solution.

JonathanZ
  • 12,727