linear differential equations calculator

First-Order Linear Differential Equation Solver

Solve equations of the form y' + P·y = Q (constant coefficients), apply an initial condition, and evaluate y(x) at any point.

What this linear differential equations calculator does

This calculator is designed for a common class of ordinary differential equations (ODEs): first-order linear equations with constant coefficients: y' + P y = Q. You enter the equation parameters, one initial condition, and the target x-value. The tool returns:

  • The general solution
  • The particular solution that satisfies your initial condition
  • The numerical value y(x) at your requested point
  • A concise step-by-step method

Equation form and method

For linear ODE solving, the integrating factor approach is standard:

For y' + P y = Q, integrating factor is μ(x) = eP x.
Then (μy)' = Qμ, so after integrating: y(x) = C e-P x + Q/P (when P ≠ 0).

If P = 0, the equation simplifies to y' = Q, and the solution is simply linear: y(x) = Qx + C.

How to use the calculator

Step 1: Enter coefficients

Put your constants in the exact equation format y' + P·y = Q. Example: if your equation is y' + 2y = 8, enter P = 2 and Q = 8.

Step 2: Enter initial condition

Add x₀ and y(x₀). This uniquely determines C, turning the general solution into a particular solution.

Step 3: Enter evaluation point

Choose x where you want the output value. The calculator computes y(x) numerically.

Worked example

Suppose you need to solve: y' + 2y = 8, with y(0)=3, and evaluate at x=1.

  • Steady-state term: Q/P = 8/2 = 4
  • Particular from initial condition: y(x) = 4 + (3−4)e−2(x−0)
  • So y(1) = 4 − e−2 ≈ 3.864665

Use the “Load Example” button in the calculator to auto-fill these values.

When this ODE solver is appropriate

Use this tool when your equation is:

  • First order
  • Linear in y
  • Constant-coefficient form y' + P y = Q

For variable-coefficient equations, systems of differential equations, nonlinear ODEs, or second-order models, you’ll need a more advanced differential equations calculator.

Common mistakes to avoid

  • Entering coefficients from an equation not rearranged into y' + P y = Q
  • Forgetting the initial condition (x₀, y₀)
  • Mixing units for x and coefficients, which can make exponentials misleading
  • Assuming every linear differential equation has constant coefficients

Final note

A linear differential equations calculator is most useful when it also explains the method. This one gives both the value and the reasoning, making it useful for homework checks, quick modeling, and exam prep in differential equations.

🔗 Related Calculators