# Kuba's MoreCalculus package - an example

First of all, congratulations to @Kuba for this excellent package.

I did not know where to report the following example, so I thought I would make a post about it. I understand that this might be one of the coordinate transformations that are causing issues to Solve, however, this coordinate tranformation appears a lot and I think it might be useful if this can be resolved somehow.

The mathematical description of the problem is given below and is taken directly from this paper - see eq.(5.14) on page 31 and also eq.(A.2) on page 36.

The equation is

$$$$\frac{1}{\sigma^2} \partial_{\sigma} (\sigma^2 \partial_{\sigma}V) + \partial^2_{\eta} V = 0$$$$

The change of variables $$(\eta, \sigma) \leftrightarrow (\rho, w)$$ is given by

\begin{aligned} \sigma &= \rho \cos w \, ,\\ \eta &= \rho \sin w \, . \end{aligned}

The result should be given by

$$$$\frac{1}{\rho^2} (2 \cot w \partial_w V + \partial^2_w V + 3 \rho \partial_{\rho} V) + \partial^2_{\rho} V = 0$$$$

The command that I used is shown below

DChange[D[σ^2*D[V[σ, η], σ], σ] + D[V[σ, η], {η, 2}] == 0,
{ρ == η^2/Sqrt[η^2 + σ^2] + σ^2/Sqrt[η^2 + σ^2],
w == ArcTan[σ/Sqrt[η^2 + σ^2], η/Sqrt[η^2 + σ^2]]}, {σ, η}, {ρ, w},
{V[σ, η]}]

I tried also to input the change of variables in the way that is stated above; that is

DChange[D[σ^2*D[V[σ, η], σ], σ] + D[V[σ, η], {η, 2}] == 0,
{σ == ρ*Cos[w], η == ρ*Sin[w]}, {σ, η}, {ρ, w}, {V[σ, η]}]

None of the above produces the desired result.

• This site isn't really the appropriate place to report this. A better place is on the GitHub repo's issues page: github.com/kubaPod/MoreCalculus/issues – b3m2a1 Jan 9 at 19:51
• @b3m2a1 thanks for the comment. I will make sure to delete this post tomorrow and follow the link you sent. – DiSp0sablE_H3r0 Jan 9 at 21:09

As noted by Kuba, there is a typo in the PDE. Then, to obtain 2nd PDE in the question the needed rule is

\begin{aligned} \color{red}{\eta} &= \rho \cos w \,\\ \color{red}{\sigma} &= \rho \sin w \,\\ \end{aligned}

Finally, your transformation rule is improper. Try the following:

Assuming[{ρ > 0, -Pi < w < Pi},
DChange[1/σ^2 D[σ^2 D[V[σ, η], σ], σ] + D[V[σ, η], {η, 2}] == 0,
"Cartesian" -> "Polar", {η, σ}, {ρ, w}, {V[σ, η]}]]

Or the following:

Assuming[{ρ > 0, -π < w < π},
DChange[D[σ^2 D[V[σ, η], σ], σ]/σ^2 + D[V[σ, η], {η, 2}] == 0,
{Sqrt[η^2 + σ^2] == ρ, w == ArcTan[η, σ]}, {η, σ}, {ρ, w}, {V[σ, η]}]]
• Thanks for pointing this out. I did not know that polar coordinates are implemented directly into Kuba's package, and this is why I made this post in the first place. – DiSp0sablE_H3r0 Jan 10 at 14:29
• @DiSp0sablE_H3r0 Actually it's mentioned here: mathematica.stackexchange.com/a/80267/1871 – xzczd Jan 10 at 14:33
• Thanks for the link. Just a quick comment. I think that you wrote in red -the shift in the definition of the variables- is redundant. I am saying this because I have done the computation manually and getting the same result, so I cannot really see the point there – DiSp0sablE_H3r0 Jan 10 at 14:43
• @DiSp0sablE_H3r0 But the result of DChange is different, and I don't think DChange will make a mistake in this case. – xzczd Jan 10 at 15:08

Thanks and sorry but I won't have time to update the package soon nor I were doing any calculus for couple of years so here are just my quick notes (which do not solve everything):

The question is what to assume to make:

Solve[{σ == ρ*Cos[w], η == ρ*Sin[w]}, {ρ,  w}]

to return only the second result. I tried ρ > 0 but that makes it stuck.

Regardless,

DChange[
1/σ^2 D[σ^2*D[V[σ, η], σ], σ] + D[V[σ, η], {η, 2}] == 0,
{σ==ρ*Cos[w],η==ρ*Sin[w]},
{σ,η},{ρ,w},{V[σ,η]}
] //
ReplaceAll[C[1]->0] //
Refine[#,{ρ>0}]&    // (*Get rid of Sqrt[ρ^2] ?justified*)
ReplaceAll[ArcTan[-Cos[w],-Sin[w]]->w] // (*maybe can be automatic with smart Assumptions*)
Map[-#/ρ &] // Expand // (* tidy up*)