# Getting Mathematica to solve a system of two second order nonlinear ordinary differential equations

I tried solving a system of two second order nonlinear ordinary differential equations using the DSolve command. First, I tried like this:

eqns = {A''[x] == 2/B[x]*A'[x]*B'[x],
B''[x] + 1/B[x]*(A'[x])^2 - 1/B[x]*(B'[x])^2 == 0};
sol = DSolve[eqns, {A, B}, x]


However, as Mathematica didn't (couldn't?) solve this, I transformed it into a system of four first order equations:

eqns = {c'[x] == 2/B[x]*c[x]*d[x],
d'[x] + 1/B[x]*(c[x])^2 - 1/B[x]*(d[x])^2 == 0, c[x] == A'[x],
d[x] == B'[x], c == 1, d == 1, A == 1, B == 1};
sol = DSolve[eqns, {A, B, c, d}, x]


This still doesn't work. Weirdly enough, I don't even get an error message.

I only included the boundary conditions thinking that they may be helpful, but they aren't part of my original problem.

Your help would be greatly appreciated:)

• This is a non linear ODE, are you sure that a closed form solution exists? If I choose initial conditions and use "NDSolve" I can easily get numerical solutions. E.g. (A == 1, B == 1, A' == .1, B' == .1) Apr 21 at 16:28
• 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. Apr 22 at 18:20

With a bit of assistance, DSolve can produce a symbolic answer, as desired. Solve the first ODE for A'[x],

Equal@@(D[DSolve[eqns // First, A[x], x], x][[1, 1]])
(* A'[x] == B[x]^2 C *)


and use this result instead of the first ODE

FullSimplify@DSolve[{%, eqns // Last}, {A[x], B[x]}, x] /. C -> C Sqrt[C]
/. Sqrt[Sech[z_]^2] -> Sech[z]
(* {{B[x] -> -Sech[(x - C) Sqrt[C]]/C,
A[x] -> C + Tanh[(x - C) Sqrt[C]]/C},
{B[x] ->  [Sech[(x - C) Sqrt[C]]/C,
A[x] -> C + Tanh[(x - C) Sqrt[C]]/C},
{B[x] -> -Sech[Sqrt[C] (x + C)]/C,
A[x] -> C + Tanh[Sqrt[C] (x + C)]/C},
{B[x] ->  Sech[Sqrt[C] (x + C)]/C,
A[x] -> C + Tanh[Sqrt[C] (x + C)]/C}} *)


These solutions can be verified by

% /. Rule[z1_, z2_] :> Rule[Head[z1], Function[x, z2]];
FullSimplify[eqns /. %]
(* {{True, True}, {True, True}, {True, True}, {True, True}} *)