Nonhomogeneous ODE Solver Calculator

Study driven equations with dependable numeric output. Track roots, forcing response, initial values, and stability. Visualize trajectories and export polished summaries for review later.

Computed solution summary

Results appear here after solving the selected differential equation.

Solver note: Numerical details will appear here.

Sampled output table

Showing evenly spaced preview rows. CSV includes every computed point.
x y(x) y′(x) f(x)

Enter equation data

Solve linear second-order nonhomogeneous ODEs with constant coefficients and chosen forcing functions.

Equation form: a y'' + b y' + c y = f(x)
Controls the first-derivative term.
Controls the response stiffness.
Choose a preset or define f(x) directly.
Used when f(x)=F.
Constant term of c0 + c1x + c2x².
Linear coefficient.
Quadratic coefficient.
Scaling factor applied to the forcing term.
Used inside e^(λx).
Frequency in radians per unit x.
Phase shift in radians.
Use math syntax like 2*exp(-x)*sin(3*x).
Initial conditions are applied at x0.
The chart and output run through this point.
Smaller values improve accuracy and increase table size.
Starting displacement.
Starting derivative at x0.
A highlighted point for summary output.

Example data table

Example setup: y″ + 2y′ + 5y = 3sin(2x) y(0)=1 y′(0)=0 x from 0 to 5 h = 0.01

x y(x) y′(x) f(x)
0.0000001.0000000.0000000.000000
1.0000000.419346-0.1766922.727892
2.0000000.107652-0.849178-2.270407
3.000000-0.654938-0.015585-0.838246
4.0000000.2850111.2722472.968075
5.0000000.484158-1.047192-1.632063

Formula used

This calculator solves the linear nonhomogeneous differential equation a y″ + b y′ + c y = f(x), where a ≠ 0.

The associated homogeneous equation uses the characteristic polynomial a r² + b r + c = 0. Its roots determine whether the natural response has distinct real roots, a repeated real root, or complex conjugate roots.

For numerical solving, the equation is rewritten as a first-order system: y′ = v and v′ = (f(x) - b v - c y) / a.

The solution is advanced using the classical fourth-order Runge-Kutta method. For each step, four slope estimates are computed and combined: Y(n+1) = Y(n) + (h/6)(k1 + 2k2 + 2k3 + k4). This gives stable, high-accuracy output for well-chosen step sizes.

Supported forcing models include constant, polynomial, exponential, sine, cosine, exponential-sine, exponential-cosine, and custom expressions entered in math syntax.

How to use this calculator

1. Enter the coefficients a, b, and c for your ODE.

2. Choose a forcing model, then fill in its parameters or enter a custom expression for f(x).

3. Set the initial point x0, final point x1, step size h, and evaluation point xe.

4. Enter the initial conditions y(x0) and y′(x0).

5. Press Solve equation to generate the roots, numerical solution, graph, and preview table.

6. Use the CSV button for complete point-by-point export and the PDF button for a report-style summary.

7. If your graph looks rough or unstable, reduce the step size and solve again.

FAQs

1) What equation types does this calculator handle?

It handles linear second-order nonhomogeneous equations with constant coefficients, written as ay″ + by′ + cy = f(x). The forcing term can be preset or entered as a custom expression.

2) Does it return symbolic closed-form solutions?

It reports the characteristic roots analytically, then computes the full response numerically with fourth-order Runge-Kutta. That approach stays flexible for many forcing functions and custom inputs.

3) Which forcing functions are available?

You can use constant, polynomial, exponential, sine, cosine, exponential-sine, exponential-cosine, or a custom expression such as 2*exp(-x)*sin(3*x).

4) How are initial conditions applied?

The solver starts at x0 using your entered values for y(x0) and y′(x0). Every later point is generated from those starting conditions and the selected forcing term.

5) What step size should I choose?

Begin with a moderate step such as 0.05 or 0.01. Use a smaller step when the forcing oscillates rapidly, coefficients are large, or you want smoother graphs and more accurate exported tables.

6) Why can the solution grow very fast?

Fast growth can come from unstable characteristic roots, strong forcing, or a large positive exponential driver. A step size that is too large can also distort the computed response.

7) What do the export buttons include?

CSV export contains the full computed dataset for x, y(x), y′(x), and f(x). PDF export creates a compact report with model details, summary metrics, and a preview data table.

8) How should I read the graph?

The chart plots y(x) and y′(x) against x on the main axis. The forcing term f(x) appears on a secondary axis so you can compare the driver and response clearly.

Related Calculators

ode system solverrlc circuit solversensitivity analysis solverelectrical circuit solvereuler method solverrl circuit solverlinearization solvergauss seidel method solvercauchy euler solverlinear system ode 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.