4

sHello to everyone, i would like a suggestion on how solve this nonlinear differential equations:

$$y''+ a\ x\cos y=0 $$

where $a \in \mathbb{R}\ and \ \ y=y(x) $

I am aware that if a solution can be found it will be a series solution, for example, proceeding with the power series could lead to some result?

Or what replacement do I need to bring it back to the first order?

Thank you in advance for any idea or proposed solution.

P.S. I have not yet been able to find out if this differential equation has already been resolved in literature.

C.C.12
  • 402
  • i think you will Need a numerical method – Dr. Sonnhard Graubner Sep 16 '17 at 18:11
  • Unfortunately I need a non-numeric solution. As I already wrote, it would be very good to have a series solution, and I believe that in series of powers can be found, but I have not managed to retrieve it after several attempts – C.C.12 Sep 16 '17 at 18:19
  • A series solution with $\cos y$ is a mess! $$\cos y(x)=\frac{1}{6} x^3 \left(-y^{(3)}(0) \sin (y(0))+y'(0)^3 \sin (y(0))-3 y'(0) y''(0) \cos (y(0))\right)+x^2 \left(-\frac{1}{2} y''(0) \sin (y(0))-\frac{1}{2} y'(0)^2 \cos (y(0))\right)-x y'(0) \sin (y(0))+\cos (y(0))+O(x^4)$$ I have only written the first $4$ terms... – Raffaele Sep 16 '17 at 18:43
  • unfortunately, but perhaps it is the only way – C.C.12 Sep 16 '17 at 19:30
  • How many terms of $y$ do you want? – Nosrati Sep 16 '17 at 20:19
  • I have to be quite precise, so I believe many – C.C.12 Sep 16 '17 at 20:25

2 Answers2

3

Hint:

Let $y=iu$ ,

Then $\dfrac{dy}{dx}=i\dfrac{du}{dx}$

$\dfrac{d^2y}{dx^2}=i\dfrac{d^2u}{dx^2}$

$\therefore i\dfrac{d^2u}{dx^2}+ax\cos iu=0$

$\dfrac{d^2u}{dx^2}-iax\cosh u=0$

$\dfrac{d^2u}{dx^2}-\dfrac{iaxe^u}{2}-\dfrac{iaxe^{-u}}{2}=0$

Let $v=e^u$ ,

Then $u=\ln v$

$\dfrac{du}{dx}=\dfrac{1}{v}\dfrac{dv}{dx}$

$\dfrac{d^2u}{dx^2}=\dfrac{d}{dx}\left(\dfrac{1}{v}\dfrac{dv}{dx}\right)=\dfrac{1}{v}\dfrac{d^2v}{dx^2}-\dfrac{1}{v^2}\left(\dfrac{dv}{dx}\right)^2$

$\therefore\dfrac{1}{v}\dfrac{d^2v}{dx^2}-\dfrac{1}{v^2}\left(\dfrac{dv}{dx}\right)^2-\dfrac{iaxv}{2}-\dfrac{iax}{2v}=0$

$2v\dfrac{d^2v}{dx^2}-2\left(\dfrac{dv}{dx}\right)^2-iaxv^3-iaxv=0$

doraemonpaul
  • 16,488
3

To compute a power series up to any desired order, you can use the tools of Taylor series arithmetic that are a part of the Automatic/Algorithmic Differentiation theory. As differentiation of a power series contains an index shift, new coefficients result on the left side while evaluating or updating the evaluation on the right side.

To simplify the Taylor series arithmetic introduce $u=\cos y$, $v=\sin y$. Then \begin{align} u'&=-vy'\\ v'&=~~~uy'\\ y''&=-axu. \end{align} This is now a problem where the multiplication of Taylor series is the most complicated operation which allows to establish the equations for the coefficients of these 3 series $$y=\sum_{n=0}^\infty y_kx^k, ~~~u=\sum_{n=0}^\infty u_kx^k,~~~ v=\sum_{n=0}^\infty v_kx^k. $$ These can then be computed by successively inserting the already computed coefficients,

\begin{align} y_0&=y(0)& u_0&=\cos(y_0),& v_0&=\sin(y_0),\\ y_1&=y'(0)& u_1&=-v_0y_1,& v_1&=u_0y_1,\\ 2y_2&=0,& 2u_2&=-v_0(2y_2)-v_1y_1,& 2v_2&=u_0(2y_2)+u_1y_1,\\ 6y_3&=-au_0,& 3u_3&=-\sum_{k=1}^3v_{3-k}(ky_k),& 3v_3&=\sum_{k=1}^3u_{3-k}(ky_k),\\ &\vdots\\ n(n-1)y_n&=-au_{n-3},&nu_n&=-\sum_{k=1}^nv_{n-k}(ky_k),& nv_n&=\sum_{k=1}^nu_{n-k}(ky_k),\\ \end{align}

For further information on the automatic creation of such algorithms, see

  • FADBAD++ by Stauning and Bendtsen (project active 1996-2003), the third example in the crash-course section of their description site,
  • VNODE, used for examples in papers by N. Nedialkov (2001)
  • TSM - ODE playground by user m4r35n357 (active 2018-), Taylor series manipulation with a focus on ODE
Lutz Lehmann
  • 131,652
  • 1
    Appreciate the mention! One of the biggest problems I had developing this was the rare and haphazard documentation of the method. Ultimately, I made my own "explanation" using elements from various sources, but hammered into a consistent and clear presentation (although I am not a mathematician!). See the file https://github.com/m4r35n357/ODE-Playground/blob/master/taylor-ode.h for a pretty complete description of how it all fits together. The master branch is no longer in development; there are now two current branches: pure_c (including GNU bc for arbitrary precision work) and python. – m4r35n357 Dec 14 '24 at 14:53
  • I have spent the last couple of weeks writing up my method, in case I need it later ;) One thing that jumped out at me is that you don't need to pin it down to Taylor series at all - everything (the ODE solution method and the recurrences) is couched entirely in terms of power series alone. Of course you can "extract" the derivatives numerically once you have the solution (just multiply each coefficient by k factorial), but since the solution is a priori unknown, there is no way to use the derivatives to actually generate the coefficients! Well, I thought it was interesting anyway . . . – m4r35n357 Jan 11 '25 at 13:26
  • Here is my effort so far. I will add a link to all the READMEs next time I upload . . . https://m4r35n357.github.io/documents/taylor-series-method.pdf – m4r35n357 Jan 13 '25 at 12:51
  • 1
    Yes, that is the usual extend of the treatment of truncated Taylor series arithmetic, https://www.google.com/search?q=truncated+taylor+series+arithmetic+in+automatic+differentiation gives some references. "Taylor" because these power series represent specific functions, one is primarily interested in the functions and less so in the coefficient sequences, they are just tools to get to the function. This naming convention is a question of preference, not of necessity. – Lutz Lehmann Jan 13 '25 at 13:21
  • Thanks, I looked through a few of those. Most dealt with the recurrences rather than the ODE solution method (which is what I am mainly concerned with!). I am glad I have come up with a presentation suitable for non-mathematicians, because I don't really have the background to fully understand the more formal approaches ;) – m4r35n357 Jan 13 '25 at 13:47