5
$\begingroup$

In trying to solve a geodesic equation, I have these coupled equations:

eq1 = Derivative[2][u][l] - Cos[u[l]]*Sin[u[l]]*D[v[l], l]*D[v[l], l] == 0; 
eq2 = Derivative[2][v][l] + 2*Cot[u[l]]*D[u[l], l]*D[v[l], l] == 0; 
eq3 = u[0] == 1; 
eq4 = v[0] == 1; 
eq5 = Derivative[1][u][0] == 1; 
eq6 = Derivative[1][v][0] == 1; 

Now I want a solution for the functions u, v. So I try this:

DSolve[{eq1, eq2, eq3, eq4, eq5, eq6}, {u, v}, l]

And I get:

DSolve[{-Cos[u[l]] Sin[u[l]] Derivative[1][v][l]^2 + (u^\[Prime]\[Prime])[l] == 0, 2 Cot[u[l]] Derivative[1][u][l] Derivative[1][v][l] + (v^\[Prime]\[Prime])[l] == 0, u[0] == 1, v[0] == 1, Derivative[1][u][0] == 1, Derivative[1][v][0] == 1}, {u, v}, l]

Which just tells me that Mathematica didn't recognize my input. What am I doing wrong?

$\endgroup$
9
  • 3
    $\begingroup$ It may also mean that MMA does not know how to solve your equation / type of equations symbolically. If you change to NDSolve and add a range for $l$ a solution can be found, so there is no problem with your formulation. $\endgroup$
    – MarcoB
    Dec 23, 2019 at 22:00
  • 1
    $\begingroup$ You can try using NDSolve, however it will only be valid for a certain region that you specify. $\endgroup$ Dec 23, 2019 at 22:03
  • 1
    $\begingroup$ @Yusuf - NDSolve does give a proper answer with boundary conditions. So, naturally, I wanted to know if there was an analytical solution and whether Mathematica had the intelligence to find it. $\endgroup$
    – Quarkly
    Dec 23, 2019 at 22:05
  • $\begingroup$ @MarcoB - How do I tell if I'm doing something wrong or whether MMa can't solve it? It'd be great to have some feedback other than my input. $\endgroup$
    – Quarkly
    Dec 23, 2019 at 22:06
  • $\begingroup$ @Quarkly In general, if using NDSolve works but DSolve doesn't, and you're using the correct syntax for both, you can assume that Mathematica is unable to find a symbolic solution to the equations. $\endgroup$ Dec 23, 2019 at 22:19

1 Answer 1

3
$\begingroup$

DSolve often cannot solve differential equations for which symbolic solutions actually do exist. So, out of curiosity, I attempted to solve these equations and made some progress, obtaining v'[l] in terms of u[l], and u[l] as an implicit function of l. Here is the calculation.

Obtain v'[l]:

Equal @@ (DSolve[eq2, u[l], l][[1, 1]]) /. Exp[2 C[1]] -> c
Solve[%, v'[l]][[1, 1]] /. Exp[2 C[1]] -> c
% /. l -> 0 /. (Rule @@@ {eq3, eq6})
Reverse@Simplify[Sin[1]^2 # & /@ %]
svp = %%% /. %
(* v'l] -> Csc[u[l]]^2 Sin[1]^2 *)

Next obtain a first integral for u[l].

Equal @@ (Solve[eq1 /. svp, u''[l]][[1, 1]])
(* (u''[l] == Cot[u[l]] Csc[u[l]]^2 Sin[1]^4 *)
u'[l]^2 == 2 Integrate[%[[2]], u[l]] + c
Solve[FullSimplify[% /. l -> 0 /. (Rule @@@ {eq3, eq5})], c][[1]]
Equal @@ (Solve[Simplify[%% /. %], u'[l]][[2, 1]])
(* u'[l] == Sqrt[1 + Sin[1]^2 - Csc[u[l]]^2 Sin[1]^4] *)

There is, of course, a second solution with the right side of the equation negative. Finally, solve the last equation to obtain

(# - c) & /@ FullSimplify[Integrate[1/%[[2]], u[l]] == l + c, u {l} > 0]
Solve[FullSimplify[% /. l -> 0 /. (Rule @@ eq3)], c][[1]]
sp = %% /. %
(* l == ArcTan[Sqrt[1/2 (3 - Cos[2])] Cot[1]] Sqrt[(1 - Cos[2])/(3 - Cos[2])] Csc[1] 
   - (4 ArcTan[(2 Cos[u[l]])/Sqrt[4 + 8/(-3 + Cos[2]) + 2 Cos[2] - 2 Cos[2 u[l]]]] 
   Sqrt[2 + 4/(-3 + Cos[2]) + Cos[2] - Cos[2 u[l]]] 
   Sqrt[3 - Cos[2] - 2 Csc[u[l]]^2 Sin[1]^4] Sin[u[l]])/
   (3 + 2 Cos[2] - Cos[4] + 2 (-3 + Cos[2]) Cos[2 u[l]]) *)

which is the desired solution for u[l] with u'[l] > 0, though implicit. The solution for u'[l] < 0 is obtained similarly.

For comparision, the numerical solution for u[l] and v'[l] is

NDSolveValue[{eq1, eq2, eq3, eq4, eq5, eq6}, {u[l], v'[l]}, {l, -2, 8}];
Plot[{Evaluate@%, Sin[1]^2 Csc[First[%]]^2}, {l, -2, 8}, ImageSize -> Large, 
    AxesLabel -> {"u,v'", l}, LabelStyle -> {15, Bold, Black}]

enter image description here

The analytical solutions compare well with this. In summary, it is possible to obtain symbolic solutions for these equations with Mathematica, although the solution for u[l] is implicit. All things considered, it seems understandable that DSolve could not provide a viable solution for the equations, although showing relevant intermediate results would have been helpful.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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