# Easy non-homogenous 2nd order diff.eq

1. Nov 10, 2009

### Dissonance in E

1. The problem statement, all variables and given/known data

Find the general soulution to :
y'' = sin(2x)
and the particular solution that satisfies:
y(0) = −1/4, y(pi/4) = pi/2.

2. Relevant equations
y = c1y1(x) + c2y2(x) + yp(x)

3. The attempt at a solution
y'' = sin2x ----> y = -sin(2x)/4
-0.25C1sin(2x) - 0.25C2sin(2x)
Is there a more surefire method of finding the satisfying function than just simply intuition.

y(0) = -1/4
-0.25C1sin(2(0)) - 0.25C2sin(2(0)) + yp(0) = -1/4

yp(0) = -1/4
yp(pi/4) = pi/2

Id guess yp(x) is something like -0.25cos(x) as that would give -1/4 at yp(0)
However im sure theres a formal pattern to finding these solutions so idk very much like to have that at my disposal. thanks

2. Nov 10, 2009

### Staff: Mentor

This is a fairly simple linear, constant coefficient nonhomogeneous problem. In solving nonhomogeneous, you always look at the associated homogenous problem, which is y'' = 0. The solution to the homogeneous problem is yh = A + Bx. You can use the initial conditions to find A and B.

A particular solution to your nonhomogeneous problem is yp = Csin(2x) + Dcos(2x). Calculate yp'' and you should be able to solve for C and D.

Whenever your "forcing function" (the function that makes the equation nonhomogeneous) is either sin(kx) or cos(kx), the particular solution has to include both sin(kx) and cos(kx). The short explanation for this goes back to the characteristic equation having quadratic factors with complex or purely imaginary roots. These roots come in pairs, and this is related to the need for both sin(kx) and cos(kx) terms.

3. Nov 10, 2009

### LCKurtz

Just to add a point to Mark's comments. You don't want to use the initial conditions to find A and B before you have added the particular solution to the complementary solution, because until you do that, you don't have the general solution in the first place.