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 PickerInstagram User ID LookupFPS ConverterLine CounterBatting Average CalculatorSort NumbersMAC Address GeneratorRelative Standard Deviation CalculatorERA CalculatorRemove SpacesFeet and Inches to Cm ConverterFacebook User ID LookupWord to Phone Number ConverterMAC Address LookupRandom Truth or Dare GeneratorSun, Moon & Rising Sign Calculator 🌞🌙✨Job FinderSum CalculatorImage ResizerPercent Off CalculatorSHA256 Hash GeneratorSlope and Grade CalculatorVertical Jump CalculatorSquare Root (√) CalculatorMP3 LooperRandom Credit Card GeneratorNumber of Digits CalculatorBitwise CalculatorAudio SplitterOPS CalculatorRoman Numerals ConverterSaturn Return CalculatorAI Text HumanizerLog Base 10 CalculatorInvisible Text GeneratorRandom Quote GeneratorRandom Activity GeneratorCm to Feet and Inches ConverterSlugging Percentage CalculatorRandom IMEI GeneratorPhone Number ExtractorMerge VideosRandom Loadout GeneratorRandom Movie PickerSalary Conversion Calculator⬛ Aspect Ratio CalculatorText FormatterRandom Fake Address GeneratorRandom Superpower GeneratorCM to Inches ConverterMaster Number CalculatorRandom Poker Hand GeneratorLove Compatibility CalculatorRandom Meal GeneratorCaffeine Overdose CalculatorFile Size ConverterOn Base Percentage CalculatorNumber to Word ConverterWHIP CalculatorWord Ladder GeneratorDecimal to BCD ConverterCompound Growth CalculatorRandom Writing Prompt GeneratorFirst n Digits of PiOctal CalculatorVideo to Image ExtractorPER CalculatorBinary to Gray Code ConverterCompare Two StringsYouTube Channel StatisticsConnect the Dots GeneratorStair CalculatorSteel Weight CalculatorSocial Media Username CheckerWAR Calculator📷 OCR / Image to TextTime Duration CalculatorPercent Growth Rate CalculatorBCD to Decimal ConverterPerfect Number CheckerBingo Card GeneratorRandom Birthday GeneratorQuotient and Remainder CalculatorProportion CalculatorGrade CalculatorGray Code to Binary ConverterLeap Years ListMartingale Strategy Calculator📅 Date CalculatorRemove Line BreaksClothing Size ConverterArc Length CalculatorRandom Object GeneratorOutlier CalculatorImage Splitter🔍 Plagiarism CheckerSHA512 Hash GeneratorDay of the Year Calculator - What Day of the Year Is It Today?Battery Life CalculatorDMS to Decimal Degrees ConverterIP Subnet CalculatorBinary to BCD ConverterWhat is my Lucky Number?Add Text to ImageLong Division CalculatorList of Prime NumbersRandom Chord GeneratorVideo CompressorAstrological Element Balance CalculatorAcreage CalculatorRemove AccentTrigonometric Equation SolverVideo SplitterAI Punctuation AdderRandom Chess Opening GeneratorMorse Code GeneratorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾URL ExtractorBoiling Point CalculatorAI ParaphraserModulo CalculatorIP Address to Hex ConverterRandom Time GeneratorSum of Positive Integers CalculatorWhat is my Zodiac Sign?🖱️ Click CounterTaco Bar CalculatorImage CompressorLottery Number GeneratorRemove Leading Trailing SpacesSquare Numbers ListCone Flat Pattern (Template) GeneratorNumber ExtractorAngel Number CalculatorHappy Number CalculatorBirth Day of the Week CalculatorPVIF CalculatorBroken Link Checker🎰 Gacha Pity CalculatorDay of Year CalendarName Number CalculatorList RandomizerRandom Emoji GeneratorWeight Loss CalculatorRandom Tournament Bracket GeneratorBreak Line by CharactersAI Language DetectorAdd Prefix and Suffix to TextRandom Number PickerNonogram Generator (Picross)Hypotenuse CalculatorMolarity CalculatorMandelbrot Set ExplorerEmail ExtractorYouTube Tag ExtractorMercury Retrograde CalendarDice Roll Probability CalculatorConvolution CalculatorCryptogram GeneratorBcrypt Hash Generator / Checker🔊 Tone GeneratorBonus CalculatorAdjust Video SpeedBCD to Binary ConverterHex to BCD ConverterLbs to Kg ConverterRadical SimplifierRandom Line PickerYouTube Comment PickerWord Scramble GeneratorExponential Decay CalculatorInvisible Character RemoverPVIFA CalculatorRandom Playing Card GeneratorFlip VideoMAC Address AnalyzerMiter Angle CalculatorVideo CropperAPI TesterkPa to psi ConverterYouTube Earnings EstimatorRandom Sound Frequency GeneratorRoof Pitch CalculatorText to Speech ReaderNumber Pattern FinderRounding CalculatorMultiple Fraction CalculatorRatio CalculatorRatio to Percentage CalculatorCoin FlipperLog Base 2 CalculatorMaze GeneratorAge CalculatorColor InverterDecibel (dB) Calculator⏱️ Hours CalculatorHow Long Ago CalculatorSort Lines AlphabeticallyBCD to Hex ConverterMedian CalculatorStandard Error CalculatorAverage CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderHex to Decimal ConverterRandom Group GeneratorRandom String GeneratorAmortization CalculatorMarkup 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 OptimizerCTR 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 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 CalculatorTip 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 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 SimulatorAnnuity Payout CalculatorReverse Mortgage CalculatorVariable Annuity CalculatorFixed Indexed Annuity CalculatorBond Convexity CalculatorBond Duration Calculator (Macaulay & Modified)Forward Rate CalculatorMortgage Recast CalculatorTreasury Inflation-Protected Securities (TIPS) CalculatorStock Beta CalculatorTreynor Ratio CalculatorSortino Ratio CalculatorDoppler Effect CalculatorSpring Constant CalculatorPendulum Period CalculatorCentripetal Force CalculatorAngular Velocity CalculatorMoment of Inertia CalculatorSnell's Law CalculatorCoulomb's Law CalculatorElectric Field CalculatorMagnetic Field of Wire CalculatorLens Equation CalculatorA/B Test Significance CalculatorA/B Test Sample Size CalculatorConversion Rate CalculatorCustomer Lifetime Value (CLV) CalculatorCustomer Acquisition Cost (CAC) CalculatorChurn Rate CalculatorRetention Rate Cohort CalculatorNPS (Net Promoter Score) CalculatorPareto Chart GeneratorSix Sigma Process Capability CalculatorTessellation GeneratorSpirograph GeneratorVoronoi Diagram GeneratorDelaunay Triangulation GeneratorL-System Fractal GeneratorJulia Set GeneratorPolar Equation Plotter3D Surface PlotterSierpinski Triangle GeneratorcURL Command BuilderHTTP Status Code ReferenceUUID Validator/DecoderURL ParserQuery String BuilderSVG to React/JSX ConverterSCSS to CSS CompilerLess to CSS CompilerTypeScript PlaygroundJSON Schema GeneratorImage to ASCII Art ConverterImage to SVG TracerLipogram CheckerPangram CheckerAcronym GeneratorBackronym GeneratorPig Latin TranslatorEXIF Data Viewer/RemoverROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability EditorSentence Length Variance AnalyzerWord Frequency AnalyzerBusiness Days CalculatorAdd Business Days to DateHalfway Date CalculatorDate Pattern GeneratorHow Long Until CalculatorBirthday Across Cultures CalculatorLunar Calendar ConverterHijri Calendar ConverterHebrew Calendar ConverterInsulin Sensitivity Factor CalculatorCarb-to-Insulin Ratio CalculatorLean Body Mass to Strength CalculatorOne-Mile Walk Test (Rockport) CalculatorCooper 12-Minute Run CalculatorFFMI CalculatorAPGAR Score CalculatorGlasgow Coma Scale CalculatorWells Score Calculator (DVT/PE)Tennis Score TrackerSoccer xG (Expected Goals) CalculatorCricket Run Rate CalculatorRugby Points CalculatorBoxing Punch Power CalculatorRace Time PredictorSwimming SWOLF CalculatorYoga Pose Hold Timer