The equation and its general solution
Before you start: you need higher-order derivatives and the roots of quadratic and cubic polynomials.
Write \(D\) for \(\dfrac{d}{dx}\), so \(D^2y = y''\). A linear equation with constant coefficients looks like \[a_0\frac{d^ny}{dx^n} + a_1\frac{d^{n-1}y}{dx^{n-1}} + \cdots + a_ny = X \quad\text{or}\quad f(D)\,y = X,\] where the \(a_i\) are constants and \(X\) is a function of \(x\).
\[y = \text{CF} + \text{PI}\]
The complementary function (CF) solves \(f(D)y = 0\) and holds \(n\) arbitrary constants. The particular integral (PI) is any one solution of \(f(D)y = X\), with no constants.
Why this works: \(f(D)\) is linear, so \(f(D)(\text{CF} + \text{PI}) = 0 + X = X\). And since \(D\,e^{mx} = m\,e^{mx}\), we get \(f(D)\,e^{mx} = f(m)\,e^{mx}\). So \(e^{mx}\) solves \(f(D)y = 0\) exactly when \(f(m) = 0\). That polynomial equation \(f(m) = 0\) is the auxiliary equation.
The complementary function
| Roots of \(f(m) = 0\) | Part of the CF |
|---|---|
| Real and distinct \(m_1, m_2\) | \(c_1e^{m_1x} + c_2e^{m_2x}\) |
| Real, repeated twice: \(m, m\) | \((c_1 + c_2x)\,e^{mx}\) |
| Real, repeated three times | \((c_1 + c_2x + c_3x^2)\,e^{mx}\) |
| Complex \(\alpha \pm i\beta\) | \(e^{\alpha x}(c_1\cos\beta x + c_2\sin\beta x)\) |
| Complex \(\alpha \pm i\beta\), repeated | \(e^{\alpha x}\big[(c_1 + c_2x)\cos\beta x + (c_3 + c_4x)\sin\beta x\big]\) |
A repeated root needs the extra factor \(x\) because \(c_1e^{mx} + c_2e^{mx}\) is really one constant times \(e^{mx}\). You would be one solution short.
Particular integral: the short methods
\(\text{PI} = \dfrac{1}{f(D)}X\), where \(\dfrac{1}{D}\) means integrate once. For the usual right-hand sides there are shortcuts.
\(X = e^{ax}\): \(\dfrac{1}{f(D)}e^{ax} = \dfrac{e^{ax}}{f(a)}\) if \(f(a) \ne 0\). If \(f(a) = 0\), use \(\dfrac{x\,e^{ax}}{f'(a)}\); if \(f'(a) = 0\) too, use \(\dfrac{x^2e^{ax}}{f''(a)}\).
\(X = \sin ax\) or \(\cos ax\): write \(f(D)\) in terms of \(D^2\) where you can and replace \(D^2\) by \(-a^2\). If that gives zero (the case \(\dfrac{1}{D^2 + a^2}\)): \[\frac{1}{D^2 + a^2}\sin ax = -\frac{x}{2a}\cos ax, \qquad \frac{1}{D^2 + a^2}\cos ax = \frac{x}{2a}\sin ax\]
\(X = x^n\): write \(\dfrac{1}{f(D)} = [1 \pm \phi(D)]^{-1}\) after taking out the constant term, expand by the binomial series up to \(D^n\), and apply it to \(x^n\).
\(X = e^{ax}V\): \(\dfrac{1}{f(D)}e^{ax}V = e^{ax}\dfrac{1}{f(D + a)}V\). Move \(e^{ax}\) to the front and shift \(D\) to \(D + a\).
If a single \(D\) is left after replacing \(D^2\) by \(-a^2\), multiply top and bottom to bring \(D^2\) into the denominator, as in Example 6. Never replace \(D\) itself by \(-a^2\).
Solved examples
Example 1: Real distinct roots
EasySolve \(y'' - 5y' + 6y = 0\).
- Auxiliary equation: \(m^2 - 5m + 6 = 0\), so \((m - 2)(m - 3) = 0\) and \(m = 2, 3\).
Answer\(y = c_1e^{2x} + c_2e^{3x}\)
Example 2: Complex roots
EasySolve \((D^2 + 2D + 5)\,y = 0\).
- \(m = \dfrac{-2 \pm \sqrt{4 - 20}}{2} = -1 \pm 2i\). So \(\alpha = -1\), \(\beta = 2\).
Answer\(y = e^{-x}(c_1\cos 2x + c_2\sin 2x)\)
Example 3: A repeated root in a cubic
MediumSolve \((D^3 - 3D^2 + 4)\,y = 0\).
- Try \(m = -1\): \(-1 - 3 + 4 = 0\). So \((m + 1)\) is a factor.
- Divide: \(m^3 - 3m^2 + 4 = (m + 1)(m^2 - 4m + 4) = (m + 1)(m - 2)^2\).
- Roots \(-1, 2, 2\). The repeated root gets \((c_2 + c_3x)\).
Answer\(y = c_1e^{-x} + (c_2 + c_3x)\,e^{2x}\)
Example 4: Exponential right side, with initial conditions
MediumSolve \(y'' - 3y' + 2y = e^{3x}\), \(y(0) = 1\), \(y'(0) = 0\).
- \(m^2 - 3m + 2 = 0\) gives \(m = 1, 2\). CF \(= c_1e^x + c_2e^{2x}\).
- PI \(= \dfrac{e^{3x}}{9 - 9 + 2} = \dfrac{e^{3x}}{2}\).
- \(y(0) = 1\): \(c_1 + c_2 + \tfrac{1}{2} = 1\). \(y'(0) = 0\): \(c_1 + 2c_2 + \tfrac{3}{2} = 0\).
- Subtracting, \(c_2 = -2\), and then \(c_1 = \tfrac{5}{2}\).
Answer\(y = \tfrac{5}{2}e^x - 2e^{2x} + \tfrac{1}{2}e^{3x}\)
Example 5: The failure case f(a) = 0
MediumSolve \((D^2 - 3D + 2)\,y = e^{2x}\).
- CF \(= c_1e^x + c_2e^{2x}\), as in Example 4.
- \(f(2) = 4 - 6 + 2 = 0\), so the plain rule fails. \(f'(D) = 2D - 3\) and \(f'(2) = 1\).
- PI \(= \dfrac{x\,e^{2x}}{f'(2)} = x\,e^{2x}\).
Answer\(y = c_1e^x + c_2e^{2x} + x\,e^{2x}\)
Example 6: A sine on the right
MediumFind the PI of \((D^2 + D + 1)\,y = \sin 2x\).
- Replace \(D^2\) by \(-4\): \(\dfrac{1}{-4 + D + 1}\sin 2x = \dfrac{1}{D - 3}\sin 2x\).
- Multiply top and bottom by \(D + 3\): \(\dfrac{D + 3}{D^2 - 9}\sin 2x = \dfrac{(D + 3)\sin 2x}{-13}\).
- \((D + 3)\sin 2x = 2\cos 2x + 3\sin 2x\).
AnswerPI \(= -\dfrac{2\cos 2x + 3\sin 2x}{13}\)
Example 7: A polynomial on the right
Exam levelSolve \((D^2 + D - 2)\,y = x^2\).
- \(m^2 + m - 2 = (m + 2)(m - 1)\), so CF \(= c_1e^x + c_2e^{-2x}\).
- Take out \(-2\) and expand: \[\text{PI} = -\frac{1}{2}\left[1 - \frac{D + D^2}{2}\right]^{-1}x^2 = -\frac{1}{2}\left[1 + \frac{D + D^2}{2} + \frac{(D + D^2)^2}{4} + \cdots\right]x^2\]
- Keep terms up to \(D^2\): \(1 + \dfrac{D}{2} + \dfrac{D^2}{2} + \dfrac{D^2}{4} = 1 + \dfrac{D}{2} + \dfrac{3D^2}{4}\).
- Apply to \(x^2\): \(x^2 + x + \tfrac{3}{2}\). Multiply by \(-\tfrac{1}{2}\).
Answer\(y = c_1e^x + c_2e^{-2x} - \dfrac{x^2}{2} - \dfrac{x}{2} - \dfrac{3}{4}\)
Example 8: The shift rule meets a failure case
Exam levelSolve \((D^2 - 2D + 5)\,y = e^x\cos 2x\).
- \(m = 1 \pm 2i\), so CF \(= e^x(c_1\cos 2x + c_2\sin 2x)\).
- Shift \(D\) to \(D + 1\): PI \(= e^x\dfrac{1}{(D + 1)^2 - 2(D + 1) + 5}\cos 2x\).
- The denominator simplifies to \(D^2 + 4\), so PI \(= e^x\dfrac{1}{D^2 + 4}\cos 2x\).
- Replacing \(D^2\) by \(-4\) gives zero, so use the failure formula: \(\dfrac{1}{D^2 + 4}\cos 2x = \dfrac{x}{4}\sin 2x\).
Answer\(y = e^x(c_1\cos 2x + c_2\sin 2x) + \dfrac{x}{4}e^x\sin 2x\)
Before you touch the PI, write the CF and look at it. If the right-hand side already appears in the CF (like \(e^{2x}\) in Example 5 or \(e^x\cos 2x\) in Example 8), you know straight away it is a failure case and an extra \(x\) is coming.
Common mistakes
1. One constant for a repeated root
For roots \(2, 2\), writing \(y = c_1e^{2x} + c_2e^{2x}\) is wrong: that is just \((c_1 + c_2)e^{2x}\). The correct CF is \((c_1 + c_2x)\,e^{2x}\).
2. Mixing up \(\alpha\) and \(\beta\)
For roots \(-1 \pm 2i\), writing \(e^{2x}(c_1\cos x + c_2\sin x)\) puts the numbers in the wrong places. The real part goes in the exponential and the imaginary part goes inside the sine and cosine: \(e^{-x}(c_1\cos 2x + c_2\sin 2x)\).
3. Ignoring \(f(a) = 0\)
For \((D^2 - 3D + 2)y = e^{2x}\), the formula \(\dfrac{e^{2x}}{f(2)}\) divides by zero. Writing \(\text{PI} = e^{2x}\) instead is wrong: \(e^{2x}\) is part of the CF, so \(f(D)\,e^{2x} = 0\), not \(e^{2x}\). The PI is \(x\,e^{2x}\).
Practice questions
Try each one on paper before you open the answer.
Q1Solve \(y'' + y' - 6y = 0\).
\(m^2 + m - 6 = (m + 3)(m - 2)\).
\(y = c_1e^{2x} + c_2e^{-3x}\).
Q2Solve \((D^4 - 1)\,y = 0\).
\(m^4 - 1 = (m - 1)(m + 1)(m^2 + 1)\), roots \(\pm 1, \pm i\).
\(y = c_1e^x + c_2e^{-x} + c_3\cos x + c_4\sin x\).
Q3Solve \((D^2 + 4)\,y = \sin 2x\).
Failure case: PI \(= -\dfrac{x}{4}\cos 2x\).
\(y = c_1\cos 2x + c_2\sin 2x - \dfrac{x}{4}\cos 2x\).
Q4Solve \((D^2 - 4)\,y = e^{2x} + x\).
\(f(2) = 0\), \(f'(2) = 4\): first PI \(= \dfrac{x\,e^{2x}}{4}\). Second: \(-\dfrac{1}{4}\left(1 - \dfrac{D^2}{4}\right)^{-1}x = -\dfrac{x}{4}\).
\(y = c_1e^{2x} + c_2e^{-2x} + \dfrac{x\,e^{2x}}{4} - \dfrac{x}{4}\).
Q5Solve \((D^2 + 3D + 2)\,y = \sin x\).
Replace \(D^2\) by \(-1\): \(\dfrac{1}{3D + 1}\sin x = \dfrac{(3D - 1)\sin x}{9D^2 - 1}\). Now \(9D^2 \to -9\), so this is \(\dfrac{3\cos x - \sin x}{-10}\).
\(y = c_1e^{-x} + c_2e^{-2x} + \dfrac{\sin x - 3\cos x}{10}\).
Q6Solve \((D - 2)^2\,y = x^2e^{2x}\).
Shift: PI \(= e^{2x}\dfrac{1}{D^2}x^2 = e^{2x}\dfrac{x^4}{12}\).
\(y = \left(c_1 + c_2x + \dfrac{x^4}{12}\right)e^{2x}\).
Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.
Frequently asked questions
What is the auxiliary equation?
The polynomial equation \(f(m) = 0\) you get by replacing \(D\) with \(m\) in \(f(D)y = 0\). Its roots decide the form of the complementary function.
What is the difference between the CF and the PI?
The CF solves the equation with zero on the right and carries all the arbitrary constants. The PI is one particular solution of the full equation. The general solution is their sum.
What do you do when f(a) = 0?
Multiply by \(x\) and differentiate the denominator: \(\dfrac{1}{f(D)}e^{ax} = \dfrac{x\,e^{ax}}{f'(a)}\). If \(f'(a) = 0\) as well, use \(\dfrac{x^2e^{ax}}{f''(a)}\).
How do you write the CF for complex roots?
For roots \(\alpha \pm i\beta\), the CF is \(e^{\alpha x}(c_1\cos\beta x + c_2\sin\beta x)\). This comes from \(e^{(\alpha + i\beta)x}\) and Euler's formula, written with real functions.