# Solving set of equations in two variables

I have this set of equations

$$L = 3 \Big(\frac{\dot a^2}{a^2} + \frac{\dot a \dot b}{a b} \Big)- \frac{1}{a^3} \\ L = \Big( 2 \frac{\ddot a^2}{a} + \frac{\dot a^2}{a^2} + \frac{\ddot b^2}{b} + 2 \frac{\dot a \dot b}{ab}\Big) \\L = - \Big( 2 \frac{\dot a^2}{a^2} +2 \frac{\dot a \dot b}{a b} + \frac{\ddot a}{a} + \frac{\ddot b}{b} \Big)\\ L = 3 b^2 \Big( \frac{\ddot a}{a} + \frac{\dot a^2}{a^2} \Big)$$

How to solve in Mathematica to get $$b$$ in terms of $$a$$.

I tried something like

Solve[{3 ((D[a[t], t]^2/ a[t]^2) + ((D[a[t], t] D[b[t], t])/(a[t] b[t]))) - (1/(a[t]^3)) ==
2 (D[a[t], t, t]^2/a[t]) + (D[a[t], t]^2/ a[t]^2) + (D[b[t], t, t]^2/b[t]) +  2 ((D[a[t], t] D[b[t], t])/(a[t] b[t])) ==
-(2 (D[a[t], t]^2/a[t]^2) +  2 ((D[a[t], t] D[b[t], t])/(a[t] b[t])) +  (D[a[t], t, t]/a[t]) + (D[b[t], t, t]/b[t]) ) ==
3 b[t]^2 ((D[a[t], t]/a[t]) + (D[a[t], t]^2/a[t]^2))}, {b[t]}]


But of course it didn't work, because the number of equations is larger than the unknown variables. So how to get $$b$$ as a function in $$a$$?

• Aren't these just differential equations? Apr 2, 2019 at 3:43
• Yes, dot is derivative with respect to time.
– S.S.
Apr 2, 2019 at 4:07
• Solve can't solve the differential equations. You should use the NDSolve but before you can try with Reduce to exclude L. Apr 2, 2019 at 4:54

There is a typo either in the formatted equations or in the code. Assuming the latter, the fourth equation should have a double derivative. Fixing that we move from rational functions to polynomials as below.

rats = {-(3 ((D[a[t], t]^2/
a[t]^2) + ((D[a[t], t] D[b[t], t])/(a[t] b[t]))) - (1/(a[
t]^3))),
2 (D[a[t], t, t]^2/a[t]) + (D[a[t], t]^2/
a[t]^2) + (D[b[t], t, t]^2/b[t]) +
2 ((D[a[t], t] D[b[t], t])/(a[t] b[t])), -(2 (D[a[t], t]^2/
a[t]^2) +
2 ((D[a[t], t] D[b[t], t])/(a[t] b[t])) + (D[a[t], t, t]/
a[t]) + (D[b[t], t, t]/b[t])),
3 b[t]^2 ((D[a[t], t, t]/a[t]) + (D[a[t], t]^2/a[t]^2))} - ll;
polys = Numerator[Together[rats]];


We have four expressions to zero, and we want to eliminate four derivatives (two first and two second derivatives in each of a[t] and b[t]). We need more equations than variables. We need to prolong the system (take one or more derivatives of one or more expressions). Observing that only first derivatives appear in that first expression, we differentiate it since that will give no new variables.

morepolys = Join[polys, D[polys[[1 ;; 1]], t]];
vars = Variables[morepolys];
dvars = Cases[vars, Derivative[_][_][_]];


A Groebner basis will eliminate the derivatives, leaving a polynomial implicit relation between a[t] and b[t]. This takes several minutes.

Timing[
gb = GroebnerBasis[morepolys, {b[t], a[t]}, dvars,
MonomialOrder -> EliminationOrder,
CoefficientDomain -> RationalFunctions]]

(* Out[441]= {441.992, {16 ll^4 a[t]^14 + 16 ll^4 a[t]^13 b[t] -
32 ll^3 a[t]^11 b[t]^2 + 4 ll^4 a[t]^12 b[t]^2 +
32 ll^4 a[t]^14 b[t]^2 + 32 ll^3 a[t]^10 b[t]^3 +
64 ll^4 a[t]^13 b[t]^3 + 32 ll^2 a[t]^8 b[t]^4 +
24 ll^3 a[t]^9 b[t]^4 + 36 ll^2 a[t]^10 b[t]^4 -
64 ll^3 a[t]^11 b[t]^4 + 24 ll^4 a[t]^12 b[t]^4 -
180 ll^3 a[t]^13 b[t]^4 + 32 ll^4 a[t]^14 b[t]^4 +
16 ll^2 a[t]^7 b[t]^5 + 18 ll^2 a[t]^9 b[t]^5 +
40 ll^3 a[t]^10 b[t]^5 - 90 ll^3 a[t]^12 b[t]^5 +
88 ll^4 a[t]^13 b[t]^5 - 16 ll a[t]^5 b[t]^6 +
64 ll^2 a[t]^6 b[t]^6 + 54 ll a[t]^7 b[t]^6 +
48 ll^2 a[t]^8 b[t]^6 + (-18 ll + 100 ll^3) a[t]^9 b[t]^6 -
108 ll^2 a[t]^10 b[t]^6 -
48 ll^3 a[t]^11 b[t]^6 + (18 ll^2 + 52 ll^4) a[t]^12 b[t]^6 +
54 ll^3 a[t]^13 b[t]^6 + 16 ll^4 a[t]^14 b[t]^6 +
32 ll a[t]^4 b[t]^7 + 147 ll a[t]^6 b[t]^7 -
24 ll^2 a[t]^7 b[t]^7 - 402 ll^2 a[t]^9 b[t]^7 -
48 ll^3 a[t]^10 b[t]^7 - 177 ll^3 a[t]^12 b[t]^7 +
40 ll^4 a[t]^13 b[t]^7 + 4 a[t]^2 b[t]^8 + 84 ll a[t]^3 b[t]^8 -
42 a[t]^4 b[t]^8 -
16 ll a[t]^5 b[t]^8 + (126 + 168 ll^2) a[t]^6 b[t]^8 +
180 ll a[t]^7 b[t]^8 +
24 ll^2 a[t]^8 b[t]^8 + (-630 ll + 132 ll^3) a[t]^9 b[t]^8 -
234 ll^2 a[t]^10 b[t]^8 -
16 ll^3 a[t]^11 b[t]^8 + (828 ll^2 + 48 ll^4) a[t]^12 b[t]^8 +
96 ll^3 a[t]^13 b[t]^8 + 4 ll^4 a[t]^14 b[t]^8 - 28 a[t] b[t]^9 +
147 a[t]^3 b[t]^9 + 28 ll a[t]^4 b[t]^9 - 126 ll a[t]^6 b[t]^9 +
30 ll^2 a[t]^7 b[t]^9 - 567 ll^2 a[t]^9 b[t]^9 -
32 ll^3 a[t]^10 b[t]^9 - 102 ll^3 a[t]^12 b[t]^9 +
2 ll^4 a[t]^13 b[t]^9 + 49 b[t]^10 + 98 ll a[t]^3 b[t]^10 +
105 ll^2 a[t]^6 b[t]^10 + 56 ll^3 a[t]^9 b[t]^10 +
16 ll^4 a[t]^12 b[t]^10}} *)


Despite your question is not clear you want only Representation of b respect to a, or solving the differential equation!?

However, Representation of b respect to a. Here's some way hope you find your way through! You should add more assumption such that Solution in real domain, a>0 & b>0 so on,,,

l1[t_] := 3*(D[a[t], {t, 1}]^2/a[t]^2 + (D[a[t], {t, 1}]*D[b[t], {t, 1}])/(a[t]*b[t])) -
1/a[t]^3;

l2[t_] := 2*(D[a[t], {t, 2}]^2/a[t]) + D[a[t], {t, 1}]^2/a[t]^2 +
D[b[t], {t, 2}]^2/b[t] + 2*((D[a[t], {t, 1}]*D[b[t], {t, 1}])/(a[t]*b[t]));

l3[t_] := -(2*(D[a[t], {t, 1}]^2/a[t]^2) + 2*((D[a[t], {t, 1}]*D[b[t], {t, 1}])/
(a[t]*b[t])) + D[a[t], {t, 2}]/a[t] + D[b[t], {t, 2}]/b[t]);

l4[t_] := (3*b[t]^2)*(D[a[t], {t, 2}]/a[t] + D[a[t], {t, 1}]^2/a[t]^2);


here is the part you want! take only two equation every time!

Solve[{l1[t] == l2[t]}, {b[t]}, Reals]


Another way and i don't think you want this!

Reduce[{l1[t] == l2[t]}, {a[t], b[t]}, Reals]


Give large output!