# Help needed in solving an IVP D.E. over 2 intervals

1. Dec 13, 2008

### bobmerhebi

1. The problem statement, all variables and given/known data

y" +4y = g(x) ; y (0) = 1 & y(0) = 2

g(x) =
sinx , 0 $$\leq$$x $$\leq$$ pi/2
0 , x $$\succ$$ pi/2

2. Relevant equations

3. The attempt at a solution

1> g(x) = sin x

solving i get :
yc = ec1sin2x + ec2cos2x

US set of sin x = {sinx, cosx} so yp = Asinx + Bcosx

solving i get:
yp = (1/3)sinx

so
y = ec1sin2x + ec2cos2x + (1/3)sinx ...(1)

for the conditions given i get:

c1 = 5/6e & ec2 = 1/e

thus (1) becomes:
y = (5/6)sin2x + cos2x + (1/3)sinx .... (2) for x between 0 & pi/2

2> for g(x) = 0 with x greater than pi/2

we have : y" + 4y = 0
with m1 = 2i & m2 = -2i

y = ec1sin2x +ec2cos2x ....(3)

solving for the conditions giver we get:

c1 = 1/ e = c2 thus
y = sin 2x + cos 2x ..... (4)

from here on i can;t figure how to continue to find a solution / y & y' are continuous @ x = pi/2

i need help plz.

note that the exercise is long enough to post all the details of the attempt of solution. i hope u reply. thx

2. Dec 14, 2008

### tiny-tim

Hi bobmerhebi!

(have a ≤ and a ≥ and a π )

(and why are you using the difficult-to-read-and-type c1 and c2 instead of the usual A and B? )

(and what is e?)

Very good …

now just find y(π/2) and y'(π/2), and use those as your new initial conditions.

3. Dec 14, 2008

### bobmerhebi

ur right about c1 & c2 but i got used to use them for the homog. solution & A & B... for the particulat sol.'s

after calculating for $$\pi$$/2 for both y & y' with x btw 0 & $$\pi$$/2 i get:

y($$\pi$$/2) = -2/3 &
y'($$\pi$$/2) = -1 . but now what?

im asked to find a solution so that y & y' are continuous @ $$\pi$$/2.

4. Dec 14, 2008

### tiny-tim

Hi bobmerhebi!

(what happened to that π i gave you? )

Isn't y'(π/2)-= -5/3?

Anyway, just solve the particular solution all over again, with y(π/2) and y'(π/2) as your new boundary conditions.

5. Dec 14, 2008

### bobmerhebi

sorry but i still dont get it.

lets go all over again.
1st u asked what is e. its the exponential. why ? is there anything wrong with it?

2nd: u told me to take a = $$\pi$$, less than & grater than $$\pi$$. why is that? & what do u mean by a?

then u said to use y($$\pi$$/2) & y'($$\pi$$/2). but which y? the one with g(x) = sin x or 0?

as for the y'($$\pi$$/2). if its y' of y with x btw 0 & $$\pi$$/2 then y'($$\pi$$) = (5/6)cos$$\pi$$ -2sin$$\pi$$ +(1/3)sin$$\pi$$/2 = -4/3

finally ur saying to solve y_p again for those values. how is that if i already have the coefficients?

thx

6. Dec 14, 2008

### bobmerhebi

sorry but i still dont get it.

lets go all over again.
1st u asked what is e. its the exponential. why ? is there anything wrong with it?

2nd: u told me to take a = $$\pi$$, less than & grater than $$\pi$$. why is that? & what do u mean by a?

then u said to use y($$\pi$$/2) & y'($$\pi$$/2). but which y? the one with g(x) = sin x or 0?

as for the y'($$\pi$$/2). if its y' of y with x btw 0 & $$\pi$$/2 then y'($$\pi$$) = (5/6)cos$$\pi$$ -2sin$$\pi$$ +(1/3)sin$$\pi$$/2 = -4/3

finally ur saying to solve y_p again for those values. how is that if i already have the coefficients?

thx

7. Dec 14, 2008

### tiny-tim

Yes! Why is it there? It's multiplied by an arbitrary constant anyway, so ec1 or ec2 is just the same as c1 or c2.

erm … look at the signature at the bottom of this post!

ah, but isn't it (1/3)cosπ/2?
g(x) = 0, because that's for the interval you'll be dealing with.

8. Dec 14, 2008

### bobmerhebi

y = (5/6)sin2x + cos2x + (1/3)sinx .... (2) with 0 ≤ x ≤ π/2

y = sin 2x + cos 2x ..... (4) with x (just greater than not or equal) π/2

& y(π/2) = -2/3 & y'(π/2) = -5/3

then i should use these new initial conditions with (4). for what? i have y = sin 2x + cos 2x ..... (4)

sorry, it might be so simple but im tired & i have a culture exam 2moro & a 25 page assignment that;s still unfinished. so excuse.

9. Dec 14, 2008

### tiny-tim

Sorry … I'm not seeing where the problem is …

you worked out the ≤ π/2 section fine

just go through the same procedure for the ≥ π/2 section …

by definition, they'll fit together continuously.

Get some sleep now :zzz: and try it again in the morning

10. Dec 14, 2008

### bobmerhebi

thx i will retry it late this night. unfortunately i have to submit my assignment 2moro morning. but never mind. thx for ur sincere help

11. Dec 14, 2008

### bobmerhebi

thx i will retry it late this night. unfortunately i have to submit my assignment 2moro morning. but never mind. thx for ur sincere help