Skip to main content

BVP: y'' + 3y' = y + x²

Short answer

Applying central differences with h=0.5 to y''+3y'= y+x^2 yields the system y_{i-1}-9y_i+7y_{i+1}=x_i^2, with boundary y0=2, y4=5. Solving gives y(0.5)≈2.7716, y(1)≈3.3134, y(1.5)≈4.0070.

Solve the BVP: y'' + 3y' = y + x², y(0) = 2, y(2) = 5 at x = 0.5, 1, 1.5 using finite difference method.

Write y'' = −3y' + y + x² and use central differences y''ᵢ = (yᵢ₋₁ − 2yᵢ + yᵢ₊₁)/h², y'ᵢ = (yᵢ₊₁ − yᵢ₋₁)/(2h).

Set up

The required points x = 0.5, 1, 1.5 on [0, 2] give h = 0.5; nodes x₀ = 0, x₁ = 0.5, x₂ = 1, x₃ = 1.5, x₄ = 2, with y₀ = 2, y₄ = 5.

(yᵢ₋₁ − 2yᵢ + yᵢ₊₁)/0.25 + 3(yᵢ₊₁ − yᵢ₋₁)/1 − yᵢ = xᵢ²
(4 − 3)yᵢ₋₁ + (−8 − 1)yᵢ + (4 + 3)yᵢ₊₁ = xᵢ²
   yᵢ₋₁ − 9yᵢ + 7yᵢ₊₁ = xᵢ²

Equations

i=1 (x=0.5):  2 − 9y₁ + 7y₂ = 0.25   →  −9y₁ + 7y₂         = −1.7500
i=2 (x=1.0):  y₁ − 9y₂ + 7y₃ = 1.00  →   y₁ − 9y₂ + 7y₃    =  1.0000
i=3 (x=1.5):  y₂ − 9y₃ + 7(5) = 2.25 →   y₂ − 9y₃          = −32.7500

Solution (Gaussian elimination)

y₁ = y(0.5) = 2.7716
y₂ = y(1.0) = 3.3134
y₃ = y(1.5) = 4.0070

Answer: y(0.5) ≈ 2.7716, y(1) ≈ 3.3134, y(1.5) ≈ 4.0070

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 6 questions →