# I can't get DSolve to work on coupled equations

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

eq1 = Derivative[u][l] - Cos[u[l]]*Sin[u[l]]*D[v[l], l]*D[v[l], l] == 0;
eq2 = Derivative[v][l] + 2*Cot[u[l]]*D[u[l], l]*D[v[l], l] == 0;
eq3 = u == 1;
eq4 = v == 1;
eq5 = Derivative[u] == 1;
eq6 = Derivative[v] == 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[v][l]^2 + (u^\[Prime]\[Prime])[l] == 0, 2 Cot[u[l]] Derivative[u][l] Derivative[v][l] + (v^\[Prime]\[Prime])[l] == 0, u == 1, v == 1, Derivative[u] == 1, Derivative[v] == 1}, {u, v}, l]

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

• 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. Dec 23, 2019 at 22:00
• You can try using NDSolve, however it will only be valid for a certain region that you specify. Dec 23, 2019 at 22:03
• @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. Dec 23, 2019 at 22:05
• @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. Dec 23, 2019 at 22:06
• @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. Dec 23, 2019 at 22:19

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] -> c
Solve[%, v'[l]][[1, 1]] /. Exp[2 C] -> c
% /. l -> 0 /. (Rule @@@ {eq3, eq6})
Reverse@Simplify[Sin^2 # & /@ %]
svp = %%% /. %
(* v'l] -> Csc[u[l]]^2 Sin^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^4 *)
u'[l]^2 == 2 Integrate[%[], u[l]] + c
Solve[FullSimplify[% /. l -> 0 /. (Rule @@@ {eq3, eq5})], c][]
Equal @@ (Solve[Simplify[%% /. %], u'[l]][[2, 1]])
(* u'[l] == Sqrt[1 + Sin^2 - Csc[u[l]]^2 Sin^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/%[], u[l]] == l + c, u {l} > 0]
Solve[FullSimplify[% /. l -> 0 /. (Rule @@ eq3)], c][]
sp = %% /. %
(* l == ArcTan[Sqrt[1/2 (3 - Cos)] Cot] Sqrt[(1 - Cos)/(3 - Cos)] Csc
- (4 ArcTan[(2 Cos[u[l]])/Sqrt[4 + 8/(-3 + Cos) + 2 Cos - 2 Cos[2 u[l]]]]
Sqrt[2 + 4/(-3 + Cos) + Cos - Cos[2 u[l]]]
Sqrt[3 - Cos - 2 Csc[u[l]]^2 Sin^4] Sin[u[l]])/
(3 + 2 Cos - Cos + 2 (-3 + Cos) 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^2 Csc[First[%]]^2}, {l, -2, 8}, ImageSize -> Large,
AxesLabel -> {"u,v'", l}, LabelStyle -> {15, Bold, Black}] 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.