← Math & statistics

First-order ODE solver (separable + linear)

Solve separable and linear first-order ODEs in one workspace. Compare slope fields and solution curves, then verify with integrating-factor steps, Simpson integrals, numeric inversion, and RK4 checks.

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Español (LatAm) | Español (México) | Português (Brasil) | Português (Portugal) | Bahasa Indonesia | Tiếng Việt | 한국어 | Français | Deutsch | Italiano | Русский | हिन्दी | العربية | বাংলা | اردو | Türkçe | ไทย | Polski | Filipino | Bahasa Melayu | فارسی | Nederlands | Українська | עברית | Čeština

Inputs

Initial condition (x0, y0)
Window [x_min, x_max, y_min, y_max]
Field grid (Nx×Ny)
×
Curve samples

First-order ODEs

We show Simpson integrals, integrating factor, numeric inversion, RK4 error, CSV, and shareable URLs.

Tip: click the canvas to add an initial condition at that point.

Results

How it’s calculated

    Teacher notes

    How to use this calculator effectively

    Choose the equation form first. Use the separable mode for equations that can be written as y' = f(x)g(y), and use the linear mode for equations in the form y' + P(x)y = Q(x). Then set the initial condition and plotting window before you compare the analytic curve with the direction field.

    How it works

    The page parses your functions, computes the solution with the method that matches the selected mode, and then cross-checks the plotted curve against an RK4 reference. The result card, step log, and field plot all come from the same solved state.

    When to use

    Use it for first-pass ODE homework checks, lecture demonstrations, and intuition building around initial value problems. It works especially well when you want to connect the symbolic setup to the shape of the solution curve.

    Common mistakes to avoid

    Interpretation and worked example

    Try y' = xy with y(0)=1 in separable mode, then compare it with a simple linear example such as y' + y = 0. The contrast helps you see when the integrating-factor workflow applies and when numerical inversion is the key step.

    See also

    FAQ

    How is the direction field rendered?

    We evaluate the slope on a uniform grid of x and y, clip extreme gradients, and draw short segments so the field stays legible. RK4 runs on the same field to verify the main solution curve.

    How do you stabilise the numeric inversion?

    For separable equations we scan [y_min, y_max] for a sign change and refine with bisection. Linear equations rely on the integrating factor, and we expose the RK4 discrepancy to monitor the residual error.

    What should I check first after I enter an equation?

    Confirm the mode and the initial condition first, then make sure the plotted window is wide enough to show the part of the solution you care about.

    What should I compare when the RK4 check drifts?

    Compare the selected mode, the typed functions, and the plot window first. A larger drift usually means the interval is too wide, the equation is close to a singularity, or the numeric inversion range needs tightening.

    Why does the plotted curve stop or bend sharply?

    That usually means the solution left the visible window, crossed a singularity, or hit a region where the chosen model is no longer stable. Inspect the initial condition, then narrow the x and y ranges before changing the equation.

    How to read the first-order ODE output

    What this calculator does

    The page solves either a separable or a linear first-order initial value problem, then plots the direction field and overlays the computed solution curve. Use it to connect the symbolic setup to the local slope behaviour of the field.

    Input meaning and window choice

    The equation fields define the model, the initial condition picks the specific solution, and the plot window determines what part of the phase plane you can inspect. If the curve appears clipped or flat, widen the x/y bounds before you change the equation itself.

    How to compare analytic and numeric results

    The main curve uses the selected analytic workflow, while RK4 acts as a numeric cross-check on the same interval. A small discrepancy means the solution and the plotting window are coherent; a large discrepancy usually means the problem is stiff, near-singular, or outside a stable window.

    Common mistakes to avoid

    Do not use separable mode for an equation that only fits the linear form, and do not ignore the initial condition when reading the graph. If the curve looks wrong, first verify the typed expression, then inspect the field window, and only after that compare against another tool.

    Interpretation guidance

    Read the result card together with the field plot: the card tells you the solved form and RK4 error, while the field tells you whether nearby trajectories agree with the same trend. That combination is more informative than checking a single plotted curve in isolation.