Differential Equation Solver
Solve first-order differential equations step by step: linear, separable, Bernoulli, homogeneous and exact (or reducible to exact), with an optional initial condition and the slope field.
About the Differential Equation Solver
A linear equation dy/dx + P(x)y = Q(x) becomes easy after multiplying by the integrating factor IF = e^(∫P dx): the left side turns into d(y·IF)/dx, so y·IF = ∫Q·IF dx + C.
A separable equation dy/dx = f(x)g(y) is solved by putting the y's on one side and the x's on the other and integrating both. An initial condition y(x₀) = y₀ fixes C.
A homogeneous equation dy/dx = f(x, y), where f depends only on y/x, becomes separable with y = vx. A Bernoulli equation dy/dx + Py = Qyⁿ becomes linear with v = y^(1−n). M dx + N dy = 0 is exact when ∂M/∂y = ∂N/∂x; then its solution is φ(x, y) = C with ∂φ/∂x = M and ∂φ/∂y = N. If it isn't exact, an integrating factor e^(∫(M_y − N_x)/N dx) or e^(∫(N_x − M_y)/M dy) may make it exact.
The formula
IF = e^(∫P dx), y × IF = ∫ Q × IF dx + C
Worked example
dy/dx + y/x = x², y(1) = 1
- IF = e^(ln x) = x
- xy = ∫ x³ dx = x⁴/4 + C
- C = 3/4, so y = (x⁴/4 + 3/4)/x
Questions people ask
What does the slope field show?
A short dash at each point with the slope dy/dx there. Every solution curve runs along the dashes; the one drawn passes through the initial condition (traced numerically).
Why take x > 0?
e^(ln|x|) = |x|; textbooks take the region where x > 0 so the integrating factor is just x.
What's the difference between general and particular solutions?
The general solution has the constant C; an initial condition picks one curve, the particular solution.