# A PDE in Spherical Coordinates

1. Nov 20, 2017

### joshmccraney

Given the PDE $$f_t=\frac{1}{r^2}\partial_r(r^2 f_r),\\ f(t=0)=0\\ f_r(r=0)=0\\ f(r=1)=1.$$
We let $R(r)$ be the basis function, and is determined by separation of variables: $f = R(r)T(t)$, which reduces the PDE in $R$ to satisfy $$\frac{1}{r^2 R}d_r(r^2R'(r)) = -\lambda^2:\lambda^2 \in \mathbb{R}.$$ To ensure $R$ is orthonormal and satisfies the ODE we find $R = \sqrt{2} \sin (\lambda_n r)/r:\lambda_n = n\pi$ (note we let $R(0)=R(1)=0$). What happens next I find very confusing:
$$\int_0^1 r^2 R(r) \left( \frac{1}{r^2}\partial_r(r^2 f_r) \right)\, dr = r^2R f|_{r=0}^{r=1}-\int_0^1R'(r)r^2f_r \, dr\\ = -R'(r)r^2 f|_{r=0}^{r=1}+\int_0^1 \partial_r(r^2 R'(r))f \, dr\\ = -\sqrt{2} \lambda_n (-1)^n-\lambda_n^2 T(t).$$

However, noting that $f = R(r)T(t)$ and that $R(r) = \sqrt{2} \sin (\lambda_n r)/r$, Mathematica gives me $$T(t)\int_0^1 r^2 R(r) \left( \frac{1}{r^2}\partial_r(r^2 R'(r)) \right)\, dr = -\lambda_n^2T(t).$$ So, where's my mistake?

2. Nov 20, 2017

It is difficult to check your work, because I don't know what might be standard nomenclature in the first line of the OP represents. What is $f_t$ and $f_r$?

3. Nov 20, 2017

It is difficult to check your work, because I don't know what might be standard nomenclature in the first line of the OP represents. What is $f_t$ and $f_r$?

4. Nov 20, 2017

### joshmccraney

Sorry, $f_r = \partial f / \partial r$ and $f_t = \partial f / \partial t$.

5. Nov 20, 2017

Additional question then: Does $f_r(r=0)$ imply $f_r(r=0)$ for all $t$?

6. Nov 20, 2017

### I like Serena

Hi Josh,

Here's my first problem.
Solving for T(t), we find $T(t)=Ce^{-\lambda^2 t}$.
However, that implies that $f(t=0)\ne 0$ for some r, which contradicts the first boundary condition.
Is there a typo?

If we set R(0)=0, that implies that f(r=0)=0, but that is not a given boundary condition.
Are we missing this boundary condition?

If we set R(1)=0, that implies that f(r=1)=0, but that contradicts the boundary condition f(r=1)=1.
Another typo in the boundary conditions?

For $\lambda_n=n\pi$, we find $R(1)\ne 0$.
Can it be that $\lambda_n=\frac{n\pi}{r}$ was intended?

7. Nov 20, 2017

### I like Serena

Continuing from the 3rd step:
$$-R'(r)r^2 f|_{r=0}^{r=1}+\int_0^1 \partial_r(r^2 R'(r))f \, dr =\int_0^1 -\lambda^2r^2R(r)\cdot T(t)R(r)\,dr =-\lambda^2 T(t) \int_0^1 r^2 \left(\frac{\sqrt 2\sin(\lambda r)}{r}\right)^2\,dr \\ =-\lambda^2 T(t) \int_0^1 2\sin^2(\lambda r)\,dr =-\lambda^2 T(t) \int_0^1 (1-\cos(\lambda r))\,dr =-\lambda^2 T(t) (r-\frac 1\lambda\sin(\lambda r))\Big|_0^1 =-\lambda^2 T(t)$$
In other words, it seems to me that the given 4th step is wrong, and that Mathematica's solution is quite correct.
Then again, it's not clear to me what the integral is supposed to represent (nor if there are typos in the boundary conditions).
Can you clarify?

8. Nov 20, 2017

### joshmccraney

Yes, $f_r(r=0) = f_r(r=0,t)$.
No typo.

No we are not missing the boundary condition.

Not a typo.

No, the eigenvalue $\lambda$ is assumed a constant, else separation of variables fails. Notice $\lambda = n\pi\implies R(0)=R(1)=0$ since $\sin(n\pi)=0$.

Let me explain: I am learning a weird technique for solving certain Sturm-Louiville problems in spherical coordinates. I did not want to post the entire problem here since it is in my notes. I can post the entire solution as the professor solved it, but the part that was confusing me was shown in the integration by parts routine. Specifically, I was unsure how it was working out.

9. Nov 20, 2017

### joshmccraney

I don't think this is correct. Let's evaluate each component of
$$-R'(r)r^2 f|_{r=0}^{r=1}+\int_0^1 \partial_r(r^2 R'(r))f \, dr\\ -R'(r)r^2 f|_{r=0}^{r=1} = \sqrt{2} (n \pi r \cos(n \pi r) - \sin(n \pi r) f|_{r=0}^{r=1}\\ =\sqrt{2} n \pi r \cos(n \pi r) f|^{r=1}\\ =\sqrt{2} n \pi (-1)^n.$$
The integral $\int_0^1 \partial_r(r^2 R'(r))f \, dr$, as you show, comes out to $-\lambda_n^2 T(t)$. Then the total expression is $\sqrt{2} \lambda_n(-1)^n-\lambda_n^2 T(t)$. Why is there a difference?

10. Nov 20, 2017

### I like Serena

I was working under the assumption we had R(1)=0 implying that f(r=1)=0.

Now I think that should be R'(1)=0, which does match the boundary conditions.
Consequently we should have $\lambda_n=n\pi/2$, after which the integral also makes sense.

11. Nov 20, 2017

### joshmccraney

Here's the 5 pages of notes. My problem starts at the end of page 4 and continues into 5. Have a look and let me know what you think.

edit: you don't need to reference the first two pages!

#### Attached Files:

• ###### spherical.pdf
File size:
568.4 KB
Views:
19
Last edited: Nov 20, 2017
12. Nov 21, 2017

### I like Serena

Those notes are quite a mess.

Anyway, I think the key is that we have R(1)=0 while f(r=1)=1.
With f(r,t)=T(t)R(r) that's a direct contradiction, so we have to ignore that we were doing separation of variables, and assume we know nothing about f, except what is given in the problem statement.
As soon as we tell Mathematica that f(r,t)=T(t)R(r), it will evaluate the first term as 0.
But if we use the boundary condition f(r=1)=1, the first term becomes $\sqrt 2 n\pi(-1)^n$.

Btw, from your notes I deduce that the boundary condition $f_r(r=0)=0$ is not used.
Instead we have the boundary condition $f(r=0)=\text{finite}$, and due to the form of the solution for R(r), we conclude that R(0)=0.
This should imply that $f(r=0)=0$, but I'm guessing we cannot assume that either.
Apparently separation of variables is only used as some kind of guess to get going.

13. Nov 21, 2017

### joshmccraney

Yes, I totally agree! Notes are so confusing and terrible! I'm going to go in and ask the professor about the apparent contradiction today, because it seems so so so wrong! Will update on his response.