# Second order differential equation via substitution

1. May 20, 2010

### bitrex

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

Substitute $$p = \frac{dx}{dt}$$ to solve $$x\prime\prime + \omega^2x = 0$$

2. Relevant equations

$$\frac{dp}{dx} = v + x\frac{dv}{dx}$$

$$v = \frac{p}{x}$$

3. The attempt at a solution

$$p = \frac{dx}{dt}, \frac{dp}{dt} = \frac{d^2x}{dt^2}$$

$$\frac{dp}{dt} = \frac{dp}{dx}\frac{dx}{dt} = \frac{dp}{dx}p$$

$$\frac{dp}{dx} + \frac{\omega^2x}{p} = 0$$

$$v + x\frac{dv}{dx} = \frac{-\omega^2}{v}$$

$$\frac{-v}{\omega^2 + v^2}dv = \frac{1}{x} dx$$

$$\frac{-1}{2}ln(\omega^2 + v^2) = ln|x| + C$$

$$\frac{1}{\sqrt{\omega^2 + v^2}} = x + C$$

I get tripped up here and I'm not sure how to go forward, with regards to all the various substitutions I've made! I see the beginnings of an integral involving trigonometric substitution, so I hope I may be on the right track. A hint would be much appreciated.

2. May 20, 2010

### gabbagabbahey

I don't understand why you are making a second substitution. You have a separable 1st order ODE for $p(x)$:

$$\frac{dp}{dx} + \frac{\omega^2x}{p} = 0$$

Just solve it.

3. May 20, 2010

### bitrex

:rofl: Wow, so I do. That's what I get for doing this when I'm tired!

4. May 20, 2010

### bitrex

To finish up:

$$p dp = -\omega^2x dx$$

$$p^2 = -\omega^2 x^2$$

$$p = i \omega x + C_1$$

$$t = \int \frac{1}{i\omega x + C_1} dx$$

$$i \omega t = ln|i\omega x + C_1| + C_2$$

$$e^{i\omega t} = C_2(i\omega x + C_1) = C_2x + C_1C_2$$

$$\frac{1}{C_2}cos(\omega t) + \frac{1}{C_2}isin(\omega t) - C_1$$

$$x = Acos(\omega t) + Bsin(\omega t)$$ if we set $$\frac{1}{C2} = A,$$ $$\frac{1}{C1} = B,$$ and let $$C_1 = \frac{1}{C_2}isin(\omega t) - \frac{1}{C_1}sin(\omega t).$$

5. May 21, 2010

### gabbagabbahey

Why didn't the constant make an appearance in your second line?

$$p dp = -\omega^2x dx \implies p^2=-\omega^2x^2+C_1 \implies p=\sqrt{C_1-\omega^2 x^2}$$

6. May 21, 2010

### bitrex

Carelessness. I'll try it again.

7. May 21, 2010

### bitrex

I think I'm a little closer now. Continuing from the dropped constant and substituting into p = dx/dt we have:

$$\frac{1}{\sqrt{C_1 - \omega^2 x^2}} dx = dt$$

Make the substitution $$x = \frac{\sqrt{C_1}}{\omega} sin\theta$$

$$\int \frac{\sqrt{C_1} cos\theta}{\omega C_1 cos\theta} d\theta = \int \frac{\sqrt{C_1}}{\omega C_1} d\theta = \frac{\sqrt{C_1}}{\omega C_1}\theta + C_2$$

So $$t = \frac{\sqrt{C_1}}{\omega C_1} sin^-1(\frac{x \omega}{\sqrt{C_1}} + C_2)$$

And solving for X in terms of t I get:

$$\frac{\sqrt{C_1}}{\omega} sin (\frac{\omega t C_1 - \omega C1 C2}{\sqrt{C_1}})$$

Not sure this is entirely correct, it's closer though! The first term we can call B because the constant swallows up the omega and square root, but as for the terms inside the sin() I'm not so sure. I know I can find the second solution by substituting y2 = y1*v into the original equation, where y1 = B sin (wt).

8. May 21, 2010

### gabbagabbahey

The $C_1$ in the denominator should be $\sqrt{C_1}$, so you get

$$\int\frac{dx}{\sqrt{C_1 - \omega^2 x^2}}=\frac{\theta}{\omega}+C_2$$

Why is $C_2$ inside the arcsine?

$$\frac{\theta}{\omega}+C_2=\frac{1}{\omega}\sin^{-1}\left(\frac{\omega x}{\sqrt{C_1}}\right)+C_2$$

9. May 21, 2010

### bitrex

I see it now. It's been months since I've worked on this stuff, and as you can tell I'm pretty out of practice. Ugly careless mistakes.