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

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.
 
Prove $$\int\limits_0^{\sqrt2/4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx = \frac{\pi^2}{8}.$$ Let $$I = \int\limits_0^{\sqrt 2 / 4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx. \tag{1}$$ The representation integral of ##\arcsin## is $$\arcsin u = \int\limits_{0}^{1} \frac{\mathrm dt}{\sqrt{1-t^2}}, \qquad 0 \leqslant u \leqslant 1.$$ Plugging identity above into ##(1)## with ##u...
Back
Top