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: Please help with second order ODE

  1. Dec 30, 2012 #1
    1. The problem statement, all variables and given/known data
    basically solve [itex]\frac{d^{2}y}{dx^{2}}[/itex] + 4[itex]\frac{dy}{dx}[/itex] + 4y = cos2x

    Boundary conditions are y=0, dy/dx =1 at x=0

    2. Relevant equations

    3. The attempt at a solution
    I am having trouble getting the coefficients to the solution. I got the complementary function as y[itex]_{cf}[/itex] = (A[itex]_{1}[/itex]x+A[itex]_{2}[/itex])e[itex]^{-2x}[/itex]

    and the paticular integral is y[itex]_{PI}[/itex] = Bcos2x
    So first I find coefficient B I [itex]\frac{dy}{dx}[/itex] = -2Bsin2x
    and [itex]\frac{d^{2}y}{dx^{2}}[/itex] = -4Bcos2x

    Now I sub back into equation and compare coefficients I get -4Bcos2x -8Bsin2x + 4Bcos2x = cos2x
    This simplifies to -8Bsin2x = cos2x. I am not sure how I am supposed to compare coefficients here, in the answers it looks like the particular integral is [itex]\frac{1}{8}[/itex] sin2x. If I rearrange -8Bsin2x = cos2x I get B = - [itex]\frac{1}{8}[/itex]cotx

    So not only have I got the trig function wrong but I got the sign wrong too, have I done something wrong elsewhere?

  2. jcsd
  3. Dec 30, 2012 #2


    User Avatar
    Homework Helper

    You need
    in general you would need
    but in this problem A=0
  4. Dec 30, 2012 #3


    User Avatar
    Science Advisor

    No, it isn't. In general, for a sine or cosine you will need both sine and cosine. As lurflurf says, for this particular problem it turns out you only need sin(2x) but it is difficult to see that before actually doing the calculations. Instead try both.

    The fact that you wound up with both sine and cosine should have made you go back and try "Acos(2x)+ Bsin(2x)" even if you hadn't seen it before.

    The "sign" is not the problem. The real problem is that cot(x) is not a constant! Didn't you notice that?
  5. Dec 30, 2012 #4
    Right yes thanks I have solved it now and got the right answer, can I just confirm a few things?

    So say I got the paticular integral to be [itex]\frac{1}{8}[/itex]Sin 2x.

    So my general solution to this is y = (A[itex]_{1}[/itex]x + A[itex]_{2}[/itex])e[itex]^{-2x}[/itex] + [itex]\frac{1}{8}[/itex]Sin 2x

    I apply the boundary conditions to be general solution right? and not to the original equation?

    Boundary conditions are y=0, dy/dx =1 at x=0

    So I get A[itex]_{2}[/itex] = 0

    Then I differentiate my general solution to apply the second boundary condition, that dy/dx =1

    and I got the required coefficients, is this the best/correct method?

  6. Dec 30, 2012 #5


    User Avatar
    Science Advisor

    Yes, that is correct. The boundary conditions are to be satisfied by the solution to the entire equation, not just the solution to the associated homogeneous equatioin (which is, I think, what you meant by "the original equation").

    Yes, [itex]y(0)= (A_1(0)+ A_2)e^0+ sin(0)= A_2= 0[/itex]

    Yes. With [itex]A_2= 0[/itex], your general solution is [itex]y(x)= A_1xe^{-2x}+ (1/8)sin(2x)[/itex] and its derivative is [itex]y'(x)= A_1e^{-2x}- 2A_1xe^{-2x}+ (1/4)cos(2x)[/itex]. Evaluate that at x= 0, set it equal to 1 and solve for [itex]A_1[/itex].
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook