# Solving a system of non-linear equations?

I want to solve the following system of equations:

E1 = 1/4 (3 Subscript[a, 1][
t] (4 Sqrt[
2] + (-1 +
t) (-(-1 + t) ((1 + 2 t) Subscript[a, 1][t] +
t Subscript[a, 2][t]) - t^2 Subscript[a, 3][t]) +
t^2 (-3 + 2 t) Subscript[a, 4][t]) +
4 Derivative[1][Subscript[a, 1]][t]);
E2 = Subscript[a, 2][
t] (3 Sqrt[2] +
1/8 (1 +
2 Sqrt[2]) ((-1 +
t) ((-1 + t) ((1 + 2 t) Subscript[a, 1][t] +
t Subscript[a, 2][t]) + t^2 Subscript[a, 3][t]) + (3 -
2 t) t^2 Subscript[a, 4][t])) +
Derivative[1][Subscript[a, 2]][t];
E3 = Subscript[a, 3][
t] (3 Sqrt[2] -
1/8 (-1 +
2 Sqrt[2]) ((-1 +
t) ((-1 + t) ((1 + 2 t) Subscript[a, 1][t] +
t Subscript[a, 2][t]) + t^2 Subscript[a, 3][t]) + (3 -
2 t) t^2 Subscript[a, 4][t])) +
Derivative[1][Subscript[a, 3]][t];
E4 = 3/4 Subscript[a, 4][
t] (4 Sqrt[
2] + (-1 +
t) ((-1 + t) ((1 + 2 t) Subscript[a, 1][t] +
t Subscript[a, 2][t]) + t^2 Subscript[a, 3][t]) + (3 -
2 t) t^2 Subscript[a, 4][t]) +
Derivative[1][Subscript[a, 4]][t];


I tried

DSolve[{E1 == 0, E2 == 0, E3 == 0, E4 == 0}, {Subscript[a, 1],
Subscript[a, 2], Subscript[a, 3], Subscript[a, 4]}, t]


I also tried with Solve and NSolve, but the evaluation exhausted my patience. Any suggestion?

• Nothing to do with this problem but in general I recommend avoiding the use of subscripts with symbols in computational code. – Jack LaVigne Dec 29 '15 at 0:37

Provide some initial conditions and use NDSolve

Format[a[n_]] := Subscript[a, n]

eqns = Join[{(1/4)*(3*a[1][t]*
(4*Sqrt[2] + (-1 + t)*
((1 - t)*((1 + 2*t)*
a[1][t] + t*a[2][t]) -
t^2*a[3][t]) +
t^2*(-3 + 2*t)*a[4][t]) +
4*Derivative[1][a[1]][t]),
a[2][t]*(3*Sqrt[2] +
(1/8)*(1 + 2*Sqrt[2])*
((-1 + t)*((-1 + t)*
((1 + 2*t)*a[1][t] +
t*a[2][t]) +
t^2*a[3][t]) + (3 - 2*t)*
t^2*a[4][t])) +
Derivative[1][a[2]][t],
a[3][t]*(3*Sqrt[2] -
(1/8)*(-1 + 2*Sqrt[2])*
((-1 + t)*((-1 + t)*
((1 + 2*t)*a[1][t] +
t*a[2][t]) +
t^2*a[3][t]) + (3 - 2*t)*
t^2*a[4][t])) +
Derivative[1][a[3]][t],
(3/4)*a[4][t]*(4*Sqrt[2] +
(-1 + t)*((-1 + t)*
((1 + 2*t)*a[1][t] +
t*a[2][t]) +
t^2*a[3][t]) + (3 - 2*t)*
t^2*a[4][t]) +
Array[a[#][0] &, 4] == Range[4] // Thread];

soln = NDSolve[eqns, Array[a[#][t] &, 4], {t, 0, 1}][[1]];

Plot[
Evaluate[Array[a[#][t] &, 4] /. soln],
{t, 0, 1},
Frame -> True,
Axes -> False,
PlotLegends -> Array[a[#][t] &, 4],
PlotRange -> All]


• How did you convert "Subscript[a, 2][t]" to "a[2][t]"? and are there any method that with your reply I have approximate "a1[t]" without figure? – Bahram Agheli Dec 29 '15 at 7:44
• @BahramAgheli - {E1, E2, E3, E4} /. Subscript[a,n_] :> a[n] I do not know what you mean by "approximate 'a1[t]' without figure" – Bob Hanlon Dec 30 '15 at 3:32
• I want to use a1, a2, a3 and a4 for another system, but in your reply I I do not have function of a1, a2 and .... – Bahram Agheli Dec 30 '15 at 9:45
• @BahramAgheli - a[1][t] is an [indexed function] (reference.wolfram.com/language/tutorial/…) of t defined on the interval 0 <= t <= 1 (domain constrained by NDSolve) similarly with a[2][t], a[3][t], and a[4][t]. They are used like any other function; e.g., they were plotted in my answer. The Format command causes them to be displayed in subscripted form in any output. – Bob Hanlon Dec 30 '15 at 12:56
• Dear Hanlon, Many thanks . – Bahram Agheli Dec 30 '15 at 15:50