Differential Equations Solver
Solve first and second order ordinary differential equations with step-by-step work. Enter values for instant results with step-by-step formulas.
Formula
ay'' + by' + cy = 0 => Characteristic: ar^2 + br + c = 0
For constant-coefficient linear ODEs, substituting y = e^(rx) converts the differential equation into an algebraic characteristic equation. The roots determine the solution form: real distinct roots give exponentials, repeated roots give xe^(rx) terms, and complex roots give oscillatory sine/cosine solutions.
Worked Examples
Example 1: First Order Exponential Decay
Problem: Solve dy/dx + 2y = 0 with y(0) = 3. Evaluate at x = 2.
Solution: Equation: dy/dx = -2y\nSeparate: dy/y = -2 dx\nIntegrate: ln|y| = -2x + C\ny = Ce^(-2x)\nApply IC y(0) = 3: C = 3\nParticular solution: y = 3e^(-2x)\ny(2) = 3e^(-4) = 3(0.01832) = 0.05496
Result: y = 3e^(-2x) | y(2) = 0.0550 | Exponential Decay | Half-life = 0.3466
Example 2: Second Order Damped Oscillation
Problem: Solve y'' + 2y' + 5y = 0 with y(0) = 3, y'(0) = 0. Find y(2).
Solution: Characteristic eq: r squared + 2r + 5 = 0\nDiscriminant = 4 - 20 = -16 < 0\nr = -1 +/- 2i (complex roots)\nGeneral: y = e^(-x)[C1 cos(2x) + C2 sin(2x)]\nApply IC: C1 = 3, C2 = 1.5\ny = e^(-x)[3cos(2x) + 1.5sin(2x)]\ny(2) = e^(-2)[3cos(4) + 1.5sin(4)]
Result: Damped Oscillation | Eigenvalues: -1 +/- 2i | Period: 3.1416
Frequently Asked Questions
What is a differential equation and why is it important?
A differential equation is a mathematical equation that relates a function to its derivatives, expressing how a quantity changes in relation to one or more independent variables. They are fundamentally important because virtually every physical process that involves change over time or space can be modeled using differential equations. Newton's second law (F = ma) is a second-order differential equation, Maxwell's equations governing electromagnetism are partial differential equations, and population growth models use first-order ordinary differential equations. Understanding how to solve these equations allows scientists and engineers to predict system behavior, from the trajectory of a spacecraft to the spread of a disease through a population.
What is the difference between first order and second order differential equations?
The order of a differential equation refers to the highest derivative that appears in the equation, and it fundamentally determines the solution method and the number of arbitrary constants in the general solution. First-order equations contain only the first derivative (dy/dx) and require one initial condition to determine a unique solution, making them suitable for modeling simple growth, decay, and mixing problems. Second-order equations contain the second derivative (d2y/dx2) and require two initial conditions (typically the function value and its first derivative at a point). Second-order equations model oscillatory systems, spring-mass systems, electrical circuits, and beam deflections, where the relationship between acceleration (second derivative) and position is fundamental.
How do I solve a first-order linear differential equation?
First-order linear differential equations have the standard form dy/dx + P(x)y = Q(x) and are solved using the integrating factor method. The integrating factor is mu(x) = e raised to the integral of P(x)dx. Multiplying both sides of the equation by this integrating factor transforms the left side into the derivative of mu(x) times y, making integration straightforward. The general solution becomes y = (1/mu(x)) times the integral of mu(x) Q(x) dx plus C. For the special case where Q(x) = 0 (homogeneous equation), separation of variables also works: divide by y, integrate both sides, and exponentiate. An initial condition y(x0) = y0 determines the constant C for the particular solution.
How are differential equations used in real-world applications?
Differential equations model virtually every dynamic process in science and engineering, making them indispensable across disciplines. In biology, the logistic equation dy/dt = ry(1 - y/K) models population growth with carrying capacity. In physics, Newton's law of cooling dT/dt = -k(T - Te) describes temperature change. In electrical engineering, RLC circuits are modeled by second-order ODEs that produce the same mathematics as mechanical spring-mass-damper systems. Chemical reaction kinetics, fluid flow, heat transfer, structural vibrations, economic models, and epidemiological SIR models all rely on differential equations. Numerical solution methods like Euler's method and Runge-Kutta are used when analytical solutions are impossible, which is the case for most real-world problems.
What is the Euler method for solving differential equations numerically?
Euler's method is the simplest numerical technique for approximating solutions to initial value problems when analytical solutions are unavailable or impractical. Starting from the initial condition y(x0) = y0, the method steps forward by computing y(n+1) = y(n) + h times f(x(n), y(n)), where h is the step size and f gives the derivative value. Each step uses the current slope to project the solution forward by a small increment. While conceptually simple, Euler's method has limited accuracy because it assumes the slope is constant over each step, leading to accumulated error proportional to the step size h. Improved methods like the fourth-order Runge-Kutta method use multiple slope evaluations per step to achieve much higher accuracy without dramatically smaller step sizes.
How do I determine the stability of a differential equation solution?
Stability analysis determines whether solutions remain bounded (stable) or grow without limit (unstable) over time, which is crucial for engineering design and control systems. For linear ODEs with constant coefficients, stability depends entirely on the eigenvalues (roots of the characteristic equation): all roots with negative real parts indicate stability (solutions decay to zero), any root with positive real part indicates instability (solutions grow exponentially), and purely imaginary roots indicate marginal stability (perpetual oscillation). For nonlinear systems, linearization around equilibrium points reveals local stability behavior. Phase plane analysis provides geometric insight by plotting solution trajectories in the y versus dy/dt plane. Stable systems return to equilibrium after perturbation, while unstable systems diverge from equilibrium.