3
$\begingroup$

I am using MMA to compute the solution of a system of ordinary differential equations, they are as follows,

Clear["`*"]
DSolve[{(
      g[r] + G1[r])*(1/r^2 +
       1/r ( Derivative[1][g][r] + Derivative[1][G1][r])/(
        g[r] + G1[r])) ==
    g[r]*(1/r^2 + 1/r Derivative[1][g][r]/g[r]), (
      g[r] + G1[r])*(1/r^2 +
       1/r ( Derivative[1][f][r] + Derivative[1][F1][r])/(
        f[r] + F1[r])) == g[r]*(1/r^2 + 1/r Derivative[1][f][r]/f[r]),
    G1[1] == -1}, {G1[r], F1[r]}, r]

I want to obtain the solutions of them, but I don't quite understand our these results. And my try of solutions are as follow, enter image description here

I would appreciate it if you can help me. Thank you again for your help!

$\endgroup$
3
  • 1
    $\begingroup$ There is no pde's here. Just two coupled ode equations. Mathematica solved it. The unresolved integrals in the result you see is because it does not how to integrate the functions $g'(r)$ and $f'(r)$ you have there. That is all. It uses K[1],K[2] for integration variables. !Mathematica graphics $\endgroup$
    – Nasser
    Jun 21, 2023 at 8:26
  • $\begingroup$ Also on closer look, notice that the first ODE in $G(r)$ does not depend on $F(r)$ at all. So all what you need to do is just solve the first ode for $G(r)$ on its own. Then plugin that solution in the second ode and solve for $F(r)$. So what you really have is basically 2 separate first order ode's. $\endgroup$
    – Nasser
    Jun 21, 2023 at 8:36
  • $\begingroup$ Thanks for your tips, I've edited the relevant description of the problem. According to your second comment, the problem can be solved efficiently. In other words, it seems to be more convenient to calculate manually than mma. Actually, I also calculated the result manually, I want to verify this result on mma, but its display prevents me from comparing with the result at hand. So, the question this time is to find a way to get a more general solution, which may be compared with the result of manual calculation. $\endgroup$ Jun 21, 2023 at 9:01

1 Answer 1

6
$\begingroup$

It is just that Mathematica uses definite integrals $\int_{1}^{r}$ and uses K[1] and K[2] for integration variables, it makes it little hard to see.

But you can see it is same solution as by hand.

ClearAll["Global`*"]
ode1=(g[r]+G1[r])*(1/r^2+1/r (Derivative[1][g][r]+Derivative[1][G1][r])/(g[r]+G1[r]))==g[r]*(1/r^2+1/r Derivative[1][g][r]/g[r])
ode2=(g[r]+G1[r])*(1/r^2+1/r (Derivative[1][f][r]+Derivative[1][F1][r])/(f[r]+F1[r]))==g[r]*(1/r^2+1/r Derivative[1][f][r]/f[r])

Mathematica graphics

Solve the first ode for $G(r)$ and plug the solution into second ode

solG=DSolve[ode1,G1[r],r][[1,1]]

Mathematica graphics

ode2/.solG

Mathematica graphics

This is Mathematica's solution for the above

 DSolve[%, F1[r], r] // Simplify

Mathematica graphics

Let solve it by hand and compare

ode3=F1'[r]==Solve[%%,F1'[r]][[1,1,2]]

Mathematica graphics

ode3=Collect[ode3,{F1'[r],F1[r]}]
ode4=SubtractSides[ode3,ode3[[2,2]]]

Mathematica graphics

So this is linear first ode. The integration factor is

 mu=Exp[Integrate[-( (-C[1] f[r]+r^2 g[r] f'[r])/(r f[r] (C[1]+r g[r]))),r]]

Mathematica graphics

Multiplying both sides of ode4 by this $\mu$ and integrating both sides gives (and remember to add new constant $c_2$ gives

 sol=F1[r]==1/mu*(Integrate[mu*ode4[[2]],r]+C[2])

Mathematica graphics

You see, it is same as Mathematica' but using indefinite integrals which makes it easier to read.

enter image description here

All code in one block

ClearAll["Global`*"]
ode1=(g[r]+G1[r])*(1/r^2+1/r (Derivative[1][g][r]+Derivative[1][G1][r])/(g[r]+G1[r]))==g[r]*(1/r^2+1/r Derivative[1][g][r]/g[r])
ode2=(g[r]+G1[r])*(1/r^2+1/r (Derivative[1][f][r]+Derivative[1][F1][r])/(f[r]+F1[r]))==g[r]*(1/r^2+1/r Derivative[1][f][r]/f[r])
solG=DSolve[ode1,G1[r],r][[1,1]]
ode2/.solG
DSolve[%,F1[r],r]//Simplify
ode3=F1'[r]==Solve[%%,F1'[r]][[1,1,2]]
ode3=Collect[ode3,{F1'[r],F1[r]}]
ode4=SubtractSides[ode3,ode3[[2,2]]]
mu=Exp[Integrate[-( (-C[1] f[r]+r^2 g[r] f'[r])/(r f[r] (C[1]+r g[r]))),r]]
sol=F1[r]==1/mu*(Integrate[mu*ode4[[2]],r]+C[2])
$\endgroup$
1
  • $\begingroup$ Thank you very much for your enthusiastic help, and the calculation process you provided is very detailed. I think these results you have provided meet my expectations. At the same time, it will take some time for me to understand and learn this solution. Looking forward to discussing with you next time, thanks again for your help. $\endgroup$ Jun 21, 2023 at 10:54

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.