y"-y'=sin x

solve in undetermined coefficients

probably sinusoidal

y = a sin x + b cos x
y' = a cos x - b sin x
y" = -a sin x - b cos x = -y

-a sx -b cx -a cx + b sx = 1 sx
b = -a
-a + b = 1

-2a = 1
a = -1/2
b = +1/2
so I get y = -(1/2) (sin x - cos x)

That pesky y' gets in the way. The solution is really

y = c1 e^x + c2 - 1/2 (sinx - cosx)

Whoops, yes, use Steve's

To solve the given differential equation using the method of undetermined coefficients, we need to assume a particular solution and then find the complementary solution.

Let's start by assuming a particular solution of the form:

y_p = A sin(x) + B cos(x)

Here, A and B are arbitrary constants to be determined. Now, we'll find the derivatives of y_p.

y'_p = A cos(x) - B sin(x)
y''_p = -A sin(x) - B cos(x)

Substituting these derivatives back into the original differential equation, we get:

-y''_p + y'_p = sin(x)

(-A sin(x) - B cos(x)) - (A cos(x) - B sin(x)) = sin(x)

Expanding and rearranging, we have:

-A sin(x) - B cos(x) - A cos(x) + B sin(x) = sin(x)

Simplifying further:

(-A - A) sin(x) + (B - B) cos(x) = sin(x)
-2A sin(x) = sin(x)

Now, comparing the coefficients on both sides, we see that -2A = 1. Solving for A, we find A = -1/2.

Substituting this value of A back into the particular solution, we have:

y_p = (-1/2)sin(x) + Bcos(x)

Now, let's find the complementary solution. We consider the homogeneous equation obtained by setting the right-hand side of the original equation to zero:

y'' - y' = 0

The characteristic equation is:

r^2 - r = 0

Factoring this equation, we get:

r(r - 1) = 0

So, the solutions to the characteristic equation are r = 0 and r = 1. Thus, the complementary solution is:

y_c = C1e^x + C2

where C1 and C2 are arbitrary constants.

Finally, the general solution to the given differential equation is the sum of the particular and complementary solutions:

y = y_p + y_c
= (-1/2)sin(x) + Bcos(x) + C1e^x + C2

Therefore, the solution to the given differential equation in undetermined coefficients is:

y = (-1/2)sin(x) + Bcos(x) + C1e^x + C2, where B, C1, and C2 are arbitrary constants.