[Math] How many conditions for solving a second order differential equation numerically are necessary

ordinary differential equations

I have a second order differential equation that I'm trying to solved numerically, how many and which initial conditions will I need to be able to solve it numerically? I have y'',y' and y in the equation, I will need y and y'? and does it matter at which points? also if you could say how to find those values it would be great since I just have the differential equation.

Best Answer

The general solution of an $n^{th}$ order differential equation depends on $n$ unknown parameters. (Taking an antiderivative introduces an integration constant; iterating $n$ times introduces $n$ constants.)

To find these parameters, you need $n$ conditions, which can involve the function and/or its derivatives at some points. They are usually called initial conditions - typically $y(0), y'(0)$ - or boundary conditions - typically $y(a),y(b)$.

If you "just have the equation", there is no way to determine the parameters and they remain adjustable. In the case of a linear equation, by the principle of superposition, you can solve the equation for $n$ independent sets of conditions, and the solution for other conditions will be obtained by linear combination of the $n$ particular solutions.


For example,

$$y''=-y$$ has the general solution

$$y(x)=C\cos x+S\sin x.$$

With the initial conditions $y(0)=1,y'(0)=0$, the particular solution is $y_c(x):=\cos x$, and with the inital conditions $y(0)=0,y'(0)=1$, $y_s(x):=\sin x$.

As we chose the canonical basis, the solution for arbitrary initial conditions is

$$y(x)=y(0) y_c(x)+y'(0) y_s(x).$$

Related Question