Why do we chose exponential function as a trial solution for second order linear differential equation with constant coefficient? Why do we chose exponential function as a trial solution for second order linear differential equation with constant coefficient ? Can any other function be taken as a trial solution ?
 A: The exponential function $e^{\lambda x}$ is special because its derivative is a multiple of itself.  Thus, substituting it into the ODE gives a quadratic equation in $\lambda$, which is easy to solve.  In general, this method gives us ALL the possible solutions to the ODE, and so using other functions as guess solutions won't work. 
A: If $y'=ay$ consider $z=e^{-ax}y$. We have $z'=-ae^{-ax}y+e^{-ax}y'=e^{-ax}(y'-ay)=0$
It is elementary then that $z=A$ where $A$ is a constant and therefore $y=Ae^{ax}$
Now suppose $$y''-(a+b)y'+aby=0$$ and take $p=y'-ay; q=y'-by$ so that we find $$p'-bp=0; q'-aq=0$$
whence (from the first result) $$y'-ay=p=Ae^{bx}; y'-by=q=Be^{ax}$$
Now considering $p-q$ we eliminate $y'$ to give $$(b-a)y=Be^{ax}-Ae^{bx}$$Which is a solution of the form you wanted - and the logic (which depends on the mean value theorem) shows that this is the inevitable form of the solution to the equation, which is why we choose it as a test solution and determine the constants from the boundary conditions if necessary.
Obviously this goes wrong when $a=b$, but I will leave you to explore that case yourself.
A: Consider a homogeneous linear second order ODE with constant coefficients, say
$$ay''+by'+cy=0.$$
Denote by $E$ the vector space of real-valued functions of class $C^\infty$ on $\mathbb{R}$ and define the endomorphism $\partial$ of $E$ as
$$\forall f\in E,\ \partial f=f'$$
(yes, just the derivative).
Our equation can be written as
$$\bigl(a\partial^2+b\partial+c\text{id}\bigr)y=0,$$
(where $\text{id}$ denotes the identity endomorphism of $E$)
so the solutions can be seen as the kernel of the endomorphism $\bigl(a\partial^2+b\partial+c\bigr)$.
Now factor (in $\mathbb{C}$ if needed) the polynomial $aX^2+bX+c$, say
$$aX^2+bX+c=a(X-\alpha_1)(X-\alpha_2).$$
It is straightforward to check that
$$a\partial^2+b\partial+c\text{id}=a(\partial-\alpha_1\text{id})\circ(\partial-\alpha_2\text{id}).$$
If you hit non-real numbers in the previous factorization, you might want to extend your field of scalars to $\mathbb{C}$ and consider $E\otimes_{\mathbb{R}}\mathbb{C}$ instead of $E$.
The eigenvectors of $\partial$ being the exponentials, it's quite natural to use them.
In fact, this factorization of the pseudo-differential operator in the spirit of Weyl algebras leads to a nice proof of the form of the solutions of the ODE.
With this point of view, it seems natural that there are no sensible trial functions other than the elements in the characteristic spaces of $\partial$, namely the functions of the form
$$x\mapsto P(x)\mathrm{e}^{\lambda x}$$
where $P$ is a polynomial function and $\lambda\in\mathbb{R}$ or $\lambda\in\mathbb{C}$. In the case $\alpha_1=\alpha_2$ we actually see such solutions.
All this can be generalized to ODEs of any order, with constant coefficients; for non-constant coefficients you can, depending on how the coefficients are, do a similar study. With non-constant coefficients, the problem will be in factorizing the pseudo-differential operator.
A: Hey this might be too late but here is a less rigorous but I think easier to follow explanation of why a 2nd order linear differential equation with constant efficient takes the form of an exponential.
Let $a\ddot x+b \dot x +cx=0$ which can be rewritten as $(aD^2+bD+c)x=0$ where $D$ is the differential operator (AKA taking the derivative). Since differentiation is a linear operator it allows the equation to be rewritten in the form of         $$(D+\alpha)(D+\beta)x=0$$
where $\alpha \beta=c/a$ and $ (\alpha + \beta)=-b/a$

now $(D+\beta)x$ must be some function of $t$ call it $f(t)=\dot x +\beta x$, this turns the problem into a first order differential equation:
$$(D+\alpha)f(t)=0$$
we can use an integrating factor to solve this first order differential equation
$$\dot f+\alpha f=0$$
$$f(t)=Ce^{-\alpha t}$$
Now that we know what $f$ is we can solve for $x$:
$$\dot x + \beta x=f(t)=Ce^{-\alpha t}$$
we can use the method of integrating factor again to solve for $x$.
You will see that $x(t)$ will then take the form of an exponential. Keep in mind that when find the solution to $\dot x + \beta x=f(t)=Ce^{-\alpha t}$ the solution to $\dot x + \beta x=0$ needs to be considered as well.
