For a homework problem, we are provided:
$\frac{dx}{dt}=-y + t$
$\frac{dy}{dt}=x-t$
Putting these into differential operator notation and separating the dependent variables from the independent:
$Dx-y=t$
$Dy-x=-t$
My first inclination is to apply the D operator to the second equation to eliminate Dx and get:
$D^2y+y=t-1$
I solve the homogenous part and end up with $y_c=C_1\cos(t) + C_2\sin(t).$
Using annihilator approach and method of undetermined coefficients, I determine that $y_p=t-1$.
General solution for $y(t) = C_1\cos(t)+C_2\sin(t)+t-1$.
After plugging $y$ into the second equation, I get $x(t)=-C_1\sin(t)+C_2\cos(t)+1+t$
Checking my answer against the back of the book, they show: $x(t) = C_1\cos(t)+C_2\sin(t)+t+1$ and $y(t)=C_1\sin(t)-C_2\cos(t)+t-1$
I can't seem to find what I did wrong. Chegg solutions shows to eliminate y instead of x, and got the book's solution. Does the variable chosen for elimination matter? Halp!
Are you sure the original system is written as it is in the book? (Problem was updated to correct $x(t), y(t))$.
I get $$x'' +x = t + 1 \implies x(t) = c_1 \cos t + c_2 \sin t + t + 1$$ and $$y'' + y = t - 1 \implies y(t) = c_1 \sin t + c_2 \cos t + t - 1.$$
Note: this can be written as $y(t) = c_1 \sin t - c_2 \cos t + t - 1$ because $c_2$ is an arbitrary constant. Showing the negative removes the confusion when plugging back in so the authors decided to show it as part of the solution.
You can easily verify this solution by plugging it back into the original system.
Update Lets do the first in more detail. We have:
$$x'' +x = t + 1$$
To solve the homogeneous, we have $m^2 + 1 = 0 \implies m_{1,2} = \pm ~ i$, yielding:
$$x_h(t) = c_1 \cos t + c_2 \sin t$$
For the particular, we can choose $x_p = a + b t$, and substituting back into the DEQ, yields:
$$x'' + x = a + bt = 1 + t \implies a = b = 1$$
This produces:
$$x(t) = x_h(t) + x_p(t) = c_1 \cos t + c_2 \sin t + t + 1$$