Given a function, how to obtain a differential equation? I could obtain a differential equation upon eliminating arbitrary constants from this equation $y = e^x(A \cos x + B \sin x)$. Here are the steps.
$$ \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)$$
$$ \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 ,$$
or $$ \frac{d^2y}{dx^2} - 2\frac{dy}{dx} + 2y = 0 $$
which is the required differential equation.
Now how do I obtain a differential equation for this one: $y = cx + c^2$? 
I am assuming $c$ is some arbitrary constant. Here are the steps that I've tried.
 $$ \frac{dy}{dx} = c$$
$$ \frac{d^2y}{dx^2} = 0 $$ and I am stuck. 
I am having trouble with this one too: $y = Ae^{3x} + Be^{2x}$ where A and B are constants.Let me edit this.For the above function differentiating w.r.t x first time gives
$$ \frac{dy}{dx} = 3Ae^{3x} + 2Be^{2x}$$
Differentiating again w.r.t x gives $$ \frac{d^2y}{dx^2} = 9Ae^{3x} + 4Be^{2x}$$ What next?
All Right, I've edited as per request. And also I corrected the pointed mistake. Sorry for the inconvenience.
 A: As for your first question, you just need to substitute $c$ in your first equation:
$$
y = y'x + (y')^2
$$
and you already have a differential equation whose general solution is your function $y = cx + c^2$. (Check this!)
As for the second one, since it depends on two parameters, $A$ and $B$, it's a solution of a second order differential equation. So you should derive two times:
\begin{aligned}
y   &=    Ae^{3x} + B e^{2x}  \\
y'  &=   3Ae^{3x} + 2B e^{2x} \\
y'' &=   9Ae^{3x} + 4B e^{2x}
\end{aligned}
Now, you look at these equalities as one between vectors in $\mathbb{R}^3$:
$$
\begin{pmatrix}
y \\
y' \\
y''
\end{pmatrix}
=
A
\begin{pmatrix}
e^{3x} \\
3e^{3x} \\
9e^{3x}
\end{pmatrix}
+
B
\begin{pmatrix}
e^{2x}  \\
2e^{2x}  \\
4e^{4x}
\end{pmatrix}
$$
This way, they say that you have three linearly dependent vectors in $\mathbb{R}^3$. So their determinant must be zero:
$$
\begin{vmatrix}
y   &   e^{3x}    &  e^{2x}  \\
y'  &  3e^{3x}    &  2e^{2x}  \\
y'' &  9e^{3x}    &  4e^{2x}
\end{vmatrix}
= 0
$$
And this is your second order differential equation.
EDIT. More explicitly, computing this determinant, we get:
$$
0 = 
y 
\begin{vmatrix}
3e^{3x}   &   2e^{2x}  \\
9e^{3x}   &   4e^{2x}
\end{vmatrix}
-y' 
\begin{vmatrix}
e^{3x}    &   e^{2x}  \\
9e^{3x}   &  4e^{2x}
\end{vmatrix}
+y'' 
\begin{vmatrix}
e^{3x}    &   e^{2x}  \\
3e^{3x}   &  2e^{2x}
\end{vmatrix}
$$
Etc.
