Solving second order differential equation

Mondo

Junior Member
Joined
Apr 23, 2021
Messages
124
I have a differential equation of the form: [imath]\frac{d^2X}{dx^2} = k^2X[/imath]; function [imath]X[/imath] depends on [imath]x[/imath] only.
I found out the solution to this is [imath]X(x) = Ae^{kx} + Be^{-kx}[/imath] but I have not clue how to solve it. Interestingly, if I change the sign of the RHS of the differential equation, the solution changes exponential function to sin/cos functions. How to approach this problem?

Thank you.
 
I have a differential equation of the form: [imath]\frac{d^2X}{dx^2} = k^2X[/imath]; function [imath]X[/imath] depends on [imath]x[/imath] only.
I found out the solution to this is [imath]X(x) = Ae^{kx} + Be^{-kx}[/imath] but I have not clue how to solve it. Interestingly, if I change the sign of the RHS of the differential equation, the solution changes exponential function to sin/cos functions. How to approach this problem?

Thank you.
If you want to understand why this is the solution to this differential equation, you have to learn how to write the characteristic equation of the differential equation.

First, arrange the equation like this:

[imath]\displaystyle \frac{d^2X}{dx^2} - k^2X = 0[/imath]

The characteristic euqation is:

[imath] r^2 - k^2 = 0[/imath]

Solve for [imath]r[/imath].

[imath] r = \pm k[/imath]

What does this tell you?

Before we answer this question, we go the three cases of the characteristic equation.

Case 1: Distinct Real Roots.

For example: [imath]k = 2 \pm \sqrt{2}[/imath]

The solution is: [imath]X(x) = c_1e^{(2 + \sqrt{2})x} + c_2e^{(2 - \sqrt{2})x}[/imath]


Case 2: Repeated Roots.

For example: [imath]k = 2[/imath]

The solution is: [imath]X(x) = c_1e^{2x} + c_2xe^{2x}[/imath]


Case 3: Complex Roots.

For example: [imath]k = \pm\sqrt{-4} = \pm2i[/imath]

The solution is: [imath]X(x) = c_1\cos 2x + c_2\sin 2x[/imath]


If you get a mixed case like this:

For example: [imath]k = 2 \pm \sqrt{-4} = 2 \pm 2i[/imath]

The solution is: [imath]X(x) = c_1e^{2x}\cos 2x + c_2e^{2x}\sin 2x[/imath]


Now which case is:

[imath] r = \pm k[/imath]

?
 
Now since you have seen the three cases, you have an idea of what will be the solution of many differential equations. But let us take the real reason why the solution to [imath]\displaystyle \frac{d^2X}{dx^2} = k^2X \ \ [/imath] is [imath]\displaystyle \ \ X(x) = Ae^{kx} + Be^{-kx}[/imath].

Imagine we have only this differential equation:

[imath]\displaystyle X'' = X[/imath]

Think about it. What function if you differentiate it twice gives you itself. An educated guess, tells you:

[imath]\displaystyle X(x) = e^x[/imath]

And if you think a little you will notice:

[imath]\displaystyle X(x) = e^{-x}[/imath] is also a solution.

So by inspection, they found the solutions to that differential equation! All remains is just to check if they are linearly independent solutions. And here comes the Wronskian.

If Wronskian of [imath]e^x[/imath] and [imath]e^{-x} \neq 0[/imath], then the two solutions are linearly independent and we can write them as [imath]X(x) = c_1e^x + c_2e^{-x}[/imath]

The Wronskian is:

[imath]\displaystyle W(e^x,e^{-x}) = \begin{bmatrix}e^x & e^{-x} \\e^x & -e^{-x} \end{bmatrix} = -e^xe^{-x} - e^{x}e^{-x} = -1-1 = -2\neq 0[/imath]

Then the two solutions are linearly independent and the solution to the differential equation is their combination:

[imath]X(x) = c_1e^x + c_2e^{-x}[/imath]

And if you want to go deeper, you can derive the characteristic equation from the first solution if it is written like this [imath]X(x) = e^{rx}[/imath].

In General differential equations is a beautiful (and evil) topic and many times you will have to be patient because not everything can be solved quickly, and many differential equations don't have analytical solution, so you will have to approximate their solution by the methods of approximations.
 
Last edited:
Just a little note to correct something. In case 1, 2, and 3, I used the letter [imath]k[/imath] when it was meant to be [imath]r[/imath].

Therefore,

Case 1:
[imath]r = 2 \pm \sqrt{2}[/imath]

Case 2:
[imath]r = 2[/imath]

Case 3:
[imath]r = \pm\sqrt{-4} = \pm 2i[/imath]

The Mixed Case:
[imath]r = 2 \pm \sqrt{-4} = 2 \pm 2i[/imath]


Now the answer to the question is clear and easy. (Which case?)

[imath]r = \pm k \rightarrow[/imath] Case 1.
 
The exponential function [imath] y=e^x [/imath] is essential for differential equations. It satisfies [imath] y'(x)=y(x) ,[/imath] a fixed point equation, and [imath] y'(ax)=ay(ax) [/imath] as a variant. If you look at the cosine and sine functions, then they satisfy [imath] y''(x)=-y(x), [/imath] and [imath] y''(ax)=-a^2y(ax) .[/imath] This means whenever you have such an equation, you can solve them by setting [imath] y(x)=c_1\cos(x)+c_2\sin(x), [/imath] a linear combination of both.

And since [imath] e^{ix}=\cos(x)+ i \sin(x) \, , \,\sin(x)=(e^{ix}-e^{-ix})/2i\, , \,\cos(x)=(e^{ix}+e^{-ix})/2[/imath] they all are related. The connection between the exponential function and integration goes deep and affects many mathematical subjects.

The previous posts offered you an introduction to ordinary differential equations. If you want to learn more look e.g. at
It is 431 pages thick and I dare to say that there is even more to discover when you look at the strange relationship between the exponential function and integration.
 
Top