First Order Differential Equation: Numerical Solution
Solves y′ = f(x,y) with an initial value using fourth order integration and compares two step counts.
Solving from an initial value
Supply an equation y′=f(x,y) and an initial condition y(x₀)=y₀. The tool integrates to the target point using a method of order four. Every step samples the slope at its start, twice at its midpoint and once at its end.
Example
For y′=2x with y(0)=1, direct integration gives y=x²+1. The result at x=2 is 5. Known analytical solutions are useful checks on a numerical calculation.
Choosing a step count
The calculation runs with the entered step count and again with twice that count. The main result uses the finer grid. Their difference is shown but is not a rigorous error bound. Stiff equations and singularities need other methods. Systems and boundary value problems are outside the scope of this tool.
Equation and step size
Enter only the right side of the equation. For y′=x, enter x. The initial condition is the value of y at the starting point, not its slope. A target before the initial point produces a negative step, indicating backward integration. Keep the units of the variables consistent in your model.
For example, solve y′=x with y(0)=2 up to x=2. Integration gives y=x²/2+2, so the target value is 4. Selecting 2 coarse steps gives step size 1. In the first step the slopes are 0, 0.5, 0.5 and 1. The weighted increment is (0+2×0.5+2×0.5+1)/6 = 0.5, giving y=2.5. The second step ends at 4. The main result uses 4 steps of size 0.5.
Agreement between the two grids in this example does not promise the same performance for every equation. Increase the step count and compare again. A smaller numerical step cannot remove uncertainty in initial conditions or coefficients. Inspect abrupt changes and undefined points in the interval separately. A finite output is not proof that a solution exists throughout the interval.
Related calculators
-
Mathematics
Integral Calculator
Compute definite integrals numerically with an error estimate and find antiderivatives symbolically. Every antiderivative is checked by differentiation. -
Mathematics
Derivative Calculator
Type a function and see its derivative step by step: sum, product, quotient and chain rules, a simplified result, the value at a point and a graph. -
Mathematics
Absolute Value and Piecewise Function Calculator
Solves absolute value equations and inequalities step by step, evaluates expressions, writes them piecewise and evaluates piecewise functions. -
Mathematics
Algebraic Expression Simplifier
Simplifies an algebraic expression step by step: expands brackets, combines like terms, cancels common factors in rational expressions and evaluates at given values. -
Mathematics
Arithmetic and Geometric Sequence Calculator
The nth term, the sum of the first n terms, the infinite sum, finding a sequence from two terms and the position of a term. Exact fractions, step by step. -
Mathematics
Combination, Permutation and Factorial Calculator
n!, P(n, r), C(n, r), permutations of repeated items, combinations with repetition and circular permutations. Exact to the last digit, with the expansion shown.
Found a mistake or something missing?
If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.