# Homework Help: Solving a second order DE via Green's function

1. Nov 8, 2012

### fluidistic

1. The problem statement, all variables and given/known data
Hello guys. I've been stuck on a problem when searching for the Green function.
Here is the problem: Find the solution of $x^2 y''-2y=x$ for $1 \leq x < \infty$ with the boundary conditions $y(1)=y(\infty ) =0$, using the appropriate Green function.

2. Relevant equations
The general solution will be under the form $y(x)= \int _1^\infty G(x,x')f(x')dx'$.
Where f(x') is the non homogeneous term, namely x' here. Therefore if I get the Green function G(x,x') I'm basically done with the problem (well it reduces to solving an integral).

3. The attempt at a solution
For all $x \neq x'$ in the domain, the Green function satisfies the homogeneous DE $x^2 G''-2G=0$. Where the derivative is with respect to x. It's a Cauchy-Euler DE. I solve it and the general solution is $G(x)=\frac{c_1}{x}+c_2 x^2$. So that the dependence of G on x' is via the constants $c_1$ and $c_2$.
Now I know that for the region $1 \leq x <x'$, the boundary condition G(1)=0 implies that $c_1=-c_2$. And in the region $x'<x$, $y(\infty ) =1$ implies that $c_2=0$.
Therefore the Green function takes the form $G(x)=c_1 \left ( \frac{1}{x} -x^2 \right )$ for when $1 \leq x <x'$. And $G(x)=\frac{c_1}{x}$ when $x'<x$.
Now in order to solve for the constant $c_1$ I think I must use the continuity of the Green function at $x=x'$. But this imply that $c_1=0$ which would give the trivial solution to the DE.
I don't see what I did wrong so far. Any help would be immensily appreciated.

2. Nov 9, 2012

### vela

Staff Emeritus
The arbitrary constants aren't the same. That is, what you have is
$$G(x) = \begin{cases} A\left(\frac{1}{x}-x^2\right) & 1 \le x < x' \\ \frac{B}{x} & x > x' \end{cases}$$ Continuity will allow you to eliminate one of the constants, and then you have to figure out what the discontinuity in the first derivative should be to solve for the remaining constant.

3. Nov 9, 2012

### fluidistic

Thanks a bunch!
So if $G(x)= \begin{cases} c_1 \left ( \frac{1}{x} -x^2 \right ) \text{for } 1 \leq x <x' \\ \frac{c_2}{x} \text{for } x'< x \end{cases}$ I reach that $c_2=c_1(1-x'^3)$ because of the continuity of the Green's function at $x=x'$.
According to my book (Courant's mathematical methods) if the DE is under the form $pu''+p'u'+qu=L$ then the discontinuity of $\frac{dG}{dx}$ at $x=x'$ is worth $\frac{1}{p(x')}$; in my case this would be $\frac{1}{x'^2}$.
So that I reached that $c_1=\frac{1}{3x'^3}$ and $c_2=\frac{1}{3} \left ( \frac{1}{x'^3} -1 \right )$.
Giving me finally that $G(x,x')= \begin{cases} \frac{1}{3x'^3} \left ( \frac{1}{x} -x^2 \right ) \text{for } 1 \leq x <x' \\ \frac{1}{3x} \left ( \frac{1}{x'^3} -1 \right ) \text{for } x'< x \end{cases}$.
Now this is where I'm stuck. Now a particular solution to the non homogeneous DE is under the form $y_p(x)=\int G(x,x')f(x')dx'$. Where I don't really know what are the limits of the integral. I guess I have to split the integral into 2 because the Green function changes after x=x'. So the first integral's lower limit would be 1 (I don't know what would be its upper limit) and the upper limit of the second integral would be infinity (but I don't know what would be its lower limit).
I'd appreciate some more help and if what I did so far is ok. Thanks again!

4. Nov 9, 2012

### vela

Staff Emeritus
You messed up the algebra somewhere. I found that
$$c_1 = \frac{1}{3x'}$$ so that
$$G(x,x') = \begin{cases} \frac{1}{3x'}\left(\frac{1}{x}-x^2\right) & 1 \le x < x' \\ \frac{1}{3x}\left(\frac{1}{x'}-x'^2\right) & x > x' \end{cases}.$$ Note the symmetry between x and x'. G(x,x') will always exhibit this kind of symmetry.

5. Nov 9, 2012

### fluidistic

Thanks once again vela, I now reach exactly the same result as yours.
However I am still stuck on the limits of the integral of $y_p(x)=\int x' G(x,x')dx'$.
Because if it's worth $\int _1 ^x x' \left ( \frac{1}{3x'} \right ) \left ( \frac{1}{x} -x^2 \right ) dx'+ \int _x ^{\infty}x' \left ( \frac{1}{3x} \right ) \left ( \frac{1}{x'} -x'^2 \right )$ then I see that the second integral diverges, namely because I have to integrate $x'^3$ from x to infinity. Thus, I'm guessing my limits of integration are wrong.

6. Nov 9, 2012

### vela

Staff Emeritus
You have the integrals backwards. In the first integral, you have x'<x, so the form for G(x,x') is the second case.

Either way, though, the integral to infinity diverges. I'm not sure what's going on.

7. Nov 9, 2012

### Mute

That symmetry is not a general property of Green's functions. The conditions under which the symmetry holds are given in this section of the wikipedia article on Green's functions.

For the problem at hand, it may be instructive to solve the problem using variation of parameters or method of undetermined coefficients ("method of educated guessing") to see if you can identify what might be causing the issue. Once you find the solution, I suspect you may see why the Green's function approach isn't working. (I cheated and solved the DE with Mathematica; there is an issue with the problem as stated which will become obvious upon inspecting the general solution to the ODE).

Last edited: Nov 9, 2012
8. Nov 9, 2012

### vela

Staff Emeritus
It looks like the problem doesn't have a solution satisfying the boundary conditions. According to Wolfram alpha, the general solution is given by
$$y = c_1 x^2 + \frac{c_2}{x} - \frac{x}{2},$$ which can't satisfy $y(\infty)=0$.

9. Nov 9, 2012

### vela

Staff Emeritus
10. Nov 9, 2012

### fluidistic

Ok thank you very much guys. I've rechecked the problem statement and indeed, it's written "$y(\infty ) =0$".
But I have one question. The general solution is supposed to be the complementary ones (that I found solving the homogeneous DE via a substitution because it was a Cauchy-Euler equation) + a particular one (found via Green's function).
Since we have "cheated" by looking at the general solution, we can see that the solution I'm supposed to find via the Green function is $-\frac{x}{2}$. So I understand that we cannot find the general solution such that $y(\infty ) =0$ but I do not understand why the Green function method fails to find the "$-\frac{x}{2}$" term.

11. Nov 9, 2012

### vela

Staff Emeritus
You might try finding a solution for boundary conditions that do work and see how it works out. Perhaps that'll yield some insights.

12. Nov 10, 2012

### fluidistic

I see, our/my construction of the Green function depended strongly on the behavior of y on the boundaries (thus at infinity). So if we/I assume something impossible (that y at infinity is worth 0), no wonder we can't find a Green function that makes sense.

13. Nov 10, 2012

### Mute

Yes, that seems to be the case. I did a cursory search for something which might explain the situation more thoroughly, but didn't find anything.

For a case which should work, you can use your Green's function to solve

$$x^2 y'' - 2 y = \frac{1}{x}.$$

I believe that should have a general, closed form solution which satisfies the desired boundary conditions.

14. Nov 10, 2012

### fluidistic

I thought about the same equation (with the non homogeneous term equal to 1/x) but then I remembered that for my construction of the Green function, I had to assume that $y(\infty )=0$. So that my $G(x,x') = \begin{cases} \frac{1}{3x'}\left(\frac{1}{x}-x^2\right) & 1 \le x < x' \\ \frac{1}{3x}\left(\frac{1}{x'}-x'^2\right) & x > x' \end{cases}$ already assumes that $y(\infty ) =0$.
However the complementary solution of $x^2 y'' - 2 y = \frac{1}{x}$ does not satisfy $y(\infty ) =0$ so I think that my Green function is useless for any equation of the type $x^2 y'' - 2 y = f(x)$ because $y (\infty ) \neq 0$, regardless of what f(x) is.

Last edited: Nov 10, 2012
15. Nov 10, 2012

### vela

Staff Emeritus
It turns out, you need to tweak the differential equation so that the differential operator is in self-adjoint form. In this case, you'll have
$$y'' - \frac{2}{x^2} y = \frac{1}{x}.$$ The Green's function is as you found, but now the particular "solution" is given by
$$y_p(x) = \int_1^\infty \frac{G(x,x')}{x'}\,dx' = \frac{1}{2x}-\frac{x}{2}.$$ You still can't satisfy the boundary conditions, but at least the x/2 term appears now.

16. Nov 10, 2012

### vela

Staff Emeritus
I don't follow your reasoning here. The Green's function method does yield a valid solution if the righthand side is equal to 1/x.