---
title: "Euler: y' = x + y"
subject: "Numerical Method"
chapter: 6
key: "semester_4/numerical_method:euler-x-plus-y"
source: https://www.bctengineer.com/q/semester_4/numerical_method/euler-x-plus-y
site: BCT Engineering
---

# Euler: y' = x + y

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2071 Magh, 4 marks
- Video: [Euler Approximation for IVP y'=x+y](https://www.youtube.com/watch?v=Ddn7pLPLNIw) — Math Stats
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/euler-x-plus-y
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-6

## Question

Using Euler's method find y(0.2) from following equation y' = x + y, y(0) = 0, take h = 0.1.

## Short answer

Apply Euler's formula y_{n+1}=y_n+h(x_n+y_n) with h=0.1 from y(0)=0. Two steps give y(0.1)=0 and y(0.2)=0.0100. Thus y(0.2) is approximately 0.0100, underestimating the exact value 0.0214.

## Answer

Euler's formula: yₙ₊₁ = yₙ + h·f(xₙ, yₙ), with f(x, y) = x + y, x₀ = 0, y₀ = 0, h = 0.1.

```text
Step 1: y(0.1) = y₀ + h(x₀ + y₀) = 0 + 0.1(0 + 0)         = 0.0000
Step 2: y(0.2) = y₁ + h(x₁ + y₁) = 0 + 0.1(0.1 + 0)       = 0.0100
```
| n | xₙ | yₙ | f(xₙ,yₙ) | yₙ₊₁ = yₙ + 0.1·f |
|---|---|---|---|---|
| 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
| 1 | 0.1000 | 0.0000 | 0.1000 | 0.0100 |

**Answer: y(0.2) ≈ 0.0100**

The exact solution y = eˣ − x − 1 gives y(0.2) = 0.0214; Euler's method (first order) underestimates here because h is large.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is Euler's formula?
   A. y(n+1) = yn + h f(xn, yn)
   B. y(n+1) = yn + h f(x(n+1), y(n+1))
   C. y(n+1) = yn + h^2 f(xn, yn)
   D. y(n+1) = yn + (h/2)(f(xn,yn) + f(x(n+1),yn))
   Answer: A. Euler's method advances using the slope at the start of the interval. (Key point: Euler formula)

2. What is y(0.1) with y(0) = 0, f = x + y, h = 0.1?
   A. 0.1
   B. 0
   C. 0.01
   D. 0.005
   Answer: B. f(0,0) = 0, so y1 = 0 + 0.1(0) = 0. (Key point: First step)

3. What is y(0.2)?
   A. 0.02
   B. 0.0214
   C. 0.01
   D. 0.0
   Answer: C. y2 = 0 + 0.1(0.1 + 0) = 0.01. (Key point: Final result)

4. Why does the Euler result 0.01 differ from the exact 0.0214?
   A. The exact solution is wrong
   B. Euler's method is exact for linear f
   C. The initial condition was misread
   D. Euler is only first order and h is large, so it underestimates here
   Answer: D. Truncation error is O(h) per unit, noticeable for h = 0.1. (Key point: Accuracy)

## Related in Numerical Method

- [RK-2: y'' = y - x y'](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-y-double-prime-y-xy) — Numerical Method, chapter 6, asked 2×

## Related in other subjects

- [Deriving Bernoulli's equation from Euler's equation](https://www.bctengineer.com/question.md?key=semester_6%2Fhydro_power%3Aeuler-bernoulli-derivation) — Hydro Power, chapter 1
- [Derivation of Euler's turbine equation](https://www.bctengineer.com/question.md?key=semester_5%2Ffluid_machines%3Aeuler-turbine-equation-derivation) — Fluid Machines, chapter 1
- [Euler equation, Bernoulli and Pitot tube](https://www.bctengineer.com/question.md?key=semester_7%2Fapplied_computational_fluid_dynamics%3Aeuler-equation-pitot-numerical) — Applied Computational Fluid Dynamics, chapter 2
- [Euler work equation for turbomachines](https://www.bctengineer.com/question.md?key=semester_7%2Fturbo_machines%3Aeuler-turbine-equation-derivation) — Turbo Machines, chapter 2
