Mathematics
Linear differential equation solver with constant coefficients
Enter the coefficients and the right-hand side f(x): get the characteristic equation, the complementary function, a particular integral by undetermined coefficients and, with initial conditions, the solution of the initial value problem with its graph.
Linear equations with constant coefficients
A differential equation ties a function to its derivatives. The linear ones with constant coefficients, a·y″ + b·y′ + c·y = f(x), describe springs, RLC and RC circuits and decay: they are the first met at school and university. The general solution is the sum of the complementary function, solving f = 0, and any particular integral.
For the homogeneous equation try y = e^(rx): substituting leaves the characteristic equation a·r² + b·r + c = 0. Two real roots give two exponentials, a double root r gives (C₁ + C₂x)·e^(rx), two complex roots α ± iβ give e^(αx)(C₁ cos βx + C₂ sin βx), an oscillation that decays or grows.
The particular integral is found by undetermined coefficients: try a function of the same form as the right-hand side with unknown coefficients. For y″ + 3y′ + 2y = 4x + e^(−x), try Ax + B and, since e^(−x) already solves the homogeneous equation, K·x·e^(−x): the result is 2x − 3 + x·e^(−x). The initial conditions then fix the constants.
Common mistakes
- Forgetting to multiply by x at resonance: the trial Ke^(−x) would give 0 = e^(−x), impossible.
- Applying the initial conditions to the complementary function alone instead of the full solution.
- Writing complex roots as two real exponentials: sine and cosine of βx are needed.
Frequently asked questions
What is an initial value problem?
The equation together with initial conditions, the value of y and, for second order, of y′ at a point x₀. They fix the constants and make the solution unique.
What if the right-hand side is different, say ln x?
Undetermined coefficients works only for polynomials, exponentials, sines, cosines and their products. Other cases need variation of parameters, which often leads to non-elementary integrals.
What do complex roots represent?
An oscillation: the imaginary part β is the angular frequency, and the real part α says whether the amplitude decays (α < 0), grows (α > 0) or stays constant (α = 0).
How this calculation works
Homogeneous: a·r² + b·r + c = 0. Δ > 0: y = C₁e^(r₁x) + C₂e^(r₂x); Δ = 0: y = (C₁ + C₂x)e^(rx); Δ < 0: y = e^(αx)(C₁ cos βx + C₂ sin βx). Particular for f = xᵏe^(mx) cos(ωx) or sin(ωx): write f as the real part of e^(λx)G(x), λ = m + iω, and seek y = Re[e^(λx)R(x)] with a·R″ + (2aλ + b)R′ + p(λ)R = G, multiplying R by x^s when λ is a characteristic root of multiplicity s. The initial conditions give a linear system in C₁ and C₂.
Related calculators
Complex numbers
Operations, rectangular, polar and exponential form, powers and n-th roots, with the Argand diagram.
Linear and quadratic equations
Roots, discriminant, vertex and factored form of ax² + bx + c = 0.
Factoring polynomials
Common factor, the factor theorem, special products and quadratics: factoring a polynomial step by step.
Integrals
The antiderivative of a function and the definite integral between two limits.