5
$\begingroup$

I am trying to solve this \begin{equation} (1-\frac{2}{r})\partial_r^2 u+\frac{2}{r}(1-\frac{1}{r})\partial_r u+\frac{1}{r^2} \partial^2_x u+\frac{\cot x}{r^2} \partial_x u-\frac{\cos x}{r^2}(1+\frac{2}{r}+\frac{18}{5r^2})=0 \end{equation} The code is following:

DSolve[(1 - 2/r) D[u[r, x], {r, 2}] + (2/r)*(1 - 1/r)*
    D[u[r, x], {r, 1}] + (1/r^2)*D[u[r, x], {x, 2}] + (Cot[x]/r^2)*
    D[u[r, x], {x, 1}] - (Cos[x]/r^2)*(1 + 2/r + 18/(5*r^2)) == 0 , 
 u[r, x], {r, x}]

But mathematica just repeats my input(seebelow) enter image description here Does it mean no solution to the equation?

$\endgroup$
6
  • 1
    $\begingroup$ Please post the Mathematica code directly ,not the LaTeX or pictures. $\endgroup$
    – cvgmt
    Aug 23, 2022 at 3:24
  • 3
    $\begingroup$ As @cvgmt says, need to see the actual code but note that your Latex code shows u[r,x] as the coefficient of the Cot[x] term and the image of your Mathematica code shows D[u[r,x],{x,1}] $\endgroup$
    – jmm
    Aug 23, 2022 at 3:52
  • 1
    $\begingroup$ I have added my code.. $\endgroup$
    – Sven2009
    Aug 23, 2022 at 3:56
  • 1
    $\begingroup$ I don't know if it matters, but your latex doesn't match your screenshot doesn't match your code for your Cot term. $\endgroup$
    – Bill
    Aug 23, 2022 at 4:19
  • 4
    $\begingroup$ Any reason you expect this highly complicated PDE to be solvable analytically? Most actually don't have have closed form solutions, but if you saw the solution in some paper or book, please add that info, it'd definitely help! $\endgroup$
    – Hans Olo
    Aug 23, 2022 at 7:36

2 Answers 2

12
$\begingroup$

Mathematica V 13.1 currently can not solve this pde.

Here is the solution using another CAS system. But that solution is not fully complete since it depends on functions $F1(x),F2(r)$ as solutions that have to satisfy separate second order odes. But these ode's are solvable. Hence the complete solution can now be constructed.

Hopefully next version of Mathematica will be able to solve this pde.

restart; 
with(MmaTranslator);
pde:=FromMma(`(1-2/r) D[u[r,x],{r,2}]+(2/r)*(1-1/r)*D[u[r,x],{r,1}]+(1/r^2)*D[u[r,x],{x,2}]+(Cot[x]/r^2)*D[u[r,x],{x,1}]-(Cos[x]/r^2)*(1+2/r+18/(5*r^2))==0`);

enter image description here

Now

 sol:=pdsolve(pde,u(r,x))

Gives

$$ \begin{align*} u \left(r , x\right)=F1 \left(r \right) F2 \left(x \right) - \frac{A}{B} \end{align*} $$

Where

$$ \begin{align*} A&=\left(\frac{C1 \left(-8 \ln \left(-r +2\right) \ln \left(2\right) r^{2}+8 \ln \left(2\right)^{2} r^{2}+4 \ln \left(r \right)^{2} r^{2}+8 \ln \left(-r +2\right) \ln \left(2\right) r -8 \ln \left(2\right)^{2} r +8 \mathit{dilog}\left(\frac{r}{2}\right) r^{2}-29 \ln \left(r -2\right) r^{2}-4 \ln \left(r \right)^{2} r +29 \ln \left(r \right) r^{2}-8 \mathit{dilog}\left(\frac{r}{2}\right) r +29 \ln \left(r -2\right) r -45 \ln \left(r \right) r -69 r +18\right)}{r}+C2 \left(r -1\right)+C3 \left(-\frac{\ln \left(r \right) r}{2}+\frac{\ln \left(r \right)}{2}+\frac{\ln \left(r -2\right) r}{2}-\frac{\ln \left(r -2\right)}{2}+1\right)\right) \cot \left(x \right) \sin \left(x \right) \left(r^{2}+2 r +\frac{18}{5}\right)\\ B&=24 C1 \left(r^{2} \left(r -\frac{1}{3}\right) \ln \left(\frac{r}{2}\right)+r^{2} \left(r -\frac{1}{3}\right) \ln \left(2\right)+\left(-r^{3}+\frac{1}{3} r^{2}\right) \ln \left(r \right)+\frac{5 r^{2}}{12}+\frac{5 r}{6}+\frac{3}{2}\right)\\ \frac{d^{2}}{d r^{2}}F1 \left(r \right)&=\frac{F1 \left(r \right) c_{1}}{\left(r -2\right) r}-\frac{2 \left(\frac{d}{d r}F1 \left(r \right)\right) \left(r -1\right)}{\left(r -2\right) r}\\ \frac{d^{2}}{d x^{2}}F2 \left(x \right)&=-\cot \left(x \right) \left(\frac{d}{d x}F2 \left(x \right)\right)-F2 \left(x \right) c_{1} \end{align*} $$

The Latex might be hard to read since it is long. Here is also screen shot

enter image description here

Here is also plain text code of the solution which the Latex represents: (This can also be translated to Mathematica from Maple, but I did not do that here)

u(r,x) = _F1(r)*_F2(x)-1/24*(_C1*(-8*ln(-r+2)*ln(2)*r^2+8*ln(2)^2*r
^2+4*ln(r)^2*r^2+8*ln(-r+2)*ln(2)*r-8*ln(2)^2*r+8*dilog(1/2*r)*r^2-29*ln(r-2)*r
^2-4*ln(r)^2*r+29*ln(r)*r^2-8*dilog(1/2*r)*r+29*ln(r-2)*r-45*ln(r)*r-69*r+18)/r
+_C2*(r-1)+_C3*(1/2*ln(r-2)*r-1/2*ln(r-2)+1-1/2*ln(r)*r+1/2*ln(r)))*sin(x)*cot(
x)*(r^2+2*r+18/5)/(r^2*(r-1/3)*ln(1/2*r)+r^2*(r-1/3)*ln(2)+(-r^3+1/3*r^2)*ln(r)
+5/12*r^2+5/6*r+3/2)/_C1

With $F1,F2$ are solutions of

diff(diff(_F1(r),r),r) = _F1(r)/r/(r-2)*_c[1]-2*diff(_F1(r),r)*(r-1)/r/(r-2)

diff(diff(_F2(x),x),x) = -_F2(x)*_c[1]-cot(x)*diff(_F2(x),x)

Note that Maple dilog function is defined as

enter image description here

So need to be careful if you want to translate the above solution to Mathematica.

The functions $F2(x)$ and $F1(r)$ can be solved by Mathematica, which now gives you the full solution:

DSolve[F2''[x] == -Cot[x]*F2'[x] - F2[x]*c[1], F2[x], x]
DSolve[F1''[r] == F1[r]*c[1]/((r - 2)*r) - 2*F1'[r]*(r - 1)/((r - 2)*r), F1[r], r]

Mathematica graphics

$\endgroup$
5
  • $\begingroup$ Thanks,, it looks crazy. I also see some $\log(2-r)$ terms, does it mean the solution is complex in the region $r>2$? $\endgroup$
    – Sven2009
    Aug 23, 2022 at 10:58
  • $\begingroup$ By the way, does mathematica provide any approximate solution in addition to NDSolve? $\endgroup$
    – Sven2009
    Aug 23, 2022 at 11:00
  • $\begingroup$ @Sven2009 as far as I know, AsymptoticDSolveValue does not work for pde's only odes'. So NDSolve will be your next choice (but you need full specification in this case to use NDSolve) $\endgroup$
    – Nasser
    Aug 23, 2022 at 11:04
  • $\begingroup$ Nice solution (+1). Interesting, Mathematica cannot handle even the corresponding homogeneous PDE, DSolve[r^2 ((1 - 2/r) D[u[r, x], r, r] + (2/r)*(1 - 1/r)*D[u[r, x], r]) + D[u[r, x], x, x] + Cot[x]*D[u[r, x], x] == 0, u[r, x], {r, x}], even though it is separable. $\endgroup$
    – bbgodfrey
    Aug 23, 2022 at 13:49
  • $\begingroup$ Thanks. Beautiful. Pleasure to be in a group that does so much with DEs. $\endgroup$
    – josh
    Aug 23, 2022 at 14:25
9
$\begingroup$

Mathematica can, in fact, solve this PDE with some human assistance. Because the PDE is linear, its solution is the general solution of the corresponding homogeneous PDE plus any specific solution of the inhomogeneous PDE. The former can be obtained by separation of variables:

pdeh = (r^2 ((1 - 2/r) D[u[r, x], r, r] + (2/r)*(1 - 1/r)*D[u[r, x], r]) + 
    D[u[r, x], x, x] + Cot[x]*D[u[r, x], x]) /. u -> Function[{r, x}, ur[r] ux[x]];
Simplify[%/(ur[r] ux[x])]
(* (2 (-1 + r) ur'[r] + (-2 + r) r ur''[r])/ur[r] + 
   (Cot[x] ux'[x] + ux''[x])/ux[x] *)

General solutions for {ur[r], ux[x]} are

DSolveValue[pdeh[[1]] == -c, ur[r], r, GeneratedParameters -> Cr]
(* Cr[1] LegendreP[1/2 (-1 + Sqrt[1 - 4 c]), -1 + r] + 
   Cr[2] LegendreQ[1/2 (-1 + Sqrt[1 - 4 c]), -1 + r] *)

DSolveValue[pdeh[[2]] == c, ux[x], x, GeneratedParameters -> Cx]
(* Cx[1] LegendreP[1/2 (-1 + Sqrt[1 - 4 c]), Cos[x]] + 
   Cx[2] LegendreQ[1/2 (-1 + Sqrt[1 - 4 c]), Cos[x]] *)

where c is the separation constant. Given that the inhomogeneous term in the PDE is proportional to Cos[x], itself a LegendreP, a plausible guess for an inhomogeneous solution is u0[r] Cos[x].

((1 - 2/r) D[u[r, x], {r, 2}] + (2/r)*(1 - 1/r)*
    D[u[r, x], {r, 1}] + (1/r^2)*D[u[r, x], {x, 2}] + (Cot[x]/r^2)*
    D[u[r, x], {x, 1}] - (Cos[x]/r^2)*(1 + 2/r + 18/(5*r^2))) /. 
    u -> Function[{r, x}, u0[r] Cos[x]] // Simplify;
(* 1/(5 r^4) Cos[x] (-18 - 10 r - 5 r^2 - 10 r^2 u0[r] + 
   10 (-1 + r) r^2 [u0'[r] - 10 r^3 u0''[r] + 5 r^4 u0''[r]) *)

DSolveValue[Last[%] == 0, u0[r], r, GeneratedParameters -> C0] // Simplify
(* 1/20 (138 - 36/r - 20 C0[1] + 20 r C0[1] - 20 C0[2] - Log[262144] + 
   r Log[262144] - 40 Log[-2 + r] + 40 r Log[-2 + r] - 
   2 (-1 + r) Log[2 - r] (-9 + 5 C0[2] - 8 Log[r]) + 90 Log[r] - 
   58 r Log[r] - 10 C0[2] Log[r] + 10 r C0[2] Log[r] + 
   Log[65536] Log[r] - r Log[65536] Log[r] + 8 Log[r]^2 - 
   8 r Log[r]^2 + 16 (-1 + r) PolyLog[2, r/2]) *)

The many constants are determined by the PDE boundary conditions, not specified in the question.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.