# Solving Inhomogeneous Differential Equations Using the Undetermined Coefficients Method

I am trying to solve the following question in my homework:

Use the method of undetermined coefficients to solve the following differential equation: $$y'' + y = -\sin(x), \ y(0) = 0, \ y'(0) = 0.$$

I feel that I have a fairly good grasp of the concepts, that I need to find a general solution of the homogeneous equation and then a particular solution. Then I need to solve for the constants $c_1$ and $c_2$ by plugging in the initial conditions. However, my answer is not being accepted by the computer program my teachers use. Here is my answer: $$y = -0.5\sin(x) + 0.5x\cos(x).$$ I have checked this answer several times by finding its first and second derivatives, plugging both into the original DE, and also plugging in the initial conditions. I am wondering if there is a typo, since my teachers create our homework online. Is anyone getting the same answer? I want to know if I need to approach my teachers and tell them that there is a possible typo in the homework. Thank you!

• Thank you for the consensus. I gave your variant a try, but it did not take it. I will get in touch with my profs at this point. – Catherine Porter Oct 11 '14 at 0:00
• I actually copied and pasted it, but I double checked. It's the same. – Catherine Porter Oct 11 '14 at 0:37
• I tried the question and get the same answer as yours! Discuss with your teacher to see if there is any typos!:) – Nighty Oct 12 '14 at 13:32
• Your answer is correct. – JohnD Oct 14 '14 at 3:26
• I have discussed this with my professors. They have made a correction to the online homework, and all is fixed. Thanks! – Catherine Porter Oct 14 '14 at 16:13