# Green function and differential equation

I'm trying find the Green's function for a special operator. I have the homogeneous equation

x (x - 1) y''[x] - 2 I Zm y'[x] - L(L + 1) y[x]==0


for $$x>1$$ everywhere. $$Zm$$ is real and $$L$$ is a positive integer. Mathematica can solve this equation easily in terms of Hypergeometric functions.

Now I would like to find the Greens function of this problem.

First attempt: I tried using the predefined function GreenFunction as

 GreenFunction[{x (x - 1) y''[x] - 2 I Zm y'[x] - l (l + 1) y[x],y == const1, y[\[Infinity]] == 0}, y[x], {x, 1, x1}, s,Assumptions ->x > 1 && l > 0 && const1 > 0 && && x1 > 1 && s > 1]


This doesn't evaluate, I've also tried to modify the boundary conditions as

GreenFunction[{x (x - 1) y''[x] - 2 I Zm y'[x] - l (l + 1) y[x], y == const1, y[x2] == const2}, y[x], {x, 1, x1}, s, Assumptions -> x > 1 && l > 0 && const1 > 0 && const2 > 0 && x1 > 1 && s > 1 && x2 > x1]


This did't help.

Second attempt is that I tried just simply to put the right hand side of the equation as the DiracDelta

x (x - 1) y''[x] - 2 I Zm y'[x] - l (l + 1) y[x] == DiracDelta[x - x1]
DSolve[%, y[x], x, Assumptions -> x1 > 1] // Simplify


Alas we have a result.

My question is why doesn't the GreenFunction function give the desired output? Another would be how do I do I impose the boundary values on the result given. If I for example require that y[Infinity] ==0 in the second attempt, I don't get a solution.

• @Nittaaa Your last attempt DSolve gives a result including Inactive[Integrate] and DiracDelta[], Dont't know why Mathematica won't evaluate, perhaps you might solve it manually? Mar 13 at 7:38
• Hello, the integration can be activated using Activate function, with some Assumtpions and Fullsimplify this does reduce, but I'm wasn't sure how to apply different boundary conditions (just the conditions that I mentioned are really important) to the problem. Mar 13 at 9:20

Don't know why Mathematica GreenFunction doesn't evaluate.

Perhaps your last attempt might be elaborated a little bit further:

ode = x (x - 1) y''[x] - 2 I Zm y'[x] - l (l + 1) y[x] == DiracDelta[x - x1]
Y = Values@DSolve[{ode, y == 1}, y , x ][[1, 1]] // Simplify


This solution, with one boundary condition Y==1, includes Inactive[Integrate] and DiracDelta[], which have to be activated.

green = Function[{x, x1},
Simplify[Activate[Y[x] ], {Element[{x, x1}, Reals], x1 > 1 }] //Evaluate]


Solution fullfills the bc

green[1, x1] /. HeavisideTheta -> 1/2
(* 1 *)


Solution green depends on parameter C which follows from condition Limit[Y[x],x->Infinity]==0

solc = Solve[0 == Asymptotic[green[x, x1], x -> Infinity],C][];


alternative solution idea (two bc)

ode = x (x - 1) y''[x] - 2 I Zm y'[x] - l (l + 1) y[x] ==DiracDelta[x - x1];
Y = Values@DSolve[{ode, y == 1, y[inf] == 0},y, x][[1, 1]] //Simplify;
green = Function[{x, x1},Simplify[Activate[Y[x]], {Element[{x, x1,inf}, Reals], x1 > 1,       inf > 1}] // valuate];
Asymptotic[green[x, x1], inf -> Infinity];


Unfortunately the last codeline doesn't evaluate, because further knowledge of paramter Zm,l is needed.

• Thank you very much. I thought that C should be a constant. Perhaps that's where my surprise confusion on this began. Could you please confirm that C is really just a parameter dependant on $x$? That is $C = C(x)$ mathematically? If so I will accept you answer and perhaps begin a thread on why doesn't the Greenfunction evaluate. Mar 13 at 9:25
• @Nitaaa You are right, C must be a constant. Last step in my answer seems to be wrong. Mar 13 at 9:35
• Perhaps If we instead use the condition solc = Solve[0 == Asymptotic[green[x, x1], x -> Infinity],C][]; ? We do get an answer, although quite unreadable, but clearly independent of $x$. Mar 13 at 9:37
• @Nitaa Yes that's the correct condition. Hopefully independent of x (?and x1?).I modified my answer Mar 13 at 9:47
• It looks like Mathematica isn't able to evaluate Asymptotic without knowing Zm,l. Try alternatively ode = x (x - 1) y''[x] - 2 I Zm y'[x] - l (l + 1) y[x] == DiracDelta[x - x1]; Y = Values@DSolve[{ode, y == 1, y[inf] == 0}, y, x][[1, 1]] // Simplify; green = Function[{x, x1}, Simplify[Activate[Y[x]], {Element[{x, x1, inf}, Reals], x1 > 1, inf > 1}] // Evaluate];Asymptotic[green[x, x1], inf -> Infinity];  Mar 13 at 9:57