---
title: "BVP: xy'' + y = 0"
subject: "Numerical Method"
chapter: 6
key: "semester_4/numerical_method:bvp-fd-xy-double-prime"
source: https://www.bctengineer.com/q/semester_4/numerical_method/bvp-fd-xy-double-prime
site: BCT Engineering
---

# BVP: xy'' + y = 0

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2071 Bhadra, 6 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/bvp-fd-xy-double-prime
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-6

## Question

Using the finite difference method, find y(0.25), y(0.5) and y(0.75) satisfying the differential equation xy'' + y = 0, subject to the boundary conditions y(0) = 1, y(1) = 2.

## Short answer

Apply central difference with h=0.25 to xy''+ y=0: x_i (y_{i-1}-2y_i+y_{i+1})/0.0625 + y_i=0. With y0=1, y4=2, solving yields y(0.25)≈1.7517, y(0.5)≈2.0655, y(0.75)≈2.1212.

## Answer

Use the central difference y''ᵢ = (yᵢ₋₁ − 2yᵢ + yᵢ₊₁)/h² in x·y'' + y = 0.

#### Set up
Nodes x₀ = 0, x₁ = 0.25, x₂ = 0.5, x₃ = 0.75, x₄ = 1 (h = 0.25), y₀ = 1, y₄ = 2. Unknowns y₁, y₂, y₃. At node i:

```text
xᵢ(yᵢ₋₁ − 2yᵢ + yᵢ₊₁)/h² + yᵢ = 0
Multiply by h² = 0.0625:  xᵢ·yᵢ₋₁ + (h² − 2xᵢ)·yᵢ + xᵢ·yᵢ₊₁ = 0
```

#### Equations
```text
i=1 (x=0.25): 0.25(1) − 0.4375y₁ + 0.25y₂ = 0   →  −0.4375y₁ + 0.25y₂              = −0.25
i=2 (x=0.50): 0.50y₁ − 0.9375y₂ + 0.50y₃ = 0     →   0.5y₁ − 0.9375y₂ + 0.5y₃       =  0
i=3 (x=0.75): 0.75y₂ − 1.4375y₃ + 0.75(2) = 0    →   0.75y₂ − 1.4375y₃              = −1.5
```
#### Solution (Gaussian elimination)
```text
y₁ = y(0.25) = 1.7517
y₂ = y(0.50) = 2.0655
y₃ = y(0.75) = 2.1212
```
**Answer: y(0.25) ≈ 1.7517, y(0.5) ≈ 2.0655, y(0.75) ≈ 2.1212**

## Check yourself

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

1. Which approximation replaces y'' at node i?
   A. (y(i-1) - 2y(i) + y(i+1))/h^2
   B. (y(i+1) - y(i))/h
   C. (y(i+1) - y(i-1))/(2h)
   D. (y(i-1) + 2y(i) + y(i+1))/h^2
   Answer: A. The central second-difference formula turns the ODE into algebraic equations. (Key point: Central difference)

2. With h = 0.25 on [0,1], how many unknowns are solved for?
   A. 5
   B. 3 (y1, y2, y3), since y0 and y4 are given
   C. 4
   D. 2
   Answer: B. Nodes 0 to 4 give five values, but the two boundary values are known. (Key point: Number of unknowns)

3. What is the equation at node 2 (x = 0.5)?
   A. 0.25y1 - 0.4375y2 + 0.25y3 = 0
   B. 0.75y1 - 1.4375y2 + 0.75y3 = 0
   C. 0.5y1 - 0.9375y2 + 0.5y3 = 0
   D. 0.5y1 - 1.5y2 + 0.5y3 = 0
   Answer: C. x y'' + y = 0 gives xi y(i-1) + (h^2 - 2xi) yi + xi y(i+1) = 0; with x = 0.5, h^2 = 0.0625: 0.0625 - 1 = -0.9375. (Key point: Node equation)

4. How are the three equations solved?
   A. By RK-4 starting at x = 0
   B. By guessing y'(0) and shooting
   C. By Newton's divided differences
   D. As a linear system, e.g. by Gaussian elimination
   Answer: D. The finite-difference method yields linear simultaneous equations in the unknowns. (Key point: Solving)

## Related in Numerical Method

- [BVP: y'' + 3y' = y + x²](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Abvp-fd-y-double-prime-3y) — Numerical Method, chapter 6
- [BVP: y'' = e^x + 2y' - y](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Abvp-finite-difference-e-x-2y) — Numerical Method, chapter 6, asked 4×
- [BVP: y'' = x + y](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Abvp-finite-difference-x-plus-y) — Numerical Method, chapter 6, asked 4×
- [RK-2: y' = xy + y²](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-xy-y2) — Numerical Method, chapter 6, asked 2×
- [Elliptic: 0≤x,y≤3 boundary](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Alaplace-uxx-0-3-boundary) — Numerical Method, chapter 7
- [Laplace: 2x2 grid 100/200/50](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Alaplace-100-200-50-grid) — Numerical Method, chapter 7, asked 2×

## Related in other subjects

- [Essential and natural boundary conditions](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Aessential-natural-boundary-conditions) — Finite Element Method, chapter 2
- [2D groundwater FD scheme, boundary conditions](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Agw-2d-fd-boundary-flow-coefficients) — Computational Techniques in Civil Engineering, chapter 7
- [Differential equation of the elastic curve](https://www.bctengineer.com/question.md?key=semester_4%2Fstrength_of_materials_mechanical%3Abeam-deflection-differential-equation) — Strength of Materials, chapter 7
- [Finite difference nodal temperatures in a square plate](https://www.bctengineer.com/question.md?key=semester_5%2Fheat_transfer%3Atwo-dimensional-conduction-nodal-temperatures) — Heat Transfer, chapter 2
