# Homework Help: Second-order linear ODE

1. Aug 18, 2010

### Char. Limit

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

So I made a random differential equation to try to solve, but I found out that I can't solve second-order differential equations with knowledge I've gleaned solely from PF. So I need your help to ask how to solve this. Note that I've never taken a differential equations class, but I have completed Calculus II, if that helps, and I've looked into ways to solve first order linear ODEs. So yeah.

The equation I made up to solve is...

$$x^2 y'' + x y' + y = 0$$

2. Relevant equations

Nope, I don't even know how to do this. None here, then.

3. The attempt at a solution

I'm sorry, but I'm totally lost. I just need a method... is there a way to turn this equation first order, maybe?

2. Aug 18, 2010

### Pengwuino

Try a power series solution.

3. Aug 18, 2010

### vela

Staff Emeritus
Or even simpler, try a solution of the form y=xr.

4. Aug 18, 2010

### Dickfore

This, the equation is of the Euler type:

$$(a x + b)^{n} \, y^{(n)} + a_{1} \, (a x + b)^{n - 1} \, y^{(n - 1)} + \ldots + a_{n} \, y = 0$$

If you perform the substitution of the independent variable:

$$a x + b \equiv \exp(t) \Rightarrow a \, dx = \exp(t) \, dt$$

then the derivatives transform as:

$$\frac{d}{dx} = \frac{dt}{dx} \, \frac{d}{dt} = a \, \exp(-t) \frac{d}{dt}$$

$$\frac{d^{2}}{dx^{2}} = a \, \exp(-t) \, \frac{d}{dt}\left(a \, \exp(-t) \, \frac{d}{dt} \right) = a^{2} \, exp(-2 t) \, \left(\frac{d^{2}}{dt^{2}} - \frac{d}{dt}\right)$$

In general:
$$\frac{d^{n}}{dx^{n}} = a^{n} \, \exp(-n \, t) \, \sum_{k = 0}^{n - 1}{p^{(n)}_{k} \, \frac{d^{n - k}}{d t^{n - k}}}$$

and one can find a recursive relation for the coefficients $\{p^{(n)}_{k}\}$ by differentiating one more time:

$$\frac{d^{n + 1}}{dx^{n + 1}} = \frac{d}{dx} \, \left( a^{n} \, \exp(-n \, t) \, \sum_{k = 0}^{n - 1}{p^{(n)}_{k} \, \frac{d^{n - k}}{d t^{n - k}}}\right)$$
$$= a^{n + 1} \, \exp(-t) \, \frac{d}{dt} \, \left(\exp(-n \, t) \, \sum_{k = 0}^{n - 1}{p^{(n)}_{k} \, \frac{d^{n - k}}{d t^{n - k}}}\right)$$
$$= a^{n + 1} \, \exp(-t) \, \left(\exp(-n \, t) \, \sum_{k = 0}^{n - 1}{p^{(n)}_{k} \, \frac{d^{n - k + 1}}{d t^{n - k + 1}}} - n \, \exp(-n \, t) \, \sum_{k = 0}^{n - 1}{p^{(n)}_{k} \, \frac{d^{n - k}}{d t^{n - k}}}\right)$$
$$= a^{n + 1} \, \exp\left(-(n + 1) \, t\right) \, \left[ p^{(n)}_{0} \, \frac{d^{n + 1}}{dt^{n + 1}} + \sum_{k = 1}^{n - 1}{p^{(n)}_{k} \, \frac{d^{n + 1 - k}}{dt^{n + 1 - k}} - n \, \sum_{k = 1}^{n - 1}{p^{(n)}_{k - 1} \, \frac{d^{n + 1 - k}}{dt^{n + 1 - k}}}} - n \, p^{(n)}_{n - 1} \, \frac{d}{dt}\right]$$
Comparing this with the formula for $n + 1$

$$\frac{d^{n + 1}}{dx^{n + 1}} = a^{n + 1} \, \exp\left(-(n + 1) \, t\right) \, \sum_{k = 0}^{n}{p^{(n + 1)}_{k} \, \frac{d^{n + 1 - k}}{d t^{n + 1- k}}}$$

we see that the following recursion relations for the coefficients hold:

$$p^{(n + 1)}_{0} = p^{(n)}_{0}, \; p^{(1)}_{0} = 1 \Rightarrow p^{(n)}_{0} = 1$$

$$p^{(n + 1)}_{k} = p^{(n)}_{k} - n \, p^{(n)}_{k - 1}, 1 \le k \le n - 1$$

$$p^{(n + 1)}_{n} = - n \, p^{(n)}_{n - 1}, p^{(2)}_{1} = -1 \Rightarrow p^{(n)}_{n - 1} = (-1)^{n - 1} \, (n - 1)!, n \ge 2$$

In any case, after performing all the substitutions and noticing that:
$$(a x + b)^{n} = \left[\exp(t)\right]^{n} = \exp(n \, t)$$

the exponential factors cancel and you get an Linear Ordinary Differential Equation with constant coefficients.

Since the ansatz you put in to solve these is of the form $y = \exp(k t)$ and in the above case $a = 1, b = 0$, we have $y = \exp(k t) = \left[\exp(t)\right]^{k} = x^{k}$ as a direct ansatz. However, this is not suitable for the cases of double or complex conjugate roots (for complex k) and the previous procedure should make it clear what the solution is in those cases.

5. Aug 18, 2010

### HallsofIvy

Note, by the way, that most linear differential equations have solutions that cannot be written in terms of elementary functions but can be written in terms of power series, while solutions to almost all non-linear differential equations cannot be written in any simple way.

I would not recommend "making up random differential equations" and trying to solve them as good practice, unless you have some way of making up equations that you know have solutions of some particular form. You will NOT be able to solve most of them.

Because, as Dickfore said, this is an Euler type equation, you can transform it into an equation with constant coefficients. Let t= ln(x). Then, by the chain rule,
$$\frac{dy}{dx}= \frac{dy}{dt}\frac{dt}{dx}= \frac{1}{x}\frac{dy}{dt}$$

$$\frac{d^2y}{dx^2}= \frac{d }{dx}\left(\frac{dy}{dx}\right)= \frac{d }{dx}\left(\frac{1}{x}\frac{dy}{dt}\right)$$
$$= -\frac{1}{x^2}\frac{dy}{dt}+ \frac{1}{x}\left(\frac{1}{x}\frac{d^2y}{dt^2}\right)$$
$$= \frac{1}{x^2}\left(\frac{d^2y}{dt^2}- \frac{dy}{dt}\right)$$

Putting those into the differential equation reduces it to
$$\left(\frac{d^2y}{dt^2}- \frac{dy}{dt}\right)+ \frac{dy}{dt}+ y= 0$$
$$\frac{d^2y}{dt^2}+ y= 0$$

which is a linear, homogeneous, differential equation with constant coefficients. It has characteristic equation $r^2+ 1= 0$ which has solutions $r= \pm i$ and so the differential equation has general solution $y(t)= C_1cos(t)+ C_2 sin(t)$.

Since t= ln(x), the general solution to the original equation is
$$y(x)= C_1 cos(ln(x))+ C_2 sin(ln(x))$$

Last edited by a moderator: Aug 18, 2010
6. Aug 18, 2010

### Dickfore

Another important thing about 2nd order LODEs is, if you put them in normal form:

$$y'' + P(x) \, y' + Q(x) \, y = 0$$

then, by multiplying with the integrating factor:

$$\mu(x) = \exp\left(\int{P(x) \, dx}\right)$$

you can get them in Sturm - Liouville form:

$$\frac{d}{dx}\left(\mu(x) \, \frac{dy}{dx}\right) + \mu(x) \, Q(x) \, y = 0$$

For your equation $P(x) = \frac{1}{x}$ and $Q(x) = \frac{1}{x^{2}}$ and:

$$\mu(x) = \exp(\int{\frac{dx}{x}}) = \exp(\log{x}) = x$$

so the Sturm - Liouville form of the equation is:

$$x \, \frac{d}{dx}\left(x \, \frac{dy}{dx}\right) + y = 0$$

From here, "it should be obvious" that, if you make a substitution to the indpendent variable such that:

$$x \, \frac{d}{dx} = \frac{d}{dt} \Leftrightarrow dt = \frac{dx}{x} \Rightarrow t = \log{x}$$

$$\frac{d^{2}y}{dt^{2}} + y = 0$$

7. Aug 18, 2010

### gomunkul51

@Dickfore
May be you know where I can read about "Sturm - Liouville form" and it's implications? :)

8. Aug 18, 2010

### Dickfore

It's a standard topic in any Mathematical Methods course. Also, s simple Google search reveals many resources.

9. Aug 18, 2010

### gomunkul51

I though may be you have a link to your course summaries or something, its hard to find academic material on the net, there is a lot of amateurs out there :)