First-Order ODE Solver
Visualize Slope Fields and Calculate Particular Solutions for Separable, Exact, and Linear differential equations.
Equation Input
Use standard notation: x^2, sin(x), exp(x).
Quick Check
Separable?
Can you write it as $N(y)dy = M(x)dx$?
Linear?
Is it in the form $y’ + P(x)y = Q(x)$?
Exact?
Is $M dx + N dy = 0$ where $\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}$?
Slope Field Visualization
Click anywhere on the graph to set a new Initial Condition $(x_0, y_0)$.
Understanding First-Order ODEs
A First-Order ODE Solver helps students understand how differential equations describe rates of change. Geometrically, the equation $y’ = f(x, y)$ assigns a specific slope to every point $(x, y)$ in the plane. The Slope Field (or Direction Field) visualizes these slopes with short line segments. A particular solution is a curve that follows these “flow lines” tangent to the slopes at every point.
1. Separable Equations
A differential equation is Separable if it can be factored into a function of solely $x$ and a function of solely $y$: $$ \frac{dy}{dx} = g(x)h(y) \implies \frac{1}{h(y)} dy = g(x) dx $$ We solve these by integrating both sides independently. This is often the first technique taught in undergraduate calculus.
2. Linear Equations
A Linear First-Order ODE fits the standard form: $$ \frac{dy}{dx} + P(x)y = Q(x) $$ To solve this, we calculate an Integrating Factor, $\mu(x) = e^{\int P(x)dx}$. Multiplying the entire equation by $\mu(x)$ allows us to collapse the left side into the derivative of a product, making it integrable.
3. Exact Equations
An equation written as $M(x, y)dx + N(x, y)dy = 0$ is Exact if the partial derivatives satisfy the condition: $$ \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} $$ If exact, there exists a potential function $\Psi(x, y) = C$ whose total differential creates the ODE. We find $\Psi$ by integrating $M$ with respect to $x$ and $N$ with respect to $y$.
Frequently Asked Questions
How does the solver calculate the red curve?
This tool uses the Runge-Kutta 4th Order (RK4) method. It is a numerical technique that estimates the next point on the curve by taking a weighted average of four different slope estimates within a small step size, providing much higher accuracy than the simpler Euler’s Method.
Why do some curves stop abruptly?
If the solution curve goes off the visible graph range or hits a point where the slope becomes infinite (undefined), the numerical solver stops plotting to prevent errors. This often happens near vertical asymptotes.
Can I enter trigonometric functions?
Yes! The input supports standard math functions. Try entering sin(x) * cos(y) or exp(-x^2). Ensure you use explicit multiplication signs (e.g., x*y instead of xy) for clarity.