# How to solve second order differential equations? [summary]

As I do my engineering studies, I find more and more ways to solve differential equations, especially the second order ones. With more and more ways to solve these equations, I am loosing my overview and don't know what method to choose now. Which one is the most useful? easiest? most powerful?...

I thought therefore it would be great if this knowledge could be shortly summarized into this post. Myself, I am familiar with three different ways to solve these equations: - the guessing method (with constant coefficients) - Laplace method - the use of Linear Algebra for linear second order differential equations

The best thing to explain this would be to use an example. Therefore, here is one: Solve the (simple) homogeneous differential equation of

$y''-2y'+2y=0$

Initial conditions: $y(0)=0$ and $y'(0)=1$

Solution: $y=e^t\sin t$

(If you can use a non homogenous example instead to explain methods even further, that would be great)

Thanks a lot for your contribution and help!

Ok, let us start with the second order homogeneous differential equation: $$y''-2y'+2y=0$$ I will derive a solution, but not in the traditional way. I am going to arrive at the differential equation solution in another way, and it involves substitution and solving a couple of 1st order ODEs. It kind of gives some insight as to why the traditional way works. Rewrite the equation as:

$$y''+(-1+i)y'+(-1-i)y'+2y=0$$

If you look closely at how I rewrote that middle term, the roots of the polynomial $\lambda^2-2\lambda+2=0$ are $-1+i,-1-i$. Now rewrite the equation as

$$y''+(-1+i)y'+(-1-i)(y'+(-1+i)y)=0$$

Now let $z=y'+(-1+i)y$.

The equation now becomes a first order one:

$z'+(-1-i)z=0$

This is an equation you can easily solve by separating variables:

$$z=De^{(1+i)x}, D\in \mathbb{C}$$

Now solve $z=y'+(-1+i)y$ by replacing $z$ with $De^{(1+i)x}$

You can use the integrating factor method to get that

$$y=\frac{\int \mu(x)De^{(1+i)x}dx+E}{\mu(x)}$$ where $$\mu(x)=e^{\int (-1+i) dx}=e^{(-1+i)x}$$

So, after some simplifications

$$y=De^{(1-i)x}+Ee^{(1+i)x},D,E \in \mathbb{C}$$

Now invoke Euler's identity: $e^{ix}=\cos(x)+i\sin(x)$ to simplify out the complex exponentials. After doing this combining constants together

$$y=Ge^x\cos(x)+He^{x}\sin(x)$$

This is why the traditional way of "guessing" $y=e^{\lambda x}$ and solving the auxiliary characteristic polynomial for $\lambda$ works.
For example $y'=f(x)g(y)$ is a clue for a separation of variables. $y'+p(x)y=q(x)$ is a clue for the integrating factor method. $Mdx+Qdy=0$ is a clue for testing for exactness (or inexactness) and following that procedure. There are other types like $y'=f(x,y)$ where you check $f(tx,ty)=f(x,y)$ and make a substitution like $y=vx$. In summary, it depends on the way the problem is presented to you.