# How can I solve my system of differential equations

I have 3 differential equations and I want to obtain an analytic expression for f[r]. It does not matter what equations are and I just need the command to solve such equations. I know that these equations have two possible different solutions and maple can obtain them easily. I just need the command in Mathematica. For your check the solutions are f[r]=1+a*r^2+b/r^2 and f[r]=1+a*r+b*r^2.I will be grateful if someone help.

eq1 = Sin[t]^4*f[r]*r^4*D[f[r], {r, 4}] + (1/2)*r^3*Sin[t]^4*(10*f[r] + r*D[f[r], r])*D[f[r], {r, 3}] + (1/4)*r^4*Sin[t]^4*D[f[r], {r, 2}]^2 +
(3/4)*Sin[t]^2*r^2*(r*Sin[t]^2*D[f[r], r] + (4/9 - (2/3)*f[r])*Sin[t]^2 - (2/9)*Cos[t]^2 + 2/9)*D[f[r], {r, 2}] - (5/2)*r^2*Sin[t]^4*D[f[r], r]^2 +
(9/2)*Sin[t]^2*((-2/3 + f[r])*Sin[t]^2 + (1/3)*Cos[t]^2 - 1/3)*r*D[f[r], r] + (1/12)*(-32 - 24*f[r]^2 + 32*f[r])*Sin[t]^4 +
(1/12)*(16 - 32*Cos[t]^2 + 16*f[r] - 16*f[r]*Cos[t]^2)*Sin[t]^2 - 2/3 + (8/3)*Cos[t]^2 - 2*Cos[t]^4

eq2 = -6*r^3*Sin[t]^4*(-2*f[r] + r*D[f[r], r])*D[f[r], {r, 3}] - 3*r^4*Sin[t]^4*D[f[r], {r, 2}]^2 -
9*Sin[t]^2*r^2*(r*Sin[t]^2*D[f[r], r] + (4/9 - (10/3)*f[r])*Sin[t]^2 - (2/9)*Cos[t]^2 + 2/9)*D[f[r], {r, 2}] + 30*r^2*Sin[t]^4*D[f[r], r]^2 -
102*Sin[t]^2*r*((f[r] - 6/17)*Sin[t]^2 - 3/17 + (3/17)*Cos[t]^2)*D[f[r], r] + (72*f[r]^2 + 32 - 64*f[r])*Sin[t]^4 +
(32*f[r]*Cos[t]^2 + 32*Cos[t]^2 - 16 - 32*f[r])*Sin[t]^2 - 32*Cos[t]^2 + 24*Cos[t]^4 + 8

eq3 = 2*Sin[t]^4*f[r]*r^4*D[f[r], {r, 4}] + 2*r^3*Sin[t]^4*(4*f[r] + r*D[f[r], r])*D[f[r], {r, 3}] + r^4*Sin[t]^4*D[f[r], {r, 2}]^2 +
3*Sin[t]^2*(r*Sin[t]^2*D[f[r], r] + (-2/3 - 2*f[r])*Sin[t]^2 + 4/3 - (4/3)*Cos[t]^2)*r^2*D[f[r], {r, 2}] - 10*r^2*Sin[t]^4*D[f[r], r]^2 +
26*Sin[t]^2*((f[r] - 12/13)*Sin[t]^2 + 3/13 - (3/13)*Cos[t]^2)*r*D[f[r], r] + (-16*f[r]^2 - 8 + 36*f[r])*Sin[t]^4 +
(12*f[r]*Cos[t]^2 + 20*Cos[t]^2 - 4 - 12*f[r])*Sin[t]^2 - 24*Cos[t]^2 + 20*Cos[t]^4 + 4

• If you have initial conditions, try NDSolve – no-one Feb 28 '18 at 22:20
• You have three nonlinear ODEs for f[r] with coefficients dependent on another variable, t. Unless the equations are equivalent, which seems unlikely, there are no solutions to this system. And, even if they are equivalent, the t-dependence of the equations would mean that f is a function of both r and t. – bbgodfrey Mar 1 '18 at 13:59
• Dear @MariuszIwaniuk , these equations have two different solutions and maple can obtain them easily. I just need the command in Mathematica. For your check the solutions are f[r]=1+a*r^2+b/r^2 and f[r]=1+a*r+b*r^2. Now, you can find out both functions satisfy those Diff. Eqs.. – Mehrab Mar 1 '18 at 15:18
• Dear @bbgodfrey , thank you so much for your help. These equations have two different solutions and maple can obtain them easily. I just need the command in Mathematica. For your check the solutions are f[r]=1+a*r^2+b/r^2 and f[r]=1+a*r+b*r^2. Now, you can find out both functions satisfy those Diff. Eqs.. Again, thanks for your response. – Mehrab Mar 1 '18 at 15:26
• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. – bbgodfrey Mar 2 '18 at 19:28

## 1 Answer

Original Solution

At first glance, the equations in the question would appear to have no analytical solutions, because there are three ODEs but only one dependent variable, and the coefficients in the ODEs depend on a second independent variable. However, judicious use of DSolve obtains the solutions cited in the question. Begin by eliminating the extra independent variable.

{eq1r, eq2r, eq3r} = FullSimplify[{eq1, eq2, eq3}]/Sin[t]^4
(* {(-8 - 8*f[r]^2 + r*(-10*r*D[f[r],r]^2 + r*D[f[r],{r,2}]*(2 + r^2*D[f[r],{r,2}])
+ D[f[r],r]*(-18 + 3*r^2*D[f[r],{r,2}] + 2*r^3*D[f[r],{r,3}])) +
2*f[r]*(8 + 9*r*D[f[r],r] + r^2*(-D[f[r],{r,2}] + 2*r*(5*D[f[r],{r,3}]
+ r*D[f[r],{r,4}]))))/4,
3*(8 + 24*f[r]^2 + 2*f[r]*(-16 - 17*r*D[f[r],r] + 5*r^2*D[f[r],{r,2}] +
2*r^3*D[f[r],{r,3}]) - r*(-10*r*D[f[r],r]^2 + r*D[f[r],{r,2}]*(2 + r^2*D[f[r],{r,2}])
+ D[f[r],r]*(-18 + 3*r^2*D[f[r],{r,2}] + 2*r^3*D[f[r],{r,3}]))),
-8 - 16*f[r]^2 + r*(-10*r*D[f[r],r]^2 + r*D[f[r],{r,2}]*(2 + r^2*D[f[r],{r,2}])
+ D[f[r],r]*(-18 + 3*r^2*D[f[r],{r,2}] + 2*r^3*D[f[r],{r,3}])) + 2*f[r]*(12 +
13*r*D[f[r],r] - 3*r^2*D[f[r],{r,2}] + 4*r^3*D[f[r],{r,3}] + r^4*D[f[r],{r,4}])} *)


Unfortunately, DSolve cannot solve any of these equations individually and returns an error message when asked to solve all three at once. It is, however, possible to obtain a solution with DSolve for

eqlin = Simplify[eq1r + eq2r/12]/f[r]
(* -4 + 4*f[r] - 4*r*D[f[r],r] + 2*r^2*D[f[r],{r,2}] +
6*r^3*D[f[r],{r,3}] + r^4D[f[r],{r,4}] *)
DSolve[eqlin == 0, f, r][[1, 1]]
(* f -> Function[{r}, 1 + C[1]/r^2 + C[2]/r + r C[3] + r^2 C[4]] *)


Inserting this solution into the three original equations yields

Simplify[{eq1, eq2, eq3} /. %]/Sin[t]^4
(* {-((3 (14 C[1] C[2] + 9 r C[2]^2 + 5 r^3 C[2] C[3] + r^2 (4 C[2]
+ 6 C[1] C[3])))/(2 r^3)), ...} *)


where the second and third terms of the list are proportional to the first. This determines the allowed values of the four constants of integration.

Reduce[Thread[CoefficientList[%[[1]] r^3, r] == 0], {C[1], C[2], C[3], C[4]}]
//FullSimplify
(* (C[1] == 0 || C[3] == 0) && C[2] == 0 *)


In other words, C[2] and either C[1] or C[3] must be equal to zero, which is the desired result.

Addendum

The recurring expressions in the equations above suggest that relationships exist among {eq1r, eq2r, eq3r}. Indeed,

eq1r == f[r] eqlin - eq2r/12
eq3r == 2 f[r] eqlin - eq2r/3


as can be demonstrated by applying Simplify to each of the two equalities. Thus, the original question can, in principle, be answered by simultaneously solving {eqlin == 0, eq3r == 0}.

DSolve[{eqlin == 0, eq3r == 0}, f, r]


is, however, unable to do so directly, instead returning

DSolve::overdet: There are fewer dependent variables than equations, so the system is overdetermined.

Personally, I find this error message (and its documentation) unsatisfying, because it implies that this system of ODEs is ill-posed. A more accurate message would be that DSolve is unable to determine whether this system of ODEs has a solution. In general, non-trivial simultaneous solutions exist, if the manifolds of the solutions of each ODE, determined independently, intersect. For the present problem, use DSolve to solve eqlin and then substitute the solution into eqr3 to obtain the desired results. (This is, of course, equivalent to the final steps of my original answer.)

Incidentally, using Log[r] instead of r as the independent variable makes the two equations autonomous. The value of doing so seems limited here, however.