# Numerical Solution of Ordinary Differential Equations

Consider y(t) to be a function of a variable t. A first order Ordinary differential

equation is an equation relating y, t and its first order derivatives. The most general

form is : \(F(t,y(t),y^{/} (t))=0\)

The solution with arbitrary constant is known as the **general solution** of the differential equation. The solution obtained using the initial condition is a **particular solution**.

A first order** Initial Value Problem (IVP)** is defined as a first order differential equation together with specified initial condition at \(t=t_0:\)

\(y=f(t,y); t_0 \leq t \leq b \text{ with } y(t_0 )= y_0\)

Sometimes it is very difficult to obtain the closed form solution of differential equation. In such cases, the approximate solution of given differential equation can be obtained.

## Euler method

Let us consider a first order & first degree differential equation as \(\frac{dy}{dx}=f(x,y)\) with \(y(x_0 )=y_0\). Then the Euler method to find the solution of the ODE is \(y_{n+1}=y_n+hf(x_n,y_n )=y(x_{n+1} )\forall n=0,1,2,\dots\)

**Prob.(1)**: Given \(\frac{dy}{dx}=x^2+y^2\) with y(0)=1. Determine y(0.3) by Euler’s Method with step length h=0.01, correct up to 4 DP.

## Exercise

- State Euler’s formula to solve approximately \(\frac{dy}{dx}=f(x,y),y(x_0 )=y_0\). Hence find y(0.2) with step length h=0.1 for the initial value problem \(\frac{dy}{dx}=xy ; y(0)=1\)

[**C.H. 2013**] - Given \(\frac{dy}{dx}=x^2+y\) with y(0)=1. Determine y(0.02) by Euler’s Method with step length h=0.01, correct up to 4 significant figure.

[**C.H. 2012**] - Solve by Euler’s Method the following differential equation for x=1 by taking h=0.2, \(\frac{dy}{dx}=xy\), y=1 when x=0. Give result correct to four decimal places.

[**C.H. 2011**] - Solve \(\frac{dy}{dx}=1-y\) with y(0)=0, using Euler’s method. Find y at x=0.1 and x=0.2. Compare the approximate solution with exact solution.
- Given \(\frac{dy}{dx}+\frac{y}{x}=\frac{1}{x^2}\) with y(1)=1. Evaluate y(1.2) by Euler’s Method with step length h=0.1
- Solve by Euler’s method the following differential equation: \(\frac{dy}{dx}=xy\), y(0)=1 for x=1 with h=0.2

[**C.H. 2017**]

## Picard method

Let us consider a first order & first degree differential equation as \(\frac{dy}{dx}=f(x,y)\) with \(y(x_0 )=y_0\). Then the Picard’s method to find the solution of the ODE is \(y_n=y_0+ \int_{x_0}^{x} f(x,y_{n-1}) \, dx \forall n=1,2,3,\dots\)

**Prob.(2)**: Using Picard’s method of successive approximation, obtain a solution up to fourth approximation of differential equation \(\frac{dy}{dx}=x+y\) where y=1 when x=0

[**C.H. 2011**]

## Exercise

- Solve by Picard’s method \(\frac{dy}{dx}=xy+1\) with y(0)=1

[**C.H. 2006**] [**C.H. 2007**] - Solve by Picard’s method \(\frac{dy}{dx}=x-y\) with y(0)=2

[**C.H. 2009**] - Using Picard’s method of successive approximation, obtain a solution up to fourth approximation of differential equation \(\frac{dy}{dx}=x+y\) where y=1 when x=0

[**C.H. 2011**] - Solve by Picard’s method:\(\frac{dy}{dx}=x-y\) with y(0)=1 and show that the sequence of approximations tends to the exact solution as a limit.

[**C.H. 2008**] - Solve \(\frac{dy}{dx}=\frac{x}{1+y^2 }\) with the initial condition y(0)=0, by Picard’s method to obtain y(0.15); correct to two significant figures.

[**C.H. 2011**] - State Picard’s recursion formula in connection with the solution of a first order differential equation \(\frac{dy}{dx}=f(x,y)\text{ with } y_0=f(x_0)\).

Use Picard’s method to approximate y for x=0.2 correct to four decimal places for the differential equation \(\frac{dy}{dx}=x-y\), y(0)=1

[**C.H. 2014**] - (a) Use Picard’s method to compute y(0.1) for the IVP \(\frac{dy}{dx}=1+xy\) given y=1 when x=0 correct to 5 significant figures.

(b) Does a single step method for solving IVP always converge? Justify your answer.

[**C.H. 2017**] - Velocity of a body is equal to the reciprocal of the displacement and time. If the displacement measured from origin (y) at time (t)=0 initially is 1, find the displacement y(t=0.2) using Picard’s method.

[**C.H. 2018**] - Use Picard’s method to compute y for x=0.2, correct to 4 decimal places for the differential equation \(\frac{dy}{dx}=xy+x^2\) with end condition y(0)=0

[**C.H. 2019**]