Constant vs Variable Coefficients

A Side-by-Side Comparison of Solution Behavior

What's the Difference?

In the study of second-order differential equations, one of the most important distinctions is whether the equation has constant coefficients or variable coefficients. This difference fundamentally changes how we solve the equation and what the solutions look like.

Constant Coefficients

$$ay'' + by' + cy = f(x)$$ $$\text{where } a, b, c \text{ are numbers}$$
  • System doesn't change: The "spring" properties are fixed
  • Analogy: Like a spring with constant stiffness
  • Solution method: Characteristic equation (algebraic!)
  • Typical solutions: Exponentials and sinusoids
  • Examples: Most mechanical oscillators, LC circuits

Variable Coefficients

$$a(x)y'' + b(x)y' + c(x)y = f(x)$$ $$\text{where coefficients depend on } x$$
  • System changes: Properties vary as we move along x
  • Analogy: Like a tapered spring that changes stiffness with position
  • Solution method: Euler equations, reduction of order, power series
  • Typical solutions: Power functions, logarithmic, oscillations on log scale
  • Examples: Beams with varying cross-section, Bessel equations

Worked Example Part 1: Exponential vs Power Solutions

Consider these two different second-order ODEs. The first has constant coefficients, the second is an Euler equation (a special variable-coefficient case). Both have the same complexity (repeated root / double root), but their solutions are fundamentally different.

Example A: Constant Coefficient

Example A

Solve: $$y'' - 2y' + y = 0$$

  1. Form the characteristic equation: Replace $y''$ with $r^2$, $y'$ with $r$, and $y$ with $1$:
    $$r^2 - 2r + 1 = 0$$
  2. Factor:
    $$(r-1)^2 = 0$$
  3. Find roots: Double root $r = 1$ (repeated with multiplicity 2)
  4. Write the general solution: For a repeated root $r = m$, the solution is:
    $$y = (C_1 + C_2 x)e^{rx} = (C_1 + C_2 x)e^{x}$$
General Solution
$$y = (C_1 + C_2 x)e^{x}$$

This is exponential growth (or decay if $r < 0$), possibly damped by the linear term.

Example B: Euler Equation (Variable Coefficient)

Example B

Solve the Euler equation: $$x^2 y'' - 2xy' + 2y = 0$$

  1. Identify the Euler form: This is an Euler equation of the form $ax^2 y'' + bxy' + cy = 0$ with $a=1$, $b=-2$, $c=2$.
  2. Try the solution form $y = x^r$: Then:
    • $y' = rx^{r-1}$
    • $y'' = r(r-1)x^{r-2}$
  3. Substitute into the equation:
    $$x^2 \cdot r(r-1)x^{r-2} - 2x \cdot rx^{r-1} + 2x^r = 0$$
    $$r(r-1)x^r - 2rx^r + 2x^r = 0$$
    Divide by $x^r$ (which is never zero):
    $$r(r-1) - 2r + 2 = 0$$
  4. Form the indicial equation:
    $$r^2 - r - 2r + 2 = 0$$ $$r^2 - 3r + 2 = 0$$
  5. Factor and solve:
    $$(r-1)(r-2) = 0 \quad \Rightarrow \quad r = 1 \text{ or } r = 2$$
  6. Write the general solution: For two distinct roots $r_1$ and $r_2$:
    $$y = C_1 x^{r_1} + C_2 x^{r_2} = C_1 x + C_2 x^2$$
General Solution
$$y = C_1 x + C_2 x^2$$

This is polynomial growth—pure power functions, not exponentials.

Key Comparison Points

Theorem
  • Constant coefficient equation: Yields $y = (C_1 + C_2 x)e^{x}$ — exponential-type solutions with the linear coefficient modulating amplitude.
  • Euler equation: Yields $y = C_1 x + C_2 x^2$ — pure polynomial solutions, no exponentials.
  • Both are 2nd order: Both have exactly 2 linearly independent solutions (as required).
  • Solution method difference: Constant coefficient is purely algebraic (characteristic equation). Euler equations require recognizing the form and making the substitution $y = x^r$.
  • Growth rate: Exponential $e^x$ grows much faster than polynomial $x^2$ for large $x$.

Interactive Comparison: Exponential vs Polynomial

Use the sliders below to adjust the constants $C_1$ and $C_2$ in both solutions. Watch how the exponential solution grows much faster than the polynomial solution.

1.0
0.5
1.0
0.5

Example A: $(C_1 + C_2 x)e^x$

Example B: $C_1 x + C_2 x^2$

Observation

Notice how the left plot (exponential) can quickly become very large or very negative, while the right plot (polynomial) changes more gradually. This is why exponential equations are often used to model rapid growth (population, investment) while polynomial solutions appear in geometric/structural problems.

Worked Example Part 2: Oscillation Patterns

Now consider equations with complex roots, which produce oscillatory solutions. Again, constant coefficients and Euler equations show dramatically different behavior.

Example C: Constant Coefficient with Oscillation

Example C

Solve: $$y'' + 4y = 0$$

  1. Characteristic equation:
    $$r^2 + 4 = 0 \quad \Rightarrow \quad r^2 = -4 \quad \Rightarrow \quad r = \pm 2i$$
  2. Complex roots: $\alpha = 0$ (real part), $\beta = 2$ (imaginary part)
  3. General solution: For complex roots $\alpha \pm \beta i$:
    $$y = e^{\alpha x}(C_1 \cos(\beta x) + C_2 \sin(\beta x))$$
    $$y = e^{0 \cdot x}(C_1 \cos(2x) + C_2 \sin(2x))$$
    $$y = C_1 \cos(2x) + C_2 \sin(2x)$$
General Solution
$$y = C_1 \cos(2x) + C_2 \sin(2x)$$

Pure harmonic oscillation with constant amplitude. The solution oscillates forever without decay or growth.

Example D: Euler Equation with "Oscillation"

Example D

Solve the Euler equation: $$x^2 y'' + xy' + 4y = 0$$

  1. Euler form: $a=1$, $b=1$, $c=4$. Try $y = x^r$.
  2. Indicial equation:
    $$r(r-1) + r + 4 = 0$$ $$r^2 - r + r + 4 = 0$$ $$r^2 + 4 = 0$$ $$r = \pm 2i$$
  3. Complex roots in Euler equations: For complex roots $\alpha \pm \beta i$, the general solution is:
    $$y = x^\alpha \left(C_1 \cos(\beta \ln|x|) + C_2 \sin(\beta \ln|x|)\right)$$
    With $\alpha = 0$ and $\beta = 2$:
    $$y = x^0 \left(C_1 \cos(2 \ln|x|) + C_2 \sin(2 \ln|x|)\right)$$
    $$y = C_1 \cos(2 \ln|x|) + C_2 \sin(2 \ln|x|)$$
General Solution
$$y = C_1 \cos(2 \ln|x|) + C_2 \sin(2 \ln|x|)$$

Oscillation on a logarithmic scale. As $x$ increases, the oscillations become more compressed (closer together on the linear x-axis).

Key Comparison Points

Theorem
  • Constant coefficient oscillation: $y = C_1 \cos(2x) + C_2 \sin(2x)$ — regular, uniform oscillations with constant period.
  • Euler oscillation: $y = C_1 \cos(2\ln|x|) + C_2 \sin(2\ln|x|)$ — oscillations compressed by logarithmic scaling.
  • Physical interpretation: The logarithmic argument $\ln|x|$ means oscillations crowd together as $x \to \infty$. This appears in problems with natural length scales that change (like beams that taper).
  • Amplitude: Constant coefficient: constant. Euler: also constant in amplitude, but the frequency changes with $x$ due to the logarithm.

Interactive Comparison: Uniform Oscillation vs Logarithmic Oscillation

Adjust the sliders to see how the oscillation patterns differ. On the left, notice the evenly spaced peaks. On the right, peaks get closer together as x increases.

1.0
0.5
1.0
0.5

Example C: $C_1 \cos(2x) + C_2 \sin(2x)$

Example D: $C_1 \cos(2\ln x) + C_2 \sin(2\ln x)$

Key Insight

The logarithmic argument in Example D creates a frequency compression effect. Mathematically, as $x$ increases, the function $\ln x$ grows slowly, so the argument of the trig functions advances slowly. This means oscillations become more tightly packed on a linear x-axis. This behavior is essential for modeling tapered structures and systems where the "natural frequency" depends on position.

When Do Variable Coefficients Appear in Engineering?

Variable coefficient ODEs are not just abstract mathematical exercises—they appear constantly in real-world applications where system properties vary with position or time.

Structural Engineering

Tapered Beam: A cantilever beam with varying cross-section has bending stiffness $EI(x)$ that depends on position. The governing equation is:

$$\frac{d^2}{dx^2}\left[EI(x)\frac{d^2 y}{dx^2}\right] = q(x)$$

If $E$ is constant but $I(x)$ varies (tapered), this becomes a variable-coefficient ODE.

Mechanical Engineering

Torsion in Tapered Shaft: A shaft that tapers from a large diameter to a small diameter has varying torque capacity $GJ(x)$:

$$\frac{d}{dx}\left[GJ(x)\frac{d\theta}{dx}\right] = 0$$

Atmospheric Science

Density Gradient: In the atmosphere, density $\rho(z)$ varies dramatically with altitude. Wave propagation equations become:

$$\frac{d^2 u}{dz^2} + \rho(z)u = 0$$

Economics & Finance

Time-Varying Interest Rates: In portfolio optimization or bond valuation, interest rates $r(t)$ change over time, leading to variable-coefficient rate equations.

Electrical Engineering

Transmission Lines: Non-uniform transmission lines have resistance $R(x)$, inductance $L(x)$, capacitance $C(x)$, and conductance $G(x)$ that vary along the line:

$$\frac{\partial V}{\partial x} + R(x)I + L(x)\frac{\partial I}{\partial t} = 0$$

Heat Transfer & Diffusion

Variable Thermal Conductivity: In composite materials, thermal conductivity $k(x)$ varies by region:

$$\frac{d}{dx}\left[k(x)\frac{dT}{dx}\right] + Q(x) = 0$$

Summary Comparison Table

Here is a complete side-by-side comparison of the key features:

Feature Constant Coefficient Variable Coefficient
Differential Form $ay'' + by' + cy = f(x)$ $a(x)y'' + b(x)y' + c(x)y = f(x)$
Parameters $a, b, c$ are constants (numbers) $a(x), b(x), c(x)$ depend on $x$
Primary Solution Method Characteristic equation (algebraic) Euler equations, reduction of order, power series, or special substitutions
Typical Homogeneous Solutions $e^{rx}$, $xe^{rx}$, $e^{\alpha x}\cos(\beta x)$, $e^{\alpha x}\sin(\beta x)$ $x^r$, $x^r \ln x$, $\cos(r \ln x)$, $\sin(r \ln x)$, power series $\sum a_n x^n$
Solution Growth Exponential or constant-amplitude oscillation Polynomial, logarithmic, or compressed oscillation
Difficulty Level Straightforward (purely algebraic) More advanced (requires recognition and special techniques)
Uniqueness & Existence Guaranteed globally Depends on the form; some variable-coefficient equations have singularities
Engineering Analogy System with fixed parameters (e.g., ideal spring) System that changes over position or time (e.g., tapered beam, varying density)
Linearization / Stability Stability determined by sign of real parts of roots Stability can depend on the specific form and domain

Key Takeaways

Main Differences at a Glance

1. Coefficients: Constant coefficients don't depend on $x$; variable coefficients do.

2. Solution Methods:

  • Constant coefficient → Characteristic equation → Exponentials and sinusoids
  • Variable coefficient → Problem-specific methods (Euler, series, etc.) → Power functions and special forms

3. Real-World Applicability: Variable-coefficient equations are crucial in engineering whenever system properties vary (tapered structures, non-uniform materials, varying density, time-dependent parameters).

4. Solution Behavior: Exponential growth is much faster than polynomial growth. Oscillations in variable-coefficient systems can be compressed or expanded depending on the coefficients.

5. Complexity: Constant coefficient equations have a standard, mechanical solution procedure. Variable coefficient equations often require deeper insight and problem-specific techniques.

For Further Study

If you need to solve variable-coefficient equations, consider:

  • Euler Equations: Look for the form $x^2 y'' + axy' + by = 0$. Substitute $y = x^r$.
  • Reduction of Order: If you know one solution $y_1(x)$, find a second solution using $y_2 = v(x)y_1(x)$.
  • Power Series Methods: For general variable-coefficient equations around ordinary or singular points.
  • Numerical Methods: When analytical solutions are impossible, use Runge–Kutta or shooting methods.