Home

Linear First-Order ODE

First-order linear ODE solver. Enter P(x), Q(x) and initial value to find the integrating factor and general/particular solution—with steps.

展开更多 ▾
y′ + P(x)y = Q(x), μ = e^∫P(x)dx
coefficient of y
right-hand side
initial x
initial y(x₀)
target point

📖 Tutorial|Linear First-Order ODE

1. Definition
A first-order equation of the form y′ + P(x)y = Q(x) is a linear first-order ODE. It is homogeneous when Q(x)=0.
2. Symbols
SymbolMeaning
P(x)coefficient of y
Q(x)right-hand side
μ(x)integrating factor e^∫P dx
Cconstant of integration
3. How this tool works
  • Integrating factor μ = e^∫P(x)dx;
  • Multiply by μ: the left side becomes (μy)′;
  • Integrate: μy = ∫μQ dx + C, then divide by μ;
  • This tool applies Euler to y′=Q−Py for a numerical value.
4. Steps
  1. Enter P(x) and Q(x);
  2. Enter initial value and target x₁;
  3. Click Calculate for the integrating factor form and numerical solution.
5. Example
Example: y′ + y = x, y(0)=0. μ=e^x, (e^x y)′=x e^x, integrate e^x y=(x−1)e^x+C; y(0)=0 gives C=1, y=x−1+e^(−x). Numerical y(1)≈0.3679.
6. Pitfalls
Put the equation in standard form y′+P(x)y=Q(x) first;
The integrating factor uses P, not Q;
The numerical answer is approximate; use the formula for an exact solution.

❓ FAQ|Linear First-Order ODE

How to find the integrating factor?
Compute μ = e^(∫P(x)dx): integrate the coefficient P(x) and exponentiate.
Homogeneous vs nonhomogeneous linear?
Homogeneous Q(x)=0 is separable; nonhomogeneous needs the integrating factor or variation of constants.
Why standard form first?
Only as y′+P(x)y=Q(x) can P and Q be identified correctly.
How accurate is Euler?
With 500 steps the error is usually small; for an exact answer, integrate by hand.
Which expressions are supported?
+ − * / ^ and sin cos tan sqrt exp log; variables x, y.