VOOZH about

URL: https://www.geeksforgeeks.org/maths/eulers-method-practice-problems/

⇱ Eulers Method Practice Problems - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Eulers Method Practice Problems

Last Updated : 23 Jul, 2025

Euler method is a numerical technique used to approximate solutions to ordinary differential equations (ODEs). It is particularly useful when exact solutions are difficult or impossible to find. The method is named after the Swiss mathematician Leonhard Euler, who developed it in the 18th century.

In this article, we will understand what Euler's method is, and solve problems related to it.

What is Euler's Method?

The Euler method is a fundamental numerical technique used for approximating solutions to ordinary differential equations (ODEs). It is one of the simplest and oldest methods for solving initial value problems where an exact analytical solution might be difficult or impossible.

The Euler method provides an iterative process to approximate the solution of a first-order ODE of the form:

with an initial condition y(t0) = y0.

Example of Euler method

Consider the differential equation:

with the initial condition:

y(0)=1

We want to approximate the solution at t=0.2 using the Euler method with a step size h=0.1.

Important formulas

yn+1​ = yn​+h⋅f(tn​,yn​)

where:

  • yn+1is the approximated value of y at tn+1​,
  • yn​ is the value of y at tnt_ntn​,
  • h is the step size,
  • is the derivative evaluated at .

Step Size: The step size h determines the increment in ttt for each step and is typically chosen based on desired accuracy and stability.

For a system of ODEs, such as:

The Euler method is applied to each equation individually:

Euler's

General Steps

The general steps include:

  1. Initialisation: Set t0, y0​, and choose a step size h.
  2. Iteration: For each step n from 0 to N−1 (where tN=t0+N⋅h)

3. Error Analysis: Note that the Euler method introduces truncation errors, and its accuracy depends on the step size hhh. Smaller hhh generally results in more accurate results but requires more computations.

Eulers Method: Practice Problems with solutions

P1. ODE:

Initial Condition: y(0)=0.5

Step Size (h): 0.2

Solution:

Calculate the value at t=0.2:

Where . For t0=0 and y0=0.5:

f(0,0.5)=0.5−02+1=1.5

So,

Thus,.

Calculate the value at t=0.4:

For t1​=0.2 and y1=0.8:

f(0.2,0.8)=0.8−0.22+1=0.8−0.04+1=1.76

Thus, .

P2. ODE:

Initial Condition: y(0)=1

Step Size (h): 0.1

Solution:

Calculate the value at t=0.1:

For t0=0 and y0=1:

Thus, .

Calculate the value at t=0.2:

For t1=0.1 and y1=1:

Thus, .

P3.ODE:

Initial Condition: y(1)=2

Step Size (h): 0.5

Solution:

Calculate the value at t=1.5:

For t0=1 and y0=2:

f(1,2)=1−2=−1

Thus, .

Calculate the value at t=2.0:

For t1=1.5 and y1=1.5:

f(1.5, 1.5) = 1.5 - 1.5 = 0

Thus,.

P4. ODE:

Initial Condition: y(0)=0

Step Size (h): 0.2

Solution:

Calculate the value at t=0.2:

For t0=0 and y0=0:

f(0, 0) = e0 - 0 = 1

Thus, .

Calculate the value at t=0.4:

For t1=0.2 and y1=0.2:

Thus, .

P5. ODE:

Initial Condition: y(0)=1

Step Size (h): 0.1

Solution:

Calculate the value at t=0.1:

For t0=0 and y0=1:

Thus, .

Calculate the value at t=0.2:

For t1=0.1 and y1=0.9:

f(0.1, 0.9) = 0.12 - 0.92 = 0.01 - 0.81 = -0.8

Thus, .

P6. ODE: \frac{dy}{dt} = 2t - y

Initial Condition: y(0)=1

Step Size (h): 0.1

Solution:

Calculate the value at t=0.1:

For t0=0 and y0=1:

Thus, .

Calculate the value at t=0.2:

For t1=0.1 and y1=0.9:

Thus, .

P7. ODE:

Initial Condition: y(0)=2

Step Size (h): 0.2

Solution:

Calculate the value at t=0.2:

For t0=0 and y0=2:

Thus, .

Calculate the value at t=0.4:

For t1=0.2 and y1=0.8:

Thus, .

P8. ODE:

Initial Condition: y(1)=0

Step Size (h): 0.5

Solution:

Calculate the value at t=1.5:

For t0=1 and y0=0:

f(1, 0) = 12 + 0 = 1

Thus, .

Calculate the value at t=2.0:

For t1=1.5 and y1=0.5:

f(1.5, 0.5) = 1.52 + 0.5 = 2.25 + 0.5 = 2.75

Thus, .

P9. ODE:

Initial Condition: y(0)=0

Step Size (h): 0.1

Solution:

Calculate the value at t=0.1:

For t0=0 and y0=0:

f(0,0)=cos⁡(0)−0=1

Thus,.

Calculate the value at t=0.2:

For t1=0.1 and y1=0.1:

Thus, .

P10. ODE: \frac{dy}{dt} = -y^2 + t

Initial Condition: y(0)=2

Step Size (h): 0.3

Solution:

Calculate the value at t=0.3t = 0.3t=0.3:

For t0=0 and y0=2:

f(0, 2) = -22 + 0 = -4

Thus, .

Calculate the value at t=0.6:

For t1=0.3 and y1=0.8:

f(0.3, 0.8) = -0.82 + 0.3 = -0.64 + 0.3 = -0.34

Read More,

Eulers Method Practice Questions

Q1. Use the Euler method with a step size of h=0.1 to approximate the solution of the initial value problem , y(0)=1 at t=0.2.

Q2. Use the Euler method to approximate the solution of with initial conditions y(0)=1 and at t=0.1, using h=0.01.

Q3. Approximate the solution of , y(0)=1 at t=0.1 using the Euler method with h=0.05.

Q4. Use the Euler method to solve the system:

with initial conditions x(0)=1, y(0)=0, and h=0.1 at t=0.2.

Q5. Approximate the solution of , y(0)=0 at t=0.2 using h=0.1.

Q6. ODE:

Initial Condition: y(0)=1

Step Size (h): 0.1

Q7. ODE:

Initial Condition: y(0)=1

Step Size (h): 0.1

Q8. ODE:

Initial Condition: y(0)=2

Step Size (h): 0.3

Q9. ODE:

Initial Condition: y(0)=0

Step Size (h): 0.01

Q10. ODE:

Initial Condition: y(0)=2

Step Size (h): 0.3

Comment

Explore