# Diffe Q, a forced harmonic oscillator

1. May 13, 2006

### 2cansam

okay this is kind of a quick one when youre solving a forced harmonic oscillator for an initial condition by the method of undetermined coefficients, you do the part for the homogenoues equation first and come up with somethign like ke^at + ce^bt. Now when you goto solve for those constants k and c using your initial conditions do you use the general soltion form the nonhomogenous part as well? so it would either be ke^at + ce^bt = d -or- ke^at + ce^bt+re^dt = f

Thanks in advance and sorry about my rapant use of variables and poor math notation

2. May 14, 2006

### HallsofIvy

Staff Emeritus
Yes, of course. The initial conditions apply to the function that satisfies the entire equation. You must use that function, both "homogeneous" and "non-homogeneous" parts to satisfy the initial conditions.

For example, to solve y"+ 4y= x, y(0)= 0, y'(0)= 0.
The associated homogeneous equation is y"+ 4y= 0 which has characteristic equation r2+ 4= 0 and so characteristic values 2i and -2i. The general solution to that homogeneous equation is
y(x)= kcos(2x)+ c sin(2x). Now, using the method of "undetermined coefficients, we seek a particular solution to the entire equation of the form y(x)= Ax+ B. Then y'= A and y"= 0 so the equation becomes
0+ 4(Ax+ B)= 4Ax+ 4B= x. Clearly, A= 1/4 and B= 0. The general solution to the entire equation is y(x)= kcos(2x)+ csin(2x)+ x/4. Of course, then, y'(x)= -2ksin(2x)+ 2ccos(2x)+ 1/4.

Now, we have y(0)= k= 0 and y'(0)= 2c+ 1/4= 0 so c= -1/8. The solution to the problem is y(x)= -(1/8)sin(2x)+ x/4.

Since y(x)= 0 (y identically equal to 0) satisfies any homogeneous differential equation, if we just used the homogeneous equation to satisfy these initial conditions we would have just got y(x)= 0 and so, adding the particular solution, y(x)= x/4 which does NOT satisfy
y'(0)= 0.

3. May 15, 2006

### 2cansam

thanks man , haha yeah i guess it is pretty obvious looking back at it now. Thanks a bunch man