# Simple second-order ODE

1. Homework Statement

Solve the initial value problem:
y''+2y'+2y=0
y($$\pi$$/4)=2
y'($$\pi$$/4)=-2

2. Homework Equations

Included in 1

3. The Attempt at a Solution

I assumed that y=e^rt and came up with the characteristic polynomial r^2+2r+2=0 but when solving it for the two roots, they come back as non-real. Where have I gone wrong? thanks

## Answers and Replies

Related Calculus and Beyond Homework Help News on Phys.org
Hootenanny
Staff Emeritus
Gold Member
You've done nothing wrong, the solutions to ODE's may be complex. However, one may transform them into real solutions using Euler's identity.

I have never done one with complex numbers before. Mind walking me through this one?

Hootenanny
Staff Emeritus
Gold Member
I have never done one with complex numbers before. Mind walking me through this one?
No problem, what are your two solutions?

Assuming a=1, b=2 c=2 and r1= $$\lambda$$+i$$\mu$$ r2=$$\lambda$$-i$$\mu$$

r1=(-1+(-4)^1/2)/2
= -(1/2)+i(2)^(1/2)
r2 = -(1/2)-i(2)^(1/2)

Correct?

Hootenanny
Staff Emeritus
Gold Member
I have different solutions. In your solution, you make the error of assuming that,

$$\sqrt{4} = 2\sqrt{2}$$

Which is not the case. Using the quadratic formula,

$$r = \frac{-2\pm\sqrt{4-4\cdot1\cdot2}}{2} = \frac{-2\pm i\sqrt{4}}{2}$$

$$r = -1\pm i$$

Do you agree?

Indeed, that's a mistake I commonly make.

So with those solutions, the general solution of the IVP would be:

y=c1(e^-t)cos(1)+c2(e^-t)sin(-1)

?

Hootenanny
Staff Emeritus
Gold Member
Indeed, that's a mistake I commonly make.

So with those solutions, the general solution of the IVP would be:

y=c1(e^-t)cos(1)+c2(e^-t)sin(-1)

?
I think that you've made a mistake somewhere (perhaps missing a t here and there...?). Let's start from the top,

$$y(t) = A\exp\left\{t\left(i-1\right)\right\} + B\exp\left\{-t\left(i+1\right)\right\}$$

Which may be re-written,

$$y(t) = e^{-t}\left[Ae^{it}+Be^{-it}\right]$$

Now, can you write the two complex exponentials in terms of sines and cosine?

Last edited:
Ah, I think I see my mistake. If u=1 then:

y=(Ae^-t)cos(t)+(Be^-t)sin(-t)

Hootenanny
Staff Emeritus
Gold Member
Almost there, note that,

$$\sin\left(-\theta\right) = -\sin\theta$$

Furthermore, one must not use the same constants (if you work through the full solution you will see why). Hence, the general solution will be of the form,

$$y(t) = e^{-t}C\cos t + e^{-t}D\sin t$$

Just figured out how to use the tex feature to make it easier on your eyes. I'm a little confused about the variables:

$$y(t) = Ae^{-t}C\cos t - Be^{-t}D\sin t$$

Is that the solution?

Hootenanny
Staff Emeritus
Gold Member
I tell you what, since it is clear that you've put the effort in, I'll provide a complete solution in this case. Starting from the second equation in post #8 one may write,

$$y(t) = e^{-t}\left[A\left\{\cos t + i\sin t\right\}+B\left\{\cos\left(-t\right) + i\sin\left(-t\right)\right\}\right]$$

Noting that cosine and sine are even and odd function respectively, one may write,

$$y(t) = e^{-t}\left[A\left\{\cos t + i\sin t\right\}+B\left\{\cos t - i\sin t\right\}\right]$$

Collecting the coefficients of sine and cosine,

$$y(t) = e^{-t}\left[\left(A+B\right)\cos t + \left(A-B\right)i\sin t\right]$$

Let us now define two new constants such that,

$$C:= A+B \hspace{2cm} D:=\left(A-B\right)i \hspace{2cm}C,D\in\mathbb{R}$$

Hence, the general solution,

$$y(t) = e^{-t}\left[C\cos t + D\sin t\right]$$

Do you follow?

Last edited:
Alright, I see now...but it causes another question to arise: When I go back to find the constants, I apply the initial conditions to solve for C&D, correct?

Hootenanny
Staff Emeritus
Gold Member
Alright, I see now...but it causes another question to arise: When I go back to find the constants, I apply the initial conditions to solve for C&D, correct?
Correct indeed

Thank you much for all your help.

Hootenanny
Staff Emeritus