How Do You Solve a Second Order ODE with Specific Boundary Conditions?

Click For Summary

Homework Help Overview

The discussion revolves around solving a second-order ordinary differential equation (ODE) with specific boundary conditions. The equation in question is \(\frac{d^{2}y}{dx^{2}} + 4\frac{dy}{dx} + 4y = \cos(2x)\), with boundary conditions specified as \(y=0\) and \(\frac{dy}{dx} = 1\) at \(x=0\).

Discussion Character

  • Mixed

Approaches and Questions Raised

  • Participants discuss the complementary function and particular integral, with one participant initially proposing a particular integral of the form \(B\cos(2x)\) but later questioning this choice. Another participant suggests that both sine and cosine terms should be considered for the particular integral, noting that the specific problem allows for simplification.

Discussion Status

Some participants have provided guidance on the correct form of the particular integral and the necessity of applying boundary conditions to the general solution. There is acknowledgment of the need to differentiate the general solution to satisfy the boundary conditions, and some participants confirm their understanding of the process.

Contextual Notes

Participants express uncertainty about the comparison of coefficients in the context of the ODE and the implications of boundary conditions on the general solution. There is a focus on ensuring that the boundary conditions are applied correctly to the entire solution rather than just the homogeneous part.

DunWorry
Messages
40
Reaction score
0

Homework Statement


basically solve \frac{d^{2}y}{dx^{2}} + 4\frac{dy}{dx} + 4y = cos2x

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


Homework Equations





The Attempt at a Solution


I am having trouble getting the coefficients to the solution. I got the complementary function as y_{cf} = (A_{1}x+A_{2})e^{-2x}

and the paticular integral is y_{PI} = Bcos2x
So first I find coefficient B I \frac{dy}{dx} = -2Bsin2x
and \frac{d^{2}y}{dx^{2}} = -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 \frac{1}{8} sin2x. If I rearrange -8Bsin2x = cos2x I get B = - \frac{1}{8}cotx

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

Thanks
 
Physics news on Phys.org
You need
yp=Bsin(2x)
in general you would need
yp=Acos(2x)+Bsin(2x)
but in this problem A=0
 
DunWorry said:

Homework Statement


basically solve \frac{d^{2}y}{dx^{2}} + 4\frac{dy}{dx} + 4y = cos2x

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

Homework Equations


The Attempt at a Solution


I am having trouble getting the coefficients to the solution. I got the complementary function as y_{cf} = (A_{1}x+A_{2})e^{-2x}

and the paticular integral is y_{PI} = Bcos2x
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.

So first I find coefficient B I \frac{dy}{dx} = -2Bsin2x
and \frac{d^{2}y}{dx^{2}} = -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 \frac{1}{8} sin2x. If I rearrange -8Bsin2x = cos2x I get B = - \frac{1}{8}cotx
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.

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

Thanks
The "sign" is not the problem. The real problem is that cot(x) is not a constant! Didn't you notice that?
 
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 \frac{1}{8}Sin 2x.

So my general solution to this is y = (A_{1}x + A_{2})e^{-2x} + \frac{1}{8}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_{2} = 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?

Thanks
 
DunWorry said:
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 \frac{1}{8}Sin 2x.

So my general solution to this is y = (A_{1}x + A_{2})e^{-2x} + \frac{1}{8}Sin 2x

I apply the boundary conditions to be general solution right? and not to the original equation?
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").

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

So I get A_{2} = 0
Yes, y(0)= (A_1(0)+ A_2)e^0+ sin(0)= A_2= 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?

Thanks
Yes. With A_2= 0, your general solution is y(x)= A_1xe^{-2x}+ (1/8)sin(2x) and its derivative is y'(x)= A_1e^{-2x}- 2A_1xe^{-2x}+ (1/4)cos(2x). Evaluate that at x= 0, set it equal to 1 and solve for A_1.
 

Similar threads

Replies
4
Views
2K
Replies
11
Views
2K
Replies
33
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 21 ·
Replies
21
Views
2K
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
7
Views
2K