# How to find a differential equation whose solution is known?

Let the function \begin{equation*} X(t)=a_0 + \sum_{k=1}^N a_k\cos(kwt)+b_k\sin(kwt) \end{equation*} be a solution of a homogeneous ODE

Question. How can I find the expression of the ODE?

Would it be possible to use the methods presented in Finding a differential equation from a known solution?

or

Finding the general solution of a sixth degree differential equation

to solve it? If yes, how?

Your solution can be rewritten as a sum of $N+1$ pieces
$$X(t) = X_0(t) + X_1(t) + \ldots X_N(t)$$
where $$X_0(t) = a_0,\quad X_k(t) = a_k\cos(kwt) + b_k\sin(kwt)\quad\text{ for } 1 \le k \le N.$$ Since $$\frac{d}{dt}X_0(t) = 0 \quad\text{ AND }\quad \left(\frac{d^2}{dt^2} + k^2w^2\right)X_k(t) = 0\quad\text{ for }\quad 1 \le k \le N.$$
and the operators $\displaystyle\;\frac{d}{dx}$, $\displaystyle\;\frac{d^2}{dx^2} + k^2 w^2$ commute among themselves, $X(t)$ itself will be a solution of the ODE $$\frac{d}{dt}\left[\prod_{k=1}^N \left(\frac{d^2}{dt^2} + k^2 w^2\right)X(t)\right]= 0.$$ Please note that the operator on the LHS is simply the "product" of operators corresponds to the individual pieces.
• @Humberto I'm confused, the solution space of the ODE is a real vector space of dimension $2N+1$ and I've no idea what you are talking about. Sep 18, 2014 at 12:08
• @Humberto Hmm.. the eigenvalues of the operator are well separated. You should not see this unless $N$ is large and you hit numerical instability associated with grid size in the integration. I'll suggest you redo the calculation with exactly the same parameter except changing the grid size. If possible, choose two grid sizes $\Delta T$ close to each other. One of which should be a fraction of $\frac{2\pi}{N!\omega}$ and see whether there are any qualitative differences. Oct 1, 2014 at 16:49