# DSolve with multiple equations

I'm trying to solve the following system of differential equations:

DSolve[{
b[th]^2 + b'[th]^2 == 0,
b[th] c[th] + 2 b'[th] c'[th] == 0,
-1 + M + b[th] + c[th]^2/4 + M Cos[2 th] + 2 z'[th] b'[th] + c'[th]^2 + b''[th] == 0
},
{b[th], c[th], z[th]}, th
]


Now, if you try solving this system one by one, Mathematica has no issues with it. You use the first equation to get b[th], second to get c[th] and third to get z[th]. You have to repeat this twice because b[th] has two solutions though.

My question is, how to get Mathematica to solve the whole thing at once? Is there perhaps some option for DSolve that would allow you to specify the order of how Mathematica attempts the solution? Or is this a lost cause and I should just do it one by one?

• This question was asked before, probably with a different system, but with a nested-product structure. (I don't remember the answer, and I'm not sure how to find it. Maybe someone else will.) – Michael E2 Feb 27 '20 at 16:05

You can do it in at least 2 steps.

eq = {b[th]^2 + b'[th]^2 == 0,
b[th] c[th] + 2 b'[th] c'[th] == 0,
-1 + M + b[th] + c[th]^2/4 + M Cos[2 th] + 2 z'[th] b'[th] +
c'[th]^2 + b''[th] == 0};

dsolbc = DSolve[eq[[1 ;; 2]], {b, c}, th]

(*   {{b -> Function[{th}, E^(-I th) C[1]],
c -> Function[{th}, E^(-((I th)/2)) C[2]]},
{b -> Function[{th}, E^(I th) C[1]],
c -> Function[{th}, E^((I th)/2) C[2]]}}   *)

dsolz = DSolve[eq[[3]] /. #, z, th] & /@ dsolbc

(*   {{{z -> Function[{th},
C[2] + ((Cos[th] + I Sin[th]) (3 - 3 M + M Cos[2 th] -
2 I M Sin[2 th]))/(6 C[1])]}},
{{z -> Function[{th},
C[2] + ((Cos[th] - I Sin[th]) (3 - 3 M + M Cos[2 th] +
2 I M Sin[2 th]))/(6 C[1])]}}}   *)