Chapter 4 First and second order ODEs

Not all ODEs are analytically solvable. In this section we discuss some types of first and second order ODEs that are analytically solvable and see some examples.

4.1 First order ODEs

A first order ODE has only the first derivative represented. The general implicit form for a first order ODE for the function x(t) is: G(t,x,dxdt)=0, and its explicit form is: dxdt=F(x,t).

In the following we discuss some classes of first order ODEs and describe methods of obtaining a solution for them. These inculde separable and linear first order ODEs. The other types of First Order ODEs that can be solved are based on transformations or change of variables. We see two examples of this in the following. Another important class of first order ODEs that can be solved are Exact ODEs that will be discussed in part III of the course after introducing partial and total differentiation.

4.1.1 Separable First Order ODEs

A separable first order ODE can be written in the following form: dxdt=F1(x)F2(t). Solution Rearranging and integrating both sides we get: dxF1(x)=F2(t)dt+c1.

4.1.2 Linear First Order ODEs

First order linear ODEs have the following general form: dydx+p(x)y=q(x). Solution This is solved by finding an integrating factor (IF). We look for I(x) such that: I(x)[dydx+p(x)y]=d[I(x)y]dx, Then, we have d[I(x)y]dx=I(x)q(x),d[I(x)y]=q(x)I(x)dx+c1,y(x)=1I(x)[q(x)I(x)dx+c1].

Integrating factors must fulfil: d(Iy)dx=Idydx+Ipy,Idydx+ydIdx=Idydx+Ipy,dII=p(x)dx+c. So we have: I(x)=Aep(x)dx, where A is a new arbitrary constant (of integration).

So, we have the following for the general solution: y(x)=ep(x)dx[ep(x)dxq(x)dx+c], where c=c1/A is a new arbitrary constant of integration.

4.1.3 Dimensionally Homogeneous

The dimensionally homogeneous have the following general form: dydx=F(yx). Solution Let u=y/x we obtain: dydx=u+xdudx The ODE in terms of u(x), which is separabale is u+xdudx=F(u), Finding general solution uGS(x) for this ODE then we find the general solution for the original ODE as yGS(x)=uGS(x)x.

4.1.4 Bernoulli ODEs

There are other examples of transformations can turn specific ODEs into separable or linear. Some such as Bernoulli are classic: dydx+p(x)y=q(x)yn, where nR.

Solution We use the change of variable u=y1n. We obtain: dudx=(1n)yndydx. Writing the original ODE in terms of u we have: dudx+(1n)p(x)u=(1n)q(x), which is a linear ODE for u(x), so we obtain uGS(x) and then we have yGS=u11nGS.

4.2 Second Order ODEs

The general implicit form is: G(x,y,dydx,d2ydx2)=0, and the general explicit form is: d2ydx2=F(x,y,dydx).

The second order ODEs are common in Mechanics as Newton’s second law is such ODE with independent variable as time t. They are difficult to solve for general F but there are some special cases that can be solved as described in the following. Also, the linear case is discussed in the next chapter in detail.

4.2.1 F only depends on x

d2ydx2=F(x) Solution Let u=dydx then we have dudx=F(x). A first integration gives us: u=F(x)dx+c1 A second integration then gives us yGS: yGS=[F(x)dx]dx+c1x+c2.

4.2.2 F only depends on x and dydx

d2ydx2=F(x,dydx) Solution Let u=dydx then we have dudx=F(x,u), which is a first order ODE. If we could obtain the general solution uGS(x;c1) then we have: yGS(x)=uGS(x;c1)dx+c2.

4.2.3 F only depends on y

d2ydx2=F(y)

Solution We let u=dydx then dudx=F(y). Then we have: dudx=dudydydx=ududy=ddy(12u2)=F(y), which is a first order separable ODE for u(y). We have: 12u2=F(y)dy+c1=G(y)+c1. So we have: dydx=u=±2G(y)+2c1, which is a first order separable ODE for y(x) and can be integrated to obtain yGS(x;c1,c2) as seen in the following example.

Example 4.1 (Mechanics Harmonic Oscillator) Hooke’s law states if x(t) is displacement relative to an ideal spring relaxed position, the spring force is: F=kx Using second Newton Law we have: ma=Fmd2xdt2=kx

Let velocity to be u=dxdt, then we have: a=dudt=ddx[12u2]=kxm. Integrating both sides we obtain: u22=k2mx2+c1. This equation gives us a constant of motion (E=c1m), which is known as total energy, the sum of kinetic energy (1/2mu2) and potential energy (1/2kx2).

u=dxdt=±2Ekx2mdx±2Ekx2m=dt

Sticking with the postive sign on the LHS we have: 12E/mdx1k2Ex2=mksin1(k2Ex)=t+c2 Rearranging the solution we obtain: xGS=Asin(ωt+ϕ), where, ω=k/m is the frequency of oscillations and A=2E/k and ϕ=k/mc2 are new constants of integration. We note that, if we had chosen to use the minus sign above, we would have obtained the same family of solutions but the constants of integrations would be differently defined.

4.2.4 F only depends on y and dydx

d2ydx2=F(y,dydx)

let u=dydxdudx=F(y,u). So we have dudx=dudydydx=ududy=ddy(12u2). Therefore we have the following first order ODE for u(y) to solve ddy(12u2)=F(y,u). Given uGS(y;c1) being a general solution for the above ODE, we have the following first order ODE for y(x): dydx=uGS(y;c1).