Differential Equation Solver
Calculate differential equation instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Differential Equation Solver
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: First: dy/dt = ky => y = y0*e^(kt) | Second: ay'' + by' + cy = 0 => characteristic ar^2 + br + c = 0
Worked example โ y(2) = 36.79 | Half-life = 1.386 | Solution: y(t) = 100e^(-0.5t)
Formula
First: dy/dt = ky => y = y0*e^(kt) | Second: ay'' + by' + cy = 0 => characteristic ar^2 + br + c = 0
First-order homogeneous ODEs have exponential solutions. Second-order ODEs are solved via the characteristic equation, producing real distinct roots, repeated roots, or complex conjugate roots, each giving a different solution form.
Worked Examples
Example 1: First-Order Exponential Decay
Problem:Solve dy/dt = -0.5y with y(0) = 100. Find y at t = 2 and the half-life.
Solution:This is a first-order homogeneous ODE with k = -0.5 General solution: y(t) = y0 * e^(kt) = 100 * e^(-0.5t) At t = 2: y(2) = 100 * e^(-1) = 100 * 0.3679 = 36.79 Half-life = ln(2) / |k| = 0.6931 / 0.5 = 1.3863 Verification: y(1.3863) = 100 * e^(-0.5 * 1.3863) = 100 * 0.5 = 50
Result:y(2) = 36.79 | Half-life = 1.386 | Solution: y(t) = 100e^(-0.5t)
Example 2: Second-Order Oscillatory (Underdamped)
Problem:Solve y'' + 2y' + 5y = 0 with y(0) = 1, y'(0) = 0.
Solution:Characteristic equation: r^2 + 2r + 5 = 0 Discriminant = 4 - 20 = -16 < 0 (complex roots) alpha = -2/2 = -1, beta = sqrt(16)/2 = 2 Roots: -1 +/- 2i General solution: y = e^(-t)[C1*cos(2t) + C2*sin(2t)] y(0) = C1 = 1 y'(0) = -C1 + 2*C2 = 0, so C2 = 0.5 Particular solution: y = e^(-t)[cos(2t) + 0.5*sin(2t)] Period = 2*pi/2 = pi = 3.14159 At t = 1: y = e^(-1)[cos(2) + 0.5*sin(2)] = 0.3679 * [-0.4161 + 0.4546] = 0.01417
Result:y(1) = 0.01417 | Period = 3.14159 | Decaying oscillation
Frequently Asked Questions
What is a differential equation and why are they important?
A differential equation is a mathematical equation that relates a function to its derivatives, expressing how a quantity changes with respect to one or more variables. They are fundamental because most natural phenomena involve rates of change: population growth depends on current population, heat flow depends on temperature gradients, and force depends on acceleration (second derivative of position). Newton's second law F = ma is itself a differential equation relating force to the second derivative of position. Differential equations appear in every branch of science and engineering, from quantum mechanics to economics. Solving them reveals how systems evolve over time, making them essential tools for prediction and understanding of dynamic systems.
What is the difference between first-order and second-order differential equations?
A first-order differential equation involves only the first derivative (dy/dt), while a second-order equation involves the second derivative (d^2y/dt^2). First-order equations model simple growth, decay, and cooling processes where the rate of change depends on the current value. The general solution has one arbitrary constant, requiring one initial condition. Second-order equations model systems with inertia or oscillation, like spring-mass systems and electrical circuits. Their solutions have two arbitrary constants, requiring two initial conditions (typically initial value and initial rate of change). Second-order equations produce richer behavior including oscillation, overdamping, and critical damping, which is why they model so many physical systems.
How do you solve a first-order linear homogeneous ODE?
A first-order linear homogeneous ODE has the form dy/dt = ky, where k is a constant. The solution is y(t) = y0 * e^(kt), where y0 is the initial value y(0). This can be derived by separation of variables: dy/y = k*dt, integrating both sides gives ln|y| = kt + C, and exponentiating yields y = Ae^(kt) where A = y(0). When k > 0, the solution grows exponentially (population growth, compound interest). When k < 0, it decays exponentially (radioactive decay, cooling). When k = 0, y remains constant. The half-life for decay is ln(2)/|k|, and the doubling time for growth is ln(2)/k. This is the most fundamental differential equation, and its exponential solution appears throughout science.
What is the characteristic equation for a second-order linear ODE?
For the second-order ODE ay'' + by' + cy = 0, the characteristic equation is ar^2 + br + c = 0, obtained by substituting y = e^(rt) into the ODE. The roots r1 and r2 of this quadratic determine the form of the solution. If the discriminant b^2 - 4ac > 0, there are two distinct real roots, giving y = C1*e^(r1*t) + C2*e^(r2*t). If the discriminant equals zero, there is a repeated root r, giving y = (C1 + C2*t)*e^(rt). If the discriminant is negative, the roots are complex conjugates alpha +/- beta*i, giving y = e^(alpha*t)*(C1*cos(beta*t) + C2*sin(beta*t)). This method reduces solving a differential equation to solving an algebraic equation.
What do overdamped, critically damped, and underdamped solutions mean physically?
These terms describe the behavior of second-order systems like spring-mass-damper setups. Overdamped (two distinct negative real roots) means the system returns to equilibrium slowly without oscillating, like a door closer that is set too tight. Critically damped (repeated negative real root) is the fastest return to equilibrium without oscillation, which is the ideal setting for many engineering applications like car suspension and instrument needles. Underdamped (complex roots with negative real part) means the system oscillates with decreasing amplitude, like a guitar string vibrating after being plucked. The damping ratio, determined by the discriminant, controls which regime the system is in. Engineers carefully tune this ratio for optimal system performance.
How are differential equations used in population dynamics and ecology?
In ecology, the simplest model is exponential growth dP/dt = rP, giving P(t) = P0*e^(rt). The logistic equation dP/dt = rP(1 - P/K) adds a carrying capacity K, preventing unlimited growth. Predator-prey models like the Lotka-Volterra equations use coupled first-order ODEs: dx/dt = ax - bxy (prey) and dy/dt = -cy + dxy (predator), producing oscillating populations. Epidemic models (SIR) use three coupled equations for susceptible, infected, and recovered populations. These models, while simplified, capture essential dynamics and guide conservation decisions, disease control strategies, and resource management. The key insight from differential equations is that population behavior emerges from instantaneous rates of change.
What is the role of initial conditions in solving differential equations?
Initial conditions specify the state of the system at a particular time (usually t = 0) and are necessary to determine a unique solution from the family of general solutions. A first-order ODE has one arbitrary constant, so one initial condition y(0) = y0 is needed. A second-order ODE has two constants, requiring both y(0) and y'(0). Without initial conditions, you get a general solution representing infinitely many possible curves. With initial conditions, you get the particular solution describing the specific physical situation. For example, the same spring equation produces very different motions depending on whether you release it from rest (y'(0) = 0) or give it an initial velocity. Initial conditions bridge the gap between abstract mathematics and specific physical scenarios.
How do complex roots lead to oscillatory solutions?
When the characteristic equation has complex roots alpha +/- beta*i, the solution involves complex exponentials e^((alpha + beta*i)*t). Using Euler's formula e^(i*theta) = cos(theta) + i*sin(theta), this becomes e^(alpha*t) * (cos(beta*t) + i*sin(beta*t)). Since the solution must be real, we take linear combinations of the real and imaginary parts, yielding y = e^(alpha*t) * (C1*cos(beta*t) + C2*sin(beta*t)). Here, beta is the angular frequency of oscillation, determining how fast the system vibrates. Alpha controls the amplitude envelope: if alpha < 0, oscillations decay (damped); if alpha = 0, oscillations persist forever (simple harmonic motion); if alpha > 0, oscillations grow (unstable). The period is 2*pi/beta.
What numerical methods exist for solving differential equations?
When analytical solutions are not available (which is most real-world cases), numerical methods approximate the solution step by step. Euler's method is the simplest: y(t + h) = y(t) + h*f(t, y(t)), stepping forward by small increments h. It is easy to implement but has large errors. The Runge-Kutta methods (especially RK4) evaluate the derivative at multiple points within each step, achieving much higher accuracy: y(t+h) uses a weighted average of four slope estimates. Adaptive methods like Dormand-Prince automatically adjust step size for efficiency. For stiff equations (multiple time scales), implicit methods like backward Euler or BDF methods are needed. Modern scientific computing uses sophisticated ODE solvers that combine adaptive stepping, error control, and event detection.
How are differential equations applied in electrical circuit analysis?
Electrical circuits containing inductors (L), capacitors (C), and resistors (R) are naturally described by differential equations. An RLC series circuit satisfies L*d^2q/dt^2 + R*dq/dt + q/C = V(t), a second-order ODE for charge q. The characteristic equation Lr^2 + Rr + 1/C = 0 has discriminant R^2 - 4L/C. Underdamped (R^2 < 4L/C) circuits oscillate, forming the basis of radio tuners and oscillators. Overdamped circuits dissipate energy without oscillation. Critically damped circuits are used in measurement instruments for fastest response without ringing. RC circuits (first-order) model signal filtering, with the time constant RC determining the cutoff frequency. These models are essential for designing everything from power supplies to communication systems.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎQuartic Equation Solver
Calculate quartic equation solver with inputs, formulas, and instant results.
๐งฎSylvester Equation Solver
Calculate sylvester equation solver with inputs, formulas, and instant results.
๐งฎEquation Solver
Solve linear, quadratic, cubic, and polynomial equations with step-by-step solutions.
๐งฎDifferential Equations Solver
Solve first and second order ordinary differential equations with step-by-step work.
๐งฎAbsolute Value Equation Calculator
Calculate absolute value equation with inputs, formulas, and instant results.
๐งฎCubic Equation Calculator
Calculate cubic equation with inputs, formulas, and instant results.
๐งฎEquation Balancer Calculator
Calculate equation balancer with inputs, formulas, and instant results.
๐งฎDifferential Approximation Calculator
Calculate differential approximation with inputs, formulas, and instant results.