Enter the Cauchy problem data
This solver handles the first-order linear form y′ = ax + by + c with the initial condition y(x₀) = y₀. It returns the exact answer, an RK4 approximation, error metrics, a graph, and a full step table.
Sample input set
| Field | Example Value | Meaning |
|---|---|---|
| a | 1 | x coefficient in y′ = ax + by + c |
| b | 1 | y coefficient in y′ = ax + by + c |
| c | 0 | Constant forcing term |
| x₀ | 0 | Initial x value |
| y₀ | 1 | Initial solution value |
| Target x | 1 | Evaluation point |
| Step size h | 0.25 | Numerical step for RK4 |
Mathematical method
Problem model
y′ = ax + by + c, y(x₀) = y₀
Exact linear solution when b ≠ 0
y(x) = [y₀ + (a/b)x₀ + (bc + a)/b²]e^(b(x − x₀)) − (a/b)x − (bc + a)/b²
Exact solution when b = 0
y(x) = y₀ + (a/2)(x² − x₀²) + c(x − x₀)
Runge–Kutta fourth-order update
k₁ = f(xₙ, yₙ)
k₂ = f(xₙ + h/2, yₙ + hk₁/2)
k₃ = f(xₙ + h/2, yₙ + hk₂/2)
k₄ = f(xₙ + h, yₙ + hk₃)
yₙ₊₁ = yₙ + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
Error metrics
|Error| = |y_exact − y_RK4|
MAE = average of absolute errors
RMSE = sqrt(average of squared errors)
Usage steps
- Enter the coefficients a, b, and c for the linear differential equation.
- Provide the initial condition by setting x₀ and y₀.
- Enter the target point x where you want the solution value.
- Choose a positive step size h for the RK4 approximation and the table density.
- Press Solve Cauchy Problem to generate the exact answer, RK4 estimate, graph, and data table.
- Use the CSV or PDF buttons to export the computed solution path.
Frequently asked questions
1) What does this calculator solve?
It solves first-order linear Cauchy problems of the form y′ = ax + by + c with an initial condition y(x₀) = y₀. It reports both exact and RK4 numerical results.
2) Why are there two solution values?
The exact value comes from the closed-form linear solution. The RK4 value comes from numerical stepping. Comparing them helps you judge the numerical accuracy of your chosen step size.
3) What is RK4?
RK4 is a fourth-order Runge–Kutta method. It samples the slope four times per step and combines them to produce a much more accurate update than simple Euler stepping.
4) How should I choose the step size h?
Start with a moderate positive step, then reduce it if the RK4 and exact answers differ more than you want. Smaller steps usually improve accuracy but increase table length.
5) What happens if b equals zero?
The problem becomes y′ = ax + c. The exact solution simplifies to a direct polynomial expression, and the calculator automatically switches to that special-case formula.
6) Can this page solve nonlinear Cauchy problems?
No. This implementation is intentionally scoped to the linear family y′ = ax + by + c. Nonlinear Cauchy problems need a different symbolic or numerical framework.
7) Why does the error vary along the interval?
Numerical error accumulates over marching steps. The size and direction of that accumulation depend on the step size, the growth or decay term b, and the forcing structure.
8) Do the inputs need specific units?
Any consistent unit system works. Just keep x, y, and the coefficients aligned so the differential equation is dimensionally meaningful from start to finish.