Second-Order Non-Homogeneous Differential Equations
Combining a complementary function with a particular integral, and handling trial-form clashes.
Non-homogeneous equations
For $a\dfrac{d^2y}{dx^2}+b\dfrac{dy}{dx}+cy=f(x)$ with $f(x)\not\equiv0$, the general solution is $y=y_{CF}+y_{PI}$, where $y_{CF}$ (the complementary function) solves the associated homogeneous equation, and $y_{PI}$ (a particular integral) is any single function satisfying the full equation.
| Form of $f(x)$ | Form of particular integral |
|---|---|
| $p$ | $\lambda$ |
| $p+qx$ | $\lambda+\mu x$ |
| $p+qx+rx^2$ | $\lambda+\mu x+\nu x^2$ |
| $pe^{kx}$ | $\lambda e^{kx}$ |
| $p\cos\omega x+q\sin\omega x$ | $\lambda\cos\omega x+\mu\sin\omega x$ |
If the trial form already appears in the complementary function, multiply the trial by $x$ (or $x^2$ for a repeated clash) before substituting.
Complementary function: $m^2-2m-8=0\Rightarrow(m-4)(m+2)=0\Rightarrow m=4,-2$, so $y_{CF}=Ae^{4x}+Be^{-2x}$.
Particular integral: try $y_{PI}=\lambda+\mu x$, so $y_{PI}'=\mu$, $y_{PI}''=0$.
Substitute: $0-2\mu-8(\lambda+\mu x)=4x-1$.
Compare $x$ coefficients: $-8\mu=4\Rightarrow\mu=-\dfrac12$. Compare constants: $-2\mu-8\lambda=-1\Rightarrow1-8\lambda=-1\Rightarrow\lambda=\dfrac14$.
General solution: $y=Ae^{4x}+Be^{-2x}+\dfrac14-\dfrac12x$.
Complementary function: $m^2-5m+6=0\Rightarrow(m-2)(m-3)=0\Rightarrow y_{CF}=Ae^{2x}+Be^{3x}$.
Since $e^{2x}$ already appears in $y_{CF}$, the naive trial $\lambda e^{2x}$ would fail. Try instead $y_{PI}=\lambda xe^{2x}$.
$y_{PI}'=\lambda e^{2x}+2\lambda xe^{2x}$
$y_{PI}''=4\lambda e^{2x}+4\lambda xe^{2x}$
Substitute: $(4\lambda e^{2x}+4\lambda xe^{2x})-5(\lambda e^{2x}+2\lambda xe^{2x})+6\lambda xe^{2x}=4e^{2x}$.
The $xe^{2x}$ terms cancel ($4\lambda-10\lambda+6\lambda=0$), leaving $(4\lambda-5\lambda)e^{2x}=4e^{2x}\Rightarrow-\lambda=4\Rightarrow\lambda=-4$.
So $y_{PI}=-4xe^{2x}$.
Exam-style questions
Question 1 8 marks
Find the general solution to $\dfrac{d^2y}{dx^2}+4y=\cos2x$.
$m^2+4=0\Rightarrow m=\pm2i\Rightarrow y_{CF}=A\cos2x+B\sin2x$. (M1, A1)
Since $\cos2x$ clashes with $y_{CF}$, try $y_{PI}=x(\lambda\cos2x+\mu\sin2x)$. (M1)
Differentiating twice and substituting (working through the product rule carefully) leads to $-4\lambda\sin2x+4\mu\cos2x=\cos2x$, so $\lambda=0,\mu=\dfrac14$. (M1, A1, A1)
General solution: $y=A\cos2x+B\sin2x+\dfrac14x\sin2x$. (A1, A1)
Question 2 6 marks
Find the general solution to $\dfrac{d^2y}{dx^2}-9y=18$.
$m^2-9=0\Rightarrow m=\pm3\Rightarrow y_{CF}=Ae^{3x}+Be^{-3x}$. (M1, A1)
Try $y_{PI}=\lambda$: $-9\lambda=18\Rightarrow\lambda=-2$. (M1, A1)
General solution: $y=Ae^{3x}+Be^{-3x}-2$. (A1, A1)