Simplify Your Workflow: Search MiniWebtool.
Add Extension
Home Page > Math > Calculus > Second-Order ODE Solver

Second-Order ODE Solver

Solve second-order linear ordinary differential equations with constant coefficients (homogeneous and non-homogeneous). Auto-derives the characteristic equation, classifies the damping regime (over/critical/under-damped), gives the closed-form y(x), and shows an interactive solution curve plus phase-plane (y, y') trajectory.

Second-Order ODE Solver
Second-order linear ODE a·y″ + b·y′ + c·y = g(x)
a·y″
b·y′
c·y
The equation is a·y″ + b·y′ + c·y = g(x) with real constants a, b, c. Coefficient a must be non-zero.
g(x) =
Closed-form y_p is derived for constants, polynomials (up to degree 2) and A·exp(k·x). Any other expression still gets a high-accuracy numerical solution.
x₀
y₀
y′₀
x min
x max
Two initial conditions are required: y(x₀) = y₀ and y′(x₀) = y′₀. The solver integrates outward from x₀ in both x-directions.

Embed Second-Order ODE Solver Widget

About Second-Order ODE Solver

The Second-Order ODE Solver takes a linear ordinary differential equation of the form a·y″ + b·y′ + c·y = g(x) with constant real coefficients, automatically derives its characteristic equation, classifies the damping regime (overdamped, critically damped, underdamped, undamped or unstable), and produces both a symbolic closed-form solution and a high-accuracy numerical solution. The interactive output pairs a dual-curve time plot of y(x) and y′(x) with a phase-plane trajectory of (y, y′) — a view that exposes the regime at a glance: spiral-in for underdamped, node-in for overdamped, closed loop for undamped, spiral-out for unstable.

What Is a Second-Order Linear ODE With Constant Coefficients?

A second-order linear ordinary differential equation with real constant coefficients is an equation of the form

a · y″(x) + b · y′(x) + c · y(x) = g(x)

where a ≠ 0, b, c are real constants and g(x) is the forcing term. Two initial conditions y(x₀) = y₀ and y′(x₀) = y′₀ turn this into an initial-value problem with a unique solution on a neighbourhood of x₀ — this follows from the Picard-Lindelöf theorem applied to the equivalent first-order system.

If g(x) = 0 the equation is homogeneous. Otherwise it is non-homogeneous, and the full solution decomposes as

y(x) = y_h(x) + y_p(x)

where y_h is the general solution of the associated homogeneous equation (contains two free constants) and y_p is any particular solution of the full equation. Applying the two initial conditions fixes the two free constants.

The Characteristic Equation

Guessing y = e^(r·x) in the homogeneous equation gives the characteristic (or auxiliary) equation

a · r² + b · r + c = 0

a quadratic whose discriminant Δ = b² − 4ac controls the entire qualitative behaviour:

Three Root Cases & the Damping Regime

Discriminant Δ = b² − 4ac Roots of a·r² + b·r + c = 0 Homogeneous solution y_h(x) Physical regime
Δ > 0 Two distinct real roots r₁, r₂ C₁·e^(r₁·x) + C₂·e^(r₂·x) Overdamped — slow monotonic return to equilibrium (both roots negative).
Δ = 0 One repeated real root r = −b/(2a) (C₁ + C₂·x)·e^(r·x) Critically damped — fastest return without oscillation.
Δ < 0 Complex conjugate roots α ± β·i with α = −b/(2a), β = √(−Δ)/(2a) e^(α·x)·(C₁·cos(β·x) + C₂·sin(β·x)) Underdamped (α < 0) — decaying oscillation; undamped (α = 0) — pure sinusoidal motion; unstable (α > 0) — growing oscillation.

Method of Undetermined Coefficients (Non-homogeneous Case)

When g(x) takes one of the following simple forms, the method of undetermined coefficients supplies a particular solution by assuming a trial of the same form with unknown coefficients and solving for them:

Reading the Phase Plane

The equivalent first-order system is u = y, v = y′ with u′ = v and v′ = (g(x) − b·v − c·u)/a. Plotting v against u parametrically in x gives the phase-plane trajectory. For homogeneous autonomous systems (no x in g), orbits are uniquely determined by their starting point (y₀, y′₀) and reveal the regime at a glance:

Worked Example: Driven Damped Harmonic Oscillator

Consider the equation y″ + 2·y′ + 5·y = 10 with y(0) = 0, y′(0) = 0 — a driven, underdamped system.

  1. Characteristic equation: r² + 2r + 5 = 0 → Δ = 4 − 20 = −16 → r = −1 ± 2i.
  2. Homogeneous solution: y_h = e^(−x)·(C₁·cos 2x + C₂·sin 2x).
  3. Particular solution for constant forcing g = 10: try y_p = K, so 5K = 10, giving y_p = 2.
  4. Apply ICs: y(0) = 0 → C₁ + 2 = 0 → C₁ = −2. y′(0) = 0 → −C₁ + 2C₂ = 0 → C₂ = −1.
  5. Final answer: y(x) = 2 − e^(−x)·(2·cos 2x + sin 2x) — oscillates with decaying envelope and limit y → 2.

How to Use This Calculator

  1. Enter the coefficients a, b, c in the top row. a must be non-zero (otherwise the equation is first-order).
  2. Type the forcing term g(x), or leave it as 0 for a homogeneous problem. Closed-form particular solutions are derived for constants, polynomials up to degree 2, and single exponentials A·e^(k·x) including the resonance case.
  3. Provide initial conditions (x₀, y₀, y′₀). Both y and y′ at x₀ must be specified because the equation is second-order.
  4. Pick the x range for the plots. The solver integrates outward from x₀ in both x-directions using RK4.
  5. Click Solve & Visualize. You get the characteristic equation with its roots on the complex plane, the damping-regime classification, the homogeneous and particular closed-form solutions, a dual-curve time plot of y and y′, and the phase-plane trajectory.

Common Applications

Numerical Method — Classical Runge-Kutta (RK4) on the 2D System

The tool reduces a·y″ + b·y′ + c·y = g(x) to the first-order system

u′ = v v′ = ( g(x) − b·v − c·u ) / a

with u(x₀) = y₀, v(x₀) = y′₀. Four-stage Runge-Kutta is then applied to the vector state (u, v). RK4 has local truncation error O(h⁵) and global error O(h⁴); the default 400 sub-steps in each direction give roughly six-digit accuracy for non-stiff problems.

Frequently Asked Questions

What is a second-order linear ODE with constant coefficients?

A second-order linear ODE with constant coefficients has the form a·y″ + b·y′ + c·y = g(x), where a, b, c are real constants and g(x) is the forcing (non-homogeneous) term. With two initial conditions y(x₀) = y₀ and y′(x₀) = y′₀ the solution is unique. The homogeneous case g(x) = 0 always admits a closed-form solution via the characteristic equation a·r² + b·r + c = 0; the non-homogeneous case is solved as y(x) = y_h(x) + y_p(x).

What is the characteristic equation?

For a·y″ + b·y′ + c·y = 0, substituting the ansatz y = e^(r·x) yields a·r² + b·r + c = 0 — the characteristic or auxiliary equation. Its roots determine the form of the homogeneous solution: two distinct real roots give y_h = C₁·e^(r₁·x) + C₂·e^(r₂·x); a repeated root r gives y_h = (C₁ + C₂·x)·e^(r·x); complex conjugate roots α ± β·i give y_h = e^(α·x)·(C₁·cos(β·x) + C₂·sin(β·x)).

What does under-, critically, and overdamped mean?

The terminology comes from the spring-mass-damper model m·x″ + c·x′ + k·x = 0. Overdamped (discriminant > 0, two real roots) means the system returns to equilibrium slowly without oscillation. Critically damped (discriminant = 0, repeated root) is the fastest return without overshoot. Underdamped (discriminant < 0, complex roots) gives decaying oscillation. Undamped (b = 0, c/a > 0) gives pure sinusoidal oscillation forever.

What is the method of undetermined coefficients?

For simple forcing g(x) — constants, polynomials, exponentials, sines, cosines, and their products — the particular solution y_p is assumed to have the same form as g with unknown coefficients, which are determined by substituting into the ODE and matching terms. The trial must be multiplied by x (or x² for double roots) when g(x) resonates with a characteristic root.

What is a phase plane?

For a second-order equation reduced to the 2D system (y, y′) the phase plane plots y′ versus y as x advances. Solution curves in the phase plane reveal regime at a glance: decaying spirals for underdamped, inward nodes for overdamped, closed ellipses for undamped harmonic motion, and outward spirals for unstable oscillation. It is the geometric counterpart of the characteristic-equation root diagram.

What numerical method does this tool use?

The classical fourth-order Runge-Kutta (RK4) method is applied to the equivalent first-order system u = y, v = y′, with u′ = v and v′ = (g(x) − b·v − c·u)/a. RK4 has local truncation error O(h⁵) and the default 400 sub-steps per direction give roughly six-digit accuracy for non-stiff equations over the chosen window.

Further Reading

Reference this content, page, or tool as:

"Second-Order ODE Solver" at https://MiniWebtool.com/second-order-ode-solver/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 22, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Related MiniWebtools:

Calculus:

Top & Updated:

Random PickerRandom Name PickerLine CounterBatting Average CalculatorRelative Standard Deviation CalculatorFPS ConverterSort NumbersInstagram User ID LookupERA CalculatorMAC Address GeneratorRemove SpacesWord to Phone Number ConverterJob FinderMAC Address LookupFacebook User ID LookupSum CalculatorFeet and Inches to Cm ConverterOPS CalculatorRandom Truth or Dare GeneratorPercent Off CalculatorSHA256 Hash GeneratorRandom Quote GeneratorLog Base 10 CalculatorSquare Root (√) CalculatorDoubling Time CalculatorBitwise CalculatorNumber of Digits CalculatorVertical Jump CalculatorMP3 LooperAudio SplitterSlugging Percentage CalculatorRoman Numerals ConverterSlope and Grade CalculatorSalary Conversion CalculatorOn Base Percentage CalculatorPhone Number ExtractorRandom Poker Hand GeneratorRandom IMEI GeneratorSaturn Return CalculatorNumber to Word ConverterAI Text HumanizerSun, Moon & Rising Sign Calculator 🌞🌙✨Merge VideosCaffeine Overdose CalculatorImage ResizerCompound Growth CalculatorRandom Birthday GeneratorFirst n Digits of PiBinary to Gray Code ConverterDecimal to BCD ConverterGrade CalculatorCm to Feet and Inches ConverterCompare Two StringsWHIP CalculatorBCD to Decimal ConverterRandom Fake Address GeneratorRandom Movie PickerOctal CalculatorRandom Activity GeneratorAdd Prefix and Suffix to TextVideo to Image ExtractorRandom Writing Prompt GeneratorOne Rep Max (1RM) CalculatorRandom Superpower GeneratorFile Size ConverterBingo Card GeneratorText FormatterRandom Object GeneratorInvisible Text GeneratorRemove AccentYouTube Channel StatisticsWAR CalculatorPercent Growth Rate CalculatorLove Compatibility CalculatorRandom Integer GeneratorOutlier CalculatorCM to Inches ConverterClothing Size ConverterStair CalculatorQuotient and Remainder CalculatorTime Duration CalculatorWord Ladder GeneratorGray Code to Binary ConverterImage SplitterRandom Number PickerDay of Year CalendarList of Prime NumbersCryptogram GeneratorExponential Decay CalculatorLeap Years ListRandom Credit Card GeneratorRemove Leading Trailing SpacesRandom Loadout GeneratorArc Length CalculatorUnit Rate CalculatorDay of the Year Calculator - What Day of the Year Is It Today?Modulo CalculatorConnect the Dots GeneratorAI Punctuation AdderEmail ExtractorURL ExtractorAI ParaphraserSHA512 Hash GeneratorVideo CompressorBinary to BCD ConverterIP Address to Hex ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerBreak Line by CharactersAverage CalculatorPVIFA CalculatorReverse VideoHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterNumber ExtractorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence Expander📅 Date CalculatorLbs to Kg ConverterHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorAmortization CalculatorMarkup CalculatorPVIF CalculatorName Number CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerSocial Media Username CheckerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorRelative Risk CalculatorEffect Size CalculatorPermutations with Repetition CalculatorModular Exponentiation CalculatorPrimitive Root CalculatorPerfect Number CheckerAmicable Number CheckerTwin Prime FinderMersenne Prime CheckerGoldbach Conjecture VerifierMöbius Function CalculatorEgyptian Fraction CalculatorFibonacci Number CheckerDigital Root CalculatorPartition Function CalculatorBoolean Algebra SimplifierKarnaugh Map (K-Map) SolverLogic Gate SimulatorGraph Coloring CalculatorTopological Sort CalculatorAdjacency Matrix CalculatorRecurrence Relation SolverInclusion-Exclusion CalculatorLinear Programming SolverTraveling Salesman Solver (TSP)Hamiltonian Path CheckerPlanar Graph CheckerNetwork Flow Calculator (Max Flow)Stable Marriage Problem SolverFirst-Order ODE SolverSecond-Order ODE SolverDirection Field / Slope Field PlotterEuler's Method CalculatorBernoulli ODE SolverSystem of ODEs SolverGroup Theory Order CalculatorRing and Field CalculatorJordan Normal Form CalculatorMatrix Exponential CalculatorTensor Product CalculatorFast Fourier Transform (FFT) CalculatorZ-Transform CalculatorNumerical Integration CalculatorTOML to JSON ConverterJSON to CSV ConverterXML to JSON ConverterSQL to MongoDB Query ConverterCSS Flexbox PlaygroundCSS Grid GeneratorJWT GeneratorBcrypt Hash Generator / CheckerColor Code Converter (All Formats)Git Command Generator.env File GeneratorLorem Picsum / Placeholder Image GeneratorText to Binary/Hex/ASCII ConverterSyllable CounterSentence CounterParagraph CounterSpeaking Time CalculatorReading Time CalculatorWhitespace VisualizerStrikethrough Text GeneratorTorque Converter (Nm, ft-lb, kgf-cm)Data Transfer Rate ConverterFuel Efficiency ConverterAstronomical Unit ConverterRing Size ConverterPaper Size ReferenceGas Mileage CalculatorEV Range CalculatorEV Charging Time Calculator0–60 / Quarter Mile CalculatorCar Lease CalculatorVehicle Towing Capacity CalculatorExposure Triangle CalculatorCrop Factor CalculatorMegapixel to Print Size CalculatorPhoto File Size EstimatorMusic BPM TapperMusic Key TransposerVideo Bitrate CalculatorSeed Germination Rate CalculatorFertilizer Calculator (NPK)Raised Bed Soil CalculatorFrost Date CalculatorLawn Fertilizer CalculatorCompost Calculator (C:N Ratio)Solar Panel CalculatorSolar ROI CalculatorHome Energy Audit CalculatorAppliance Energy Cost CalculatorWater Usage CalculatorElectricity Generation Cost CalculatorHeat Loss CalculatorFlight Distance CalculatorTravel Budget CalculatorJet Lag CalculatorPacking List GeneratorTip Splitter (Advanced)Lease vs Buy CalculatorHourly Rate Calculator (Freelancer)Invoice Late Fee CalculatorESPP CalculatorStock Split CalculatorOptions Probability CalculatorDollar to Gold ConverterBeam Load CalculatorPipe Flow CalculatorBolt Torque CalculatorSteel Weight CalculatorGravel, Sand & Topsoil CalculatorRandom Sentence GeneratorRandom Paragraph GeneratorRandom Math Problem GeneratorRandom Bible Verse GeneratorRandom Cat/Dog Name GeneratorRandom Debate Topic GeneratorBody Recomposition CalculatorAlcohol Calorie CalculatorMedication Dosage CalculatorPace to Calories CalculatorHydration CalculatorTrain Meeting Problem SolverAge Word Problem SolverMixture Problem SolverWork Rate Problem SolverDistance-Speed-Time Triangle CalculatorCoin Word Problem SolverNumber Bonds GeneratorCarry and Borrow VisualizerTimes Tables QuizMental Math TrainerRoman Numeral Math SolverEgyptian Multiplication CalculatorVedic Math Tricks CalculatorRussian Peasant MultiplicationSoroban Abacus Simulator