1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Method of undetermined coefficients

  1. Feb 20, 2010 #1
    1. The problem statement, all variables and given/known data
    y'' + y = sin x + x*cos x

    2. Relevant equations

    3. The attempt at a solution
    i don't like undetermined coefficients. so far, for me, it's been so much trial and error, although i am getting a little faster at it.
    anyway, i didn't work out the homogeneous equation, but i can see it'll be something with complex roots. i worked out the part for sin x and got yp=-1/2*x*cos x.
    now, with x*cos x, i tried a*x2sin x + b*x2cos x.
    when i plug all this in to the original equation, i get
    (4ax + 2b) cos x + (2a+4bx)sin x. so, i think i need to get 4ax + 2b = x, and 2a+4bx=0, right? i don't see any other way than to let 4a =1, and 2b=0, but this doesn't work in getting 2a+4bx=0. am i making some dumb mistake?
  2. jcsd
  3. Feb 20, 2010 #2


    Staff: Mentor

    You need to work out the homogeneous equation first, since that will have a direct impact on your particular solution in this problem. The roots of the characteristic equation are complex, it's true, but your solutions don't have to be.

    For example, if the roots of the char. equation are r = a +/- bi, you can take your solutions to be y1 = e^(ax)cos(bx) and y2 = e^(ax)sin(bx).
  4. Feb 21, 2010 #3
    i know that. in this case, the roots are i and -i, so the homogeneous solution is (c1sinx + c2cosx), and one of the particulars is yp=-1/2*x*cos x. i know my other solution must be linearly independent, of these two, so (and here i'm not sure) it would i try some x^n (probably x^2) times some cos or sin? when i do this, so far the closest i've gotten is the above solution, but i can't work out the coefficients. and, i don't see where i'm making a mistake. that's why i was saying this method is frustrating, because it's so much trial and error, at least until you get the hang of it. i'm having luck with simpler versions of this method, but with more complex ones, like the above, and especially with another one i'm working on, sin^2(x).
    i'm not sure if i've tried some polynomial times sin or cos for the above (i've been going over this for a while). does that sound like a better solution? any hint would be helpful, but i'll continue working on it, and post my results.
  5. Feb 21, 2010 #4


    Staff: Mentor

    For a particular solution, I would try yp = Axsin(x) + Bxcos(x) + Cx2sin(x) + Dx2cos(x), and go from there. I'm not sure that you can pick out one part of the forcing function (the part on the right side of the equation that makes the DE nonhomogeneous) and determine the coefficients. IOW, I don't think you can find the particular solution one part at a time.

    For your other DE, with sin2(x) on the right side, you'll probably need to use variation of parameters, since the technique used in this problem won't produce sin2(x).
  6. Feb 23, 2010 #5
    it will if i use the identity sin2x= (1- cos 2x)/2, which i did, and found a solution.

    and you can split the right hand side up. i mean, the general solution is a particular plus the homogeneous. i saw a nice video on youtube the other day that went over this. it basically went over how if you put in the general solution into the diff eq, everything distributes out.

    for most of the time i've done math, i've done it by knowing facts, looking at examples, and then working them out. i've been trying to do a better job of actually understanding what it is i'm doing lately.

    thanks for the other part, i'll definitely try that.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook