Complementary Solution Partially Known
For a general second-order linear ODE (again with variable coefficients):
\begin{align}
\frac{d^2y}{dx^2} + a_1(x)\frac{dy}{dx} + a_0(x)y = f(x) \tag{1}
\end{align}
If we happen to know one of its complementary solutions to the homogeneous part, let’s say \( u(x) = y_c(x) \), then we can let \( y = u(x)v(x) \) and (1) will be transformed into an ODE in \(v\) of one order lower and will be often easier to solve.
Example
Find the general solution to the ODE
\begin{align}
(x+2)\frac{d^2y}{dx^2} +2x\frac{dy}{dx} + (x -2)y = e^{-x} \tag{2}
\end{align}
There is a simple guess that we can often try: \( y_c = Ae^{\alpha x} \) and thus \( d^ky_c/dx^k = \alpha^k Ae^{\alpha x} \). Plugging in for the homogeneous part gives:
\begin{align}
(x+2)\alpha^2 Ae^{\alpha x} +2x\alpha Ae^{\alpha x} + (x -2) Ae^{\alpha x} &= 0 \\
\alpha^2 (x+2)+2\alpha x + (x -2) &= 0 \tag{3}
\end{align}
It is easy to see that the choice \( \alpha = -1 \) causes the polynomial coefficients to vanish and hence \( y_c = e^{-x} \) is a complementary solution. Now we can let \( y = e^{-x}v(x) \), and thus
\begin{align}
\begin{aligned}
y’ &= (e^{-x}v)’ \\
&= e^{-x}v’ -e^{-x}v \\
y^{\prime\prime} &= (e^{-x}v’ -e^{-x}v)’ \\
&= e^{-x}v^{\prime\prime} -2e^{-x}v’ + e^{-x}v
\end{aligned} \tag{4}
\end{align}
Substituting these into (2) leads to
\begin{align}
\begin{aligned}
&(x+2)(e^{-x}v^{\prime\prime} -2e^{-x}v’ + e^{-x}v)\\
&+2x(e^{-x}v’ -e^{-x}v) + (x -2)e^{-x}v
\end{aligned} &= e^{-x} \\
(x+2)(v^{\prime\prime} -2v’ + v) +2x(v’ -v) + (x -2)v &= 1 \\
(x+2)v^{\prime\prime} -4v’ &= 1 \tag{5}
\end{align}
Let \( w = v’ \), then it is reduced to a first-order linear ODE that can be solved with an integrating factor:
\begin{align}
(x+2)w’ -4w &= 1 \\
w’ -\frac{4}{x+2}w &= \frac{1}{x+2} \\
e^{-\int 4/(x+2) dx} (w’ -\frac{4}{x+2}w) &= \frac{e^{-\int 4/(x+2) dx}}{x+2} \\
\frac{d}{dx} (w e^{-4 \ln (x+2)}) &= \frac{e^{-4 \ln (x+2)}}{x+2} = \frac{1}{(x+2)^4(x+2)} \\
\frac{w}{(x+2)^4} &= \int \frac{1}{(x+2)^5} dx = -\frac{1}{4(x+2)^4} + B \\
w &= -\frac{1}{4} + B(x+2)^4 \tag{6}
\end{align}
then
\begin{align}
v = \int w dx &= \int (-\frac{1}{4} + B(x+2)^4) dx \\
&= -\frac{x}{4} + \frac{B}{5}(x+2)^5 + A \tag{7}
\end{align}
and finally we retrieve
\begin{align}
y = uv &= e^{-x}(-\frac{x}{4} + B(x+2)^5 + A) \\
&= Ae^{-x} + Be^{-x}(x+2)^5 -\frac{xe^{-x}}{4} \tag{8}
\end{align}
(absorbed the \( 1/5 \) factor into \( B \))
Exercise
Derive the general solution to the ODE
\begin{align}
(x^2 -1)\frac{d^2y}{dx^2} -x\frac{dy}{dx} + y = \frac{1}{x} \tag{9}
\end{align}
by noting that \( u(x) = x \) is a complementary solution.
Answer
Let \( y = uv = xv \), then
\begin{align}
\begin{aligned}
y’ &= (xv)’ \\
&= xv’ + v \\
y^{\prime\prime} &= (xv’ + v)’ \\
&= xv^{\prime\prime} + 2v’
\end{aligned}
\end{align}
and the ODE becomes
\begin{align}
(x^2 -1)(xv^{\prime\prime} + 2v’) -x(xv’ + v) + xv &= \frac{1}{x} \\
x(x^2 -1)v^{\prime\prime} + (x^2 -2)v’ &= \frac{1}{x}
\end{align}
Take \( w = v’ \):
\begin{align}
x(x^2 -1)w’ + (x^2 -2)w &= \frac{1}{x} \\
w’ + \frac{x^2-2}{x(x^2-1)}w &= \frac{1}{x^2(x^2-1)} \\
w’ + \left( \frac{2}{x} -\frac{1}{2(x+1)} -\frac{1}{2(x-1)} \right)w &= -\frac{1}{x^2} -\frac{1}{2(x+1)} + \frac{1}{2(x-1)}
\end{align}
by partial fractions. The integrating factor is then
\begin{align}
&\exp(\int (\frac{2}{x} -\frac{1}{2(x+1)} -\frac{1}{2(x-1)}) dx) \\
={}& \exp(2 \ln x -\frac{1}{2}\ln(x+1) -\frac{1}{2}\ln(x-1)) \\
={}& \frac{x^2}{\sqrt{(x+1)(x-1)}} = \frac{x^2}{\sqrt{x^2-1}}
\end{align}
Putting this back to the ODE for \( w \):
\begin{align}
(\frac{x^2}{\sqrt{x^2-1}}w)’ &= \frac{1}{x^2(x^2-1)}(\frac{x^2}{\sqrt{x^2-1}}) \\
\frac{x^2}{\sqrt{x^2-1}}w &= \int \frac{1}{(x^2-1)^{3/2}} dx \\
\end{align}
The integral on the R.H.S. can be found by trigonometric substitution \( x = \sec t \), \( dx = \sec t \tan t dt\):
\begin{align}
\int \frac{1}{(x^2-1)^{3/2}} dx &= \int \frac{1}{(\sec^2 t-1)^{3/2}} \sec t \tan t dt \\
&= \int \frac{1}{(\tan^2 t)^{3/2}} \sec t \tan t dt \\
&= \int \sec t \cot^2 t dt \\
&= \int \csc t \cot t dt \\
&= -\csc t + B \\
&= -\csc (\sec^{-1} x) + B = -\frac{x}{\sqrt{x^2 -1}} + B
\end{align}
assuming \( x > 1 \). Hence the ODE is now solved as
\begin{align}
\frac{x^2}{\sqrt{x^2-1}}w &= -\frac{x}{\sqrt{x^2 -1}} + B \\
w &= -\frac{1}{x} + B\frac{\sqrt{x^2-1}}{x^2}
\end{align}
and
\begin{align}
v &= \int w dx \\
&= \int (-\frac{1}{x} + B\frac{\sqrt{x^2-1}}{x^2}) dx \\
&= -\ln x + B\int \frac{\sqrt{x^2-1}}{x^2} dx
\end{align}
Again, we use a trigonometric substitution of \( x = \sec t \), \( dx = \sec t \tan t dt\) for the last integral:
\begin{align}
&\int \frac{\sqrt{x^2-1}}{x^2} dx \\
={}& \int \frac{\sqrt{\sec^2 t-1}}{\sec^2 t} \sec t \tan t dt \\
={}& \int \frac{\tan t}{\sec t} \tan t dt \\
={}& \int \sin t \tan t dt \\
={}& -\int \tan t d(\cos t) \\
={}& -[\cos t \tan t] + \int \cos t d(\tan t) &\text{(Integrating by Parts)} \\
={}& -\sin t + \int \cos t \sec^2 t dt \\
={}& -\sin t + \int \frac{1}{\cos^2 t} d(\sin t) \\
={}& -\sin t + \int \frac{1}{1 -\sin^2 t} d(\sin t) \\
={}& -\sin t + \tanh^{-1} (\sin t) + A
\end{align}
by noting that \( d(\tanh^{-1} u)/du = 1/(1-u^2) \). Recovering \( x \) then leads to
\begin{align}
\int \frac{\sqrt{x^2-1}}{x^2} dx &= -\frac{\sqrt{x^2-1}}{x} + \tanh^{-1} (\frac{\sqrt{x^2-1}}{x}) + A
\end{align}
\begin{align}
v &= -\ln x + B(-\frac{\sqrt{x^2-1}}{x} + \tanh^{-1} (\frac{\sqrt{x^2-1}}{x}) + A) \\
&= -\ln x + A + B\left(\tanh^{-1} (\frac{\sqrt{x^2-1}}{x}) -\frac{\sqrt{x^2-1}}{x}\right)
\end{align}
(grouping \( AB \rightarrow A \)), and the final answer is
\begin{align}
y = xv = -x\ln x + Ax + B\left(x\tanh^{-1} (\frac{\sqrt{x^2-1}}{x}) -\sqrt{x^2-1}\right)
\end{align}








Leave a Reply