/

Initial Value Problem Calculator — Linear ODE Solver with Step-by-Step Working

Initial Value Problem Calculator — Linear ODE Solver with Step-by-Step Working
Differential Equations

Initial Value Problem Calculator

Solve first and second order linear ODEs with constant coefficients — find the general solution, then apply initial conditions to get the particular solution satisfying your IVP, with complete step-by-step working.

Initial Value Problem Calculator — Three Solver Modes
Scope: This solver covers linear ODEs with constant coefficients — the most common type in introductory differential equations courses. It handles: first order y′ + ay = b, second order homogeneous y″ + ay′ + by = 0, and second order non-homogeneous y″ + ay′ + by = c (constant right-hand side). It does NOT solve nonlinear ODEs, systems of ODEs, variable-coefficient equations, or non-homogeneous equations with non-constant forcing functions. For those, use the Laplace transform method or Wolfram Alpha.
y′ + a·y = b,   y(0) = y₀
y′+2y=6, y(0)=1
y′+y=0, y(0)=3
y′=4, y(0)=2
y′−y=0, y(0)=5
y′+3y=9, y(0)=0

General Solution

Particular Solution (IVP)

Step-by-Step Working
y″ + a·y′ + b·y = 0,   y(0)=y₀,   y′(0)=y′₀
Initial Conditions:
y″+5y′+6y=0 distinct
y″+4y=0 complex
y″+4y′+4y=0 repeated
y″+2y′+y=0
y″+y=0, SHM
y″+y′−6y=0

Characteristic Equation

Δ > 0
Distinct Real
r₁≠r₂
Δ = 0
Repeated Root
r₁=r₂
Δ < 0
Complex Pair
p±qi

General Solution

Particular Solution (IVP)

Step-by-Step Working
y″ + a·y′ + b·y = c,   y(0)=y₀,   y′(0)=y′₀
Initial Conditions:
y″+3y′+2y=4
y″+y=1
y″+5y′+6y=12
y″+4y′+4y=8
y″+2y′+5y=10

Particular Solution y_p (Undetermined Coefficients)

General Solution y = y_h + y_p

Particular Solution (IVP — with initial conditions)

Step-by-Step Working
Characteristic Equation Method — All Three Cases
1 Case 1 — Distinct Real Roots (Δ > 0) y=C₁e^(r₁t)+C₂e^(r₂t)

When discriminant Δ = a²−4b > 0, the characteristic equation r²+ar+b=0 has two distinct real roots r₁ and r₂. The general solution is:

y = C₁·e^(r₁t) + C₂·e^(r₂t)

Apply ICs: y(0)=y₀ gives C₁+C₂=y₀; y′(0)=y′₀ gives r₁C₁+r₂C₂=y′₀. Solve the 2×2 linear system.

2 Case 2 — Repeated Root (Δ = 0) y=(C₁+C₂t)e^(rt)

When Δ = a²−4b = 0, there is one repeated root r = −a/2. The general solution is:

y = (C₁ + C₂·t)·e^(rt)

ICs: y(0)=y₀ gives C₁=y₀; y′(0)=y′₀ gives C₂+r·C₁=y′₀, so C₂=y′₀−r·y₀.

3 Case 3 — Complex Conjugate Roots (Δ < 0) y=e^(pt)(C₁cos(qt)+C₂sin(qt))

When Δ = a²−4b < 0, roots are complex: r = p ± qi where p = −a/2 and q = √(4b−a²)/2. Via Euler's formula:

y = e^(pt)·(C₁·cos(qt) + C₂·sin(qt))

ICs: y(0)=y₀ gives C₁=y₀; y′(0)=y′₀ gives p·C₁+q·C₂=y′₀, so C₂=(y′₀−p·y₀)/q.

If p=0 (pure imaginary roots): pure oscillation (no damping). If p<0: damped oscillation. If p>0: growing oscillation (unstable).

4 Undetermined Coefficients — Constant RHS y_p = c/b (b≠0)

For y″+ay′+by=c with constant c: try a particular solution y_p = K (constant). Substituting: 0+0+bK=c → K=c/b (requires b≠0).

If b=0 but a≠0: try y_p=Kt. If b=0 and a=0: try y_p=Kt²/2.

General solution: y = y_h + y_p, where y_h is the homogeneous solution. Apply ICs to the full general solution.

What Is an Initial Value Problem?

This initial value problem calculator solves linear ODEs with constant coefficients using the characteristic equation method — finding the general solution, then applying your initial conditions to determine the unique particular solution satisfying the IVP. The IVP calculator handles three types: first order y′+ay=b, second order homogeneous y″+ay′+by=0, and second order non-homogeneous y″+ay′+by=c.

An initial value problem (IVP) consists of a differential equation together with enough initial conditions to uniquely determine the solution. For a first-order ODE, one initial condition is required — typically y(0) = y₀. For a second-order ODE, two initial conditions are required — y(0) = y₀ and y′(0) = y′₀. These initial conditions eliminate the arbitrary constants in the general solution to produce one unique particular solution.

IVP: ODE + Initial Conditions → Unique Particular Solution Example: y″+5y′+6y=0, y(0)=2, y′(0)=−1 → y = 3e^(−2t) − e^(−3t)

Why Initial Conditions Matter

A second-order ODE like y″+4y=0 has infinitely many solutions — the general solution y = C₁cos(2t) + C₂sin(2t) represents a two-parameter family. Only the initial conditions y(0) = y₀ and y′(0) = y′₀ pin down C₁ and C₂ to give one particular solution. Without initial conditions, the problem is underdetermined.

Existence and Uniqueness: For linear ODEs with constant coefficients, the Existence and Uniqueness Theorem guarantees that given any initial conditions y(0) and y′(0), there is exactly one solution. This is why the characteristic equation method always works for this class of equations.

General Solution vs Particular Solution

Understanding the distinction between a general solution and a particular solution is essential for working with initial value problems and this particular solution calculator.

General Solution

The general solution of an ODE contains all arbitrary constants and represents the complete family of solutions. For a second-order linear ODE, the general solution has two arbitrary constants C₁ and C₂. Every solution to the ODE belongs to this family for some values of C₁ and C₂.

  • First order: y = C·e^(−at) + b/a (one constant C)
  • Second order: y = C₁·e^(r₁t) + C₂·e^(r₂t) (two constants C₁, C₂)

Particular Solution

The particular solution is obtained by applying the initial conditions (the IVP data) to the general solution and solving for every arbitrary constant. The result is a unique function with no free parameters — it satisfies both the ODE and all initial conditions simultaneously.

Example: General → Particular

  1. ODE: y″+5y′+6y=0. General solution: y = C₁e^(−2t) + C₂e^(−3t)
  2. Apply y(0)=2: C₁ + C₂ = 2
  3. Apply y′(0)=−1: −2C₁ − 3C₂ = −1
  4. Solve: from first equation C₁ = 2−C₂. Substitute: −2(2−C₂)−3C₂=−1 → −4+2C₂−3C₂=−1 → C₂=3... wait: −C₂=3 → C₂=−1, C₁=3
  5. Particular solution: y = 3e^(−2t) − e^(−3t)

How to Solve a Linear ODE with Constant Coefficients — Step-by-Step

The characteristic equation method is the standard technique for second-order linear ODEs with constant coefficients y″+ay′+by=0. The method works by assuming a solution of the form y = e^(rt) and determining which values of r make this a valid solution.

The Characteristic Equation

Substituting y = e^(rt) into y″+ay′+by=0 gives r²e^(rt)+are^(rt)+be^(rt)=0, so e^(rt)(r²+ar+b)=0. Since e^(rt)≠0, we need:

r² + ar + b = 0    (Characteristic Equation) Discriminant Δ = a² − 4b determines the root type and solution form

Case 1 — Two Distinct Real Roots (Δ > 0)

Example: y″+5y′+6y=0, y(0)=2, y′(0)=−1

  1. Characteristic equation: r²+5r+6=0
  2. Factor: (r+2)(r+3)=0 → r₁=−2, r₂=−3 (Δ=25−24=1>0 ✓)
  3. General solution: y = C₁e^(−2t) + C₂e^(−3t)
  4. y(0)=2: C₁+C₂=2; y′(t)=−2C₁e^(−2t)−3C₂e^(−3t); y′(0)=−1: −2C₁−3C₂=−1
  5. Solve: C₁=3, C₂=−1
  6. Particular solution: y = 3e^(−2t) − e^(−3t)

Case 2 — Repeated Root (Δ = 0)

Example: y″+4y′+4y=0, y(0)=1, y′(0)=0

  1. Characteristic equation: r²+4r+4=0
  2. (r+2)²=0 → r=−2 (repeated). Δ=16−16=0 ✓
  3. General solution: y = (C₁+C₂t)e^(−2t)
  4. y(0)=1: C₁=1
  5. y′(t)=C₂e^(−2t)+(C₁+C₂t)(−2)e^(−2t); y′(0)=C₂−2C₁=0 → C₂=2
  6. Particular solution: y = (1+2t)e^(−2t)

Case 3 — Complex Conjugate Roots (Δ < 0)

Example: y″+4y=0, y(0)=0, y′(0)=2

  1. Characteristic equation: r²+4=0 → r=±2i. Δ=0−16=−16<0 ✓
  2. p=0 (real part), q=2 (imaginary part)
  3. General solution: y = e^(0·t)(C₁cos(2t)+C₂sin(2t)) = C₁cos(2t)+C₂sin(2t)
  4. y(0)=0: C₁=0
  5. y′(t)=−2C₁sin(2t)+2C₂cos(2t); y′(0)=2C₂=2 → C₂=1
  6. Particular solution: y = sin(2t)

Solving First Order Linear ODEs — y′ + ay = b

For the first-order linear ODE y′+ay=b with constant coefficients a and b, the linear differential equation calculator uses the integrating factor method (which reduces to a simple closed-form for constant a).

y(t) = b/a + C·e^(−at)    (a ≠ 0) Steady state = b/a | Transient = C·e^(−at) | Applying y(0)=y₀: C = y₀ − b/a

The solution has two parts: the steady-state (equilibrium) y = b/a (the constant the system tends to as t→∞) and the transient C·e^(−at) (the decay/growth from the initial state). The initial condition y(0)=y₀ determines C = y₀ − b/a.

Example 1: y′+2y=6, y(0)=1

  1. a=2, b=6. Steady state = 6/2 = 3
  2. General solution: y = 3 + C·e^(−2t)
  3. Apply y(0)=1: 3+C=1 → C=−2
  4. Particular solution: y = 3 − 2e^(−2t)
  5. As t→∞: y→3 (the steady-state). At t=0: y=3−2=1 ✓

Example 2: y′=4 (a=0), y(0)=2

  1. a=0, b=4. The equation is y′=4 — simply integrate both sides.
  2. General solution: y = 4t + C
  3. Apply y(0)=2: C=2
  4. Particular solution: y = 4t + 2

Worked Examples — Initial Value Problems

1. y″+y=0, y(0)=0, y′(0)=1 (Simple Harmonic Motion)

  1. Characteristic equation: r²+1=0 → r=±i (p=0, q=1)
  2. General solution: y = C₁cos(t)+C₂sin(t)
  3. y(0)=0: C₁=0; y′(0)=1: C₂=1
  4. y = sin(t)

2. y″−y=0, y(0)=1, y′(0)=0 (Hyperbolic)

  1. r²−1=0 → r=±1 (distinct real)
  2. y = C₁eˢ+C₂e^(−t)
  3. y(0)=1: C₁+C₂=1; y′(0)=0: C₁−C₂=0 → C₁=C₂=1/2
  4. y = (1/2)eˢ + (1/2)e^(−t) = cosh(t)

3. y″+2y′+5y=0, y(0)=1, y′(0)=0 (Damped Oscillation)

  1. r²+2r+5=0. Δ=4−20=−16<0. p=−1, q=2
  2. y = e^(−t)(C₁cos(2t)+C₂sin(2t))
  3. y(0)=1: C₁=1
  4. y′(t)=e^(−t)[(−C₁+2C₂)cos(2t)+(−C₂−2C₁)sin(2t)]; y′(0)=−C₁+2C₂=0 → C₂=1/2
  5. y = e^(−t)[cos(2t) + (1/2)sin(2t)]

4. y″+3y′+2y=4, y(0)=0, y′(0)=0 (Non-homogeneous)

  1. Particular solution: y_p = 4/2 = 2 (since b=2≠0)
  2. Homogeneous: r²+3r+2=0 → (r+1)(r+2)=0 → r₁=−1, r₂=−2
  3. y_h = C₁e^(−t)+C₂e^(−2t); Full general: y = C₁e^(−t)+C₂e^(−2t)+2
  4. y(0)=0: C₁+C₂+2=0 → C₁+C₂=−2
  5. y′(0)=0: −C₁−2C₂=0 → C₁=−2C₂; so −2C₂+C₂=−2 → C₂=2, C₁=−4
  6. y = −4e^(−t) + 2e^(−2t) + 2

5. y′+3y=9, y(0)=0 (First Order to Equilibrium)

  1. Steady state = 9/3 = 3; y = 3+Ce^(−3t)
  2. y(0)=0: C=−3
  3. y = 3(1−e^(−3t)) — starts at 0, approaches 3 as t→∞

6. y″+2y′+y=3, y(0)=2, y′(0)=1 (Repeated Root + Non-homogeneous)

  1. y_p = 3/1 = 3 (b=1)
  2. Homogeneous: r²+2r+1=(r+1)²=0 → r=−1 (repeated)
  3. y = (C₁+C₂t)e^(−t)+3
  4. y(0)=2: C₁+3=2 → C₁=−1
  5. y′(t)=C₂e^(−t)+(C₁+C₂t)(−e^(−t)); y′(0)=C₂−C₁=1 → C₂=1+(−1)=0
  6. y = −e^(−t) + 3

Frequently Asked Questions

What is the difference between a general solution and a particular solution?
The general solution contains arbitrary constants (C₁, C₂) and represents the entire family of solutions to the ODE. For a second-order ODE, there are two arbitrary constants. The particular solution is obtained by applying specific initial conditions (y(0), y′(0)) to the general solution and solving for every constant — it is the unique solution satisfying both the ODE and the initial data of the IVP.
What is the characteristic equation method?
For y″+ay′+by=0, assume y=e^(rt). Substituting gives the characteristic equation r²+ar+b=0. Solve this quadratic for r. Three cases: (1) Δ=a²−4b>0: distinct real roots → y=C₁e^(r₁t)+C₂e^(r₂t). (2) Δ=0: repeated root r=−a/2 → y=(C₁+C₂t)e^(rt). (3) Δ<0: complex roots p±qi → y=e^(pt)(C₁cos(qt)+C₂sin(qt)). Apply ICs to find C₁, C₂.
How do complex roots give oscillating solutions?
When Δ<0, roots are complex: r=p±qi. Euler's formula e^(iθ)=cos(θ)+i·sin(θ) converts e^((p+qi)t) into e^(pt)[cos(qt)+i·sin(qt)]. Taking real and imaginary parts gives two real linearly independent solutions: e^(pt)cos(qt) and e^(pt)sin(qt). The general real solution is y=e^(pt)(C₁cos(qt)+C₂sin(qt)), which oscillates at frequency q. The factor e^(pt) determines damping (p<0), growth (p>0), or pure oscillation (p=0).
What does this calculator NOT solve?
This IVP calculator handles only linear ODEs with constant coefficients. It does NOT solve: nonlinear ODEs (e.g. y′=y²), systems of ODEs, variable-coefficient equations (e.g. t·y″+y=0, Euler-Cauchy equations), non-homogeneous equations with non-constant forcing (e.g. y″+y=sin(t)). For those, use the Laplace transform method at our Inverse Laplace Transform Calculator, or Wolfram Alpha for a full CAS.
What is an initial value problem?
An initial value problem (IVP) is a differential equation plus enough initial conditions to uniquely determine the solution. For first-order ODEs, one condition y(0)=y₀ is needed. For second-order, two conditions y(0)=y₀ and y′(0)=y′₀ are needed. The initial conditions select one particular solution from the general solution's family of infinitely many solutions.
What is the particular solution of a differential equation?
The particular solution is the unique solution to an IVP obtained by substituting the initial conditions into the general solution and solving for all arbitrary constants. For example, y″+4y=0 has general solution y=C₁cos(2t)+C₂sin(2t). Applying y(0)=0 gives C₁=0; applying y′(0)=2 gives C₂=1; so the particular solution is y=sin(2t) — completely determined with no free parameters.
How do you solve a first order linear ODE y′+ay=b?
The general solution is y=b/a+C·e^(−at) for a≠0. The term b/a is the equilibrium (steady-state) value; C·e^(−at) is the transient that decays (if a>0) or grows (if a<0). Applying y(0)=y₀ gives C=y₀−b/a. So the particular solution is y=b/a+(y₀−b/a)·e^(−at). For a=0: y′=b, integrate to get y=y₀+bt.

Related Calculators

Solution Forms
y'+ay=b → y=b/a+Ce^(-at)First order linear
Δ>0 → C₁e^(r₁t)+C₂e^(r₂t)Distinct real roots
Δ=0 → (C₁+C₂t)e^(rt)Repeated root r=−a/2
Δ<0 → e^(pt)(C₁cos+C₂sin)Complex pair p±qi
y_p=c/b (non-homog)Constant particular solution
Δ = a² − 4bDiscriminant of char. eq.
p=−a/2, q=√(4b−a²)/2Complex root parts
Quick Examples
y′+2y=6, y(0)=1
y″+5y′+6y=0 (distinct)
y″+4y=0 (complex→sin)
y″+4y′+4y=0 (repeated)
y″+3y′+2y=4 (non-homog)

Share This Tool

Share the IVP Calculator!

Free chemistry, physics, biology & math calculators with step-by-step solutions. Trusted by 100,000+ students. Solve any science problem instantly!

Newsletter

Subscribe to our Newsletter to be updated. We promise not to spam.

Copyright © 2026 SciSolveLab. All Rights Reserved

Scroll to Top