<s>[INST] Obtaining Differential Equations from Functions I can now recognise the order and the type of differential equations.Let's say
 $$\frac{dy}{dx} = x^2 - 1$$ 
is a first order ODE, 
 $$\frac{d^2y}{dx^2} + 2\left(\frac{dy}{dx}\right)^2 + y = 0$$ 
is a second order ODE and so on. I am having trouble to obtain a differential equation from a given function. I could find the differential equation for $y = e^x(A \cos x + B \sin x)$ and the steps that I followed are as follows.
$$ 
\begin{align*}
\frac{dy}{dx} &= e^x(A \cos x + B \sin x) + e^x(-A \sin x + B \cos x) 

\\ &= y +e^x(-A \sin x + B \cos x) \tag{1}
\\
\frac{d^2 y}{dx^2} &= \frac{dy}{dx} + e^x(-A \sin x + B \cos x) + e^x(-A \cos x - B \sin x)
\\ &=
\frac{dy}{dx}+\left(\frac{dy}{dx} - y\right) - y 
\end{align*}
$$
using the orginal function and $(1)$. Finally,
$$ 
\frac{d^2y}{dx^2} - 2 \frac{dy}{dx} + 2y = 0 ,$$ 
which is the required differential equation.
Similarly, if the function is $y=(A\cos2t + B\sin2t)$, the differential equation that I get is 
$$
\frac{d^2y}{dx^2} + 4y = 0
$$ 
following similar steps as above.

My question is how do I obtain the differential equations for the following functions using similer procedures
$$y = Ae^{3x} + Be^{2x}$$
$$xy = Ae^{x} + Be^{-x} + x^{2}$$
I am not looking for a solution in determinant form using vector spaces or any other linear algebra/matrices.Please provide step by step solution for the function in order to obtain a particular differential equation.

Thank you in advance.
 [/INST] Eliminate $a$ and $b$ from $$y = ae^{2x} +be^{3x}\tag{1}$$
$$\frac{dy}{dx} = 2ae^{2x} + 3be^{3x}\tag{2}$$
$$d^2y/dx^2 = 4ae^{2x} + 9be^{3x}\tag{3}$$
$(1)\cdot 2 -(2)$ we get
$$2y - \frac{dy}{dx} = -be^3x$$ 
$$b = e^{-3x} \left(\frac{dy}{dx} - 2y\right)\tag{4}$$
$(2)*2 - (3)$
$$2 \frac{dy}{dx} - \frac{d^2y}{dx^2} = - 3 b e^{3x}$$
$$b = 1/ 3e ^{3x} \left(\frac{d^2y}{dx^2} - 2 \frac{dy}{dx}\right)\tag{5}$$
compare $(4)$ and $(5)$
$$(dy/dx - 2y) = 1/3 \left(\frac{d^2y}{dx^2} - 2 \frac{dy}{dx}\right)$$
$$3\frac{dy}{dx} - 6y = \frac{d^2y}{dx^2} -2 \frac{dy}{dx}$$
$$\frac{d^2y}{dx^2} -5 \frac{dy}{dx} + 6y = 0$$
</s>