# Initial Value problem with complex roots

1. Feb 23, 2007

### ManMonkeyFish

1.Solve the following initial value problem

d^2y/dt^2 + 4y = { 1, 0<= t <=Pi/2 } {sin(t), Pi/2 < t}

y(0) = 2

y'(0) = -1

I used y(t) = e^rt

3. For y'' + 4y' =1

y(t)= e^rt
Yp(0)=1

r^2+4 = 0
r = 2i

y1(t) = C1 Cos(2t) + C2Sin(2t) + Yp(0)
y1'(t) = -2C1Sin(2t) + 2C2Cos(2t)

y1(0) = 2 = C1 +1
y1'(0) = -1 = 2C2
C1 = 1
C2 = -1/2

y1(t) = Cos(2t) - 1/2 Sin(2t) + 1
y1'(t) = -2Sin(2t) - Cos(2t)

y1(Pi/2) = 0 ??

y1'(Pi/2) = 1

for t > Pi/2

0 = y1(Pi/2) = C1
1 = y1'(pi/2) = 2C2

C1 = 0
C2 = 1/2

so my answer is

-2Sin(2t) - Cos(2t) 0<= t <= Pi/2

Cos(2t) Pi/2 < t

Which I believe is wrong, I think I made a mistake at this step

y1(t) = Cos(2t) - 1/2 Sin(2t) + 1

y1(Pi/2) = 0 ??

Thank you for any help, this one has been giving me problems:yuck: .
I need to find out where I am going wrong, and I appreciate any and all feedback.

2. Feb 23, 2007

### Dick

Yp(0)? Yp(0)=1? No, I don't think so. Put y1(t) into the original equation.

3. Feb 23, 2007

### HallsofIvy

Staff Emeritus

typo. You mean y"+4y= 1

Is yp a "particular solution to the whole equation? If so this is wrong. Since the right hand side is a constant, you can look for a particular solution that is a constant but not necessarily 1! What happens if you put y(t)= A (a constant into the equation?

Good except that it is NOT "+ 1".

4. Feb 23, 2007

### gammamcc

Are you allowed to use "variation of parameters"? How about Laplace transforms ? (LT are traditionally used for delta and step functions on the RHS).

...beauty bare - but not here....

: )

5. Feb 23, 2007

### gammamcc

You have an altogether different partitular solution for t>t/2. Try y_p=Asin(t) +Bcos(t)

6. Feb 26, 2007

### ManMonkeyFish

HallsofIvy is this the proper way?
Y(p) = 1/4

Y(t) = k (k is a constant)

Y''(t) = 0

so 4k = 1

k = 1/4

Which leads to the first

y(0) => 2 = C1Cos(2t) + C2Sin(2t) + 1/4 (not 1 )
y'(0) => -1 = -2C1Sin(2t) + 2C2Cos(2t)

C1 = 9/4
C2 = -1/2

which gives

y = 7/4 cos(2t) - 1/2 sin(2t) + 1/4 for 0 <=t <= Pi/2

now using y(p) = aSin(t) + bCos(t) (Thank you gammamcc!)

3aSin(t) + 3bCos(t) plugging in Pi/2 gives 3a = sin(t) (sin(t) , Pi/2 < t)
a= 1/3 sin(t)
Y(p) = 1/3 sin(t)

Is plugging in the values then setting it equal to the bounds legal or do I have to set the sin(t) to sin(Pi/2) as well which would equal 1.
Giving Y(p) = 1/3 instead of Y(p) = 1/3 sin(t)

Using Y(p) = 1/3 sin(t) I have

y = -1/2Sin(2t) + 11/6Cos(2t) + 1/3Sin(t) for Pi/2 < t

If this is correct then would you kindly explain the way at finding the second Y(p) as I do not feel very comfortable in how I arrived at that answer. Thank you!

7. Feb 26, 2007

### Dick

This way of finding a particular solution is essentially called 'guessing'. Ie guess a form for the answer and then show it works. There is a more systematic way called variation of parameters - but guessing is much easier (when you can do it).

8. Feb 26, 2007

### Dick

9. Feb 26, 2007

### ManMonkeyFish

So as long as the "guess" fits the form and works it is allowed? So using an equation and setting it equal to the value given, then plugging in the value in the leftside only is acceptable?

Thanks!

10. Feb 26, 2007

### Dick

Yes. You only need one particular solution. So guess AND SHOW IT WORKS is perfectly valid. Note just guessing is not enough. :)