Linear ODE Solver Calculator

Enter coefficients, interval limits, steps, and initial conditions. Compare exact-style and numerical solution paths instantly. Download clean reports and inspect solution behavior visually today.

Enter ODE data

This calculator solves first-order linear equations in the standard form y' + P(x)y = Q(x) using an integrating-factor path and compares it with RK4 and Euler.

Examples: 2*x, x^2+1, sin(x), exp(-x)
Examples: sin(x), 3*x+2, exp(x), cosh(x)
Starting point of the interval
Initial condition value
Ending point of the interval
Use more steps for tighter numerical agreement

Example data table

Sample setup for quick testing before entering your own coefficients.

Case P(x) Q(x) x₀ y(x₀) x₁ Steps Purpose
Example A 2*x sin(x) 0 1 2 40 Smooth coefficient growth with oscillatory forcing
Example B 1 x+2 0 3 4 60 Constant damping with linear input
Example C cos(x) exp(-x) 0 0.5 3 80 Variable coefficient with decaying source

Formula used

Standard linear ODE:

y' + P(x)y = Q(x)

Integrating factor:

μ(x) = exp(∫P(x)dx)

Solution form:

y(x) = [ y(x₀) + ∫ from x₀ to x of μ(t)Q(t)dt ] / μ(x)

Slope function for numerical checks:

f(x, y) = Q(x) − P(x)y

RK4 update idea:

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₃), then yₙ₊₁ = yₙ + h(k₁+2k₂+2k₃+k₄)/6.

This page evaluates the integrating-factor route numerically across the interval, which is why the result is labeled exact-style instead of symbolic exact.

How to use this calculator

  1. Enter the coefficient function in P(x).
  2. Enter the forcing function in Q(x).
  3. Set the initial point x₀ and the initial value y(x₀).
  4. Enter the target point x₁ where you want the solution value.
  5. Choose a step count. Larger values usually improve comparison quality.
  6. Click Solve Linear ODE to generate the solution summary, graph, and full table.
  7. Use the CSV or PDF buttons to export your computed rows.
  8. Review the exact-style, RK4, and Euler traces together to judge stability and convergence.

FAQs

1) What kind of equation does this solver handle?

It handles first-order linear ordinary differential equations written as y' + P(x)y = Q(x). Enter P(x), Q(x), one initial condition, and an interval endpoint.

2) Why does the page show exact-style, RK4, and Euler values?

The exact-style path follows the integrating-factor formula numerically. RK4 is a strong numerical check, while Euler is a simple baseline. Seeing all three helps you judge reliability.

3) Can I use trigonometric or exponential functions?

Yes. Supported examples include sin(x), cos(x), tan(x), exp(x), log(x), sqrt(x), abs(x), sinh(x), cosh(x), tanh(x), pi, and e.

4) What if my result looks unstable?

Increase the number of steps first. Very large coefficients, steep growth, or long intervals can also make numerical behavior harder to track, especially for Euler.

5) Why is symbolic algebra not shown?

This version focuses on robust interval solving and comparison. It evaluates the integrating-factor formula numerically, which is practical for many coefficient functions entered directly by users.

6) Can I solve backward in x?

Yes. You may use a target x₁ that is smaller than x₀. The solver automatically uses a negative step size and computes the interval in reverse.

7) What does the integrating factor mean?

It is a multiplier that converts the left side into a product derivative. That transformation makes the linear equation easier to integrate across the interval.

8) What do the export buttons save?

The CSV and PDF exports save the computed table, including x, P(x), Q(x), integrating factor, exact-style solution, RK4, Euler, and the absolute difference column.

Related Calculators

ode system solverrlc circuit solversensitivity analysis solverforward euler solverelectrical circuit solvereuler method solverrl circuit solverlinearization solvernonhomogeneous ode solvergauss seidel method solver

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.