I have been trying to solve the following second order non-linear differential equation.
$$\frac{\sin ^2(q(z)) \left(3 \left(z^2 q'(z)^2+1\right) \cos (q(z))+z \sin (q(z)) \left(-z q''(z)+4 z^2 q'(z)^3+3 q'(z)\right)\right)}{z^5 \left(z^2 q'(z)^2+1\right)^{3/2}}=0$$
For which I know that the solution is $ArcCos[m z]$ as can be seen below
In[222]:= (
Sin[q[z]]^2 (3 Cos[q[z]] (1 + z^2 Derivative[1][q][z]^2) +
z Sin[q[z]] (3 Derivative[1][q][z] +
4 z^2 Derivative[1][q][z]^3 - z (q^\[Prime]\[Prime])[z])))/(
z^5 (1 + z^2 Derivative[1][q][z]^2)^(3/2)) /.
q -> (ArcCos[m #] &) // Factor
Out[222]= 0
There is a symmetry under $z \rightarrow - z$ and so $ArcCos[- m z]$ also solves it.
In[368]:=
Sin[q[z]]^2 (3 z Sin[q[z]] Derivative[1][q][z] +
4 z^3 Sin[q[z]] Derivative[1][q][z]^3 +
3 Cos[q[z]] (1 + z^2 Derivative[1][q][z]^2) -
z^2 Sin[q[z]] (q^\[Prime]\[Prime])[z]) /.
q -> (ArcCos[- m #] &) // Factor
Out[368]= 0
I found a very interesting answer given by @Nasser in this thread second order non-linear D.E
however when I try to solve using the above I cannot get precisely the solution, but only approximately. See below
findSeriesSolution[t_, nTerms_] :=
Module[{pt = 0, u, ode, s0, s1, ic, eq, sol, roots},
ic = {u[0] -> \[Pi]/2 , u'[0] -> m};
ode = Sin[
u[t]]^2 (3 t Sin[u[t]] Derivative[1][u][t] +
4 t^3 Sin[u[t]] Derivative[1][u][t]^3 +
3 Cos[u[t]] (1 + t^2 Derivative[1][u][t]^2) -
t^2 Sin[u[t]] (u^\[Prime]\[Prime])[t]);
s0 = Series[ode, {t, pt, nTerms}];
s0 = s0 /. ic;
roots = Solve@LogicalExpand[s0 == 0];
s1 = Series[u[t], {t, pt, nTerms + 2}];
sol = Normal[s1] /. ic /. roots[[1]]]
seriesSol = findSeriesSolution[x, 5]
And the above gives me
While the expansion of $ArcCos[-m z]$
In[366]:= ArcCos[- m z] // Series[#, {z, 0, 9}] &
It is not quite clear what I am doing wrong. Any help would be much appreciated.
Thanks in advance.
Edit: As I am still strugling to understand what's going on here is how I can obtain the first few terms of the $ArcCos$ expansion explicitly using the above.
findSeriesSolution[t_, nTerms_] :=
Module[{pt = 0, u, ode, s0, s1, ic, eq, sol, roots},
ic = {u[0] -> \[Pi]/2, u'[0] -> 1, u''[0] -> 0, u'''[0] -> 1,
u''''[0] -> 0, u''''''[0] -> 0, u'''''''[0] -> 0};
ode = Sin[u[t]]^2 (3 t Sin[u[t]] Derivative[1][u][t] +
4 t^3 Sin[u[t]] Derivative[1][u][t]^3 +
3 Cos[u[t]] (1 + t^2 Derivative[1][u][t]^2) -
t^2 Sin[u[t]] u''[t]);
s0 = Series[ode, {t, pt, nTerms}];
s0 = s0 /. ic;
roots = Solve@LogicalExpand[s0 == 0];
s1 = Series[u[t], {t, pt, nTerms + 2}];
sol = Normal[s1] /. ic /. roots[[1]]]
seriesSol = findSeriesSolution[ x, 5] /. x -> m x
It just seems that as I go higher, I need to determine more derivatives, in a way that I don't understand
findSeriesSolution[t_, nTerms_] := Module[{pt = 0}, {ic = {u[0] -> \[Pi]/2, u'[0] -> m}}; ode = Sin[ u[t]]^2 (3 Cos[u[t]] (1 + t^2 u'[t]^2) + t Sin[u[t]] (3 u'[t] + 4 t^2 u'[t]^3 - t u''[t])); s0 = Series[ode, {t, pt, nTerms}]; s0 = s0 /. ic; roots = Solve@LogicalExpand[s0 == 0]; s1 = Series[u[t], {t, pt, nTerms + 2}]; sol = Normal[s1] /. ic /. roots[[1]]]; seriesSol = findSeriesSolution[z, 5]
$\endgroup$