We introduce an ultimate method dealing with non-homogeneous second order linear DEs. It is difficult to apply undetermined coefficients method to the DE
$$y'' + 4y = 3\csc t \quad (\csc t = 1/\sin t).$$Example. We modify the complementary function
$$y(t) = c_1\cos 2t + c_2\sin 2t,$$for the homogeneous DE
$$y'' + 4y = 0$$by
$$Y(t) = u_1(t)\cos 2t + u_2(t)\sin 2t,$$where $u_1(t)$, $u_2(t)$ are now functions. Then
$$Y' = -2u_1(t)\sin 2t + 2u_2(t)\cos 2t + u_1'\cos 2t + u_2'\sin 2t.$$We now demand
$$u_1'(t)\cos 2t + u_2'\sin 2t = 0. \tag{1}$$Hence
$$Y'' = -4u_1\cos 2t - 4u_2\sin 2t - 2u_1'\sin 2t + 2u_2'\cos 2t.$$Substitute the $Y'$ and $Y''$ into the DE yields
\begin{align} 3\csc t &= Y'' + 4Y \\ &= [-4u_1\cos 2t - 4u_2\sin 2t - 2u_1'\sin 2t + 2u_2'\cos 2t] + 4[u_1(t)\cos 2t + u_2(t)\sin 2t] \\ &= -2u_1'\sin 2t + 2u_2'\cos 2t. \end{align}That is, we have
$$-2u_1'\sin 2t + 2u_2'\cos 2t = 3\csc t. \tag{2}$$That is, the $u_1$, $u_2$ should satisfy the two equations (1) and (2). We deduce from (1) that
$$u_2' = -u_1'\frac{\cos 2t}{\sin 2t}. \tag{3}$$Substitute this into (2) yields
\begin{align} 3\csc t &= -2u_1'\sin 2t - 2u_1'\frac{\cos 2t}{\sin 2t}\cos 2t \\ &= -2u_1'\frac{\sin^2 2t + \cos^2 2t}{\sin 2t} \\ &= -2u_1'\frac{1}{\sin 2t}. \end{align}That is,
$$u_1'(t) = -\frac{3\csc t\sin 2t}{2} = -3\cos t,$$Substitute this into (3) yields
$$u_2'(t) = \frac{3\cos t\cos 2t}{\sin 2t} = \frac{3(1 - 2\sin^2 t)}{2\sin t} = \frac{3}{2}(\csc t - 2\sin t) = \frac{3}{2}\csc t - 3\sin t.$$Thus we deduce
$$u_1(t) = -3\sin t + c_1,$$and
$$u_2(t) = \frac{3}{2}\ln|\csc t - \cot t| + 3\cos t + c_2,$$where we have used the following result in a step above
$$\int \frac{dt}{\sin t} = \int \csc t\,dt = \ln|\csc t - \cot t| = \ln\Big|\tan\frac{t}{2}\Big|.$$We finally have
\begin{align} Y &= u_1\cos 2t + u_2\sin 2t \\ &= (-3\sin t + c_1)\cos 2t + \Big(\frac{3}{2}\ln|\csc t - \cot t| + 3\cos t + c_2\Big)\sin 2t \\ &= -3\sin t\cos 2t + \frac{3}{2}\ln|\csc t - \cot t|\sin 2t + 3\cos t\sin 2t + c_1\cos 2t + c_2\sin 2t \\ &= 3\sin(2t - t) + \frac{3}{2}\ln|\csc t - \cot t|\sin 2t + c_1\cos 2t + c_2\sin 2t \\ &= 3\sin t + \frac{3}{2}\ln|\csc t - \cot t|\sin 2t + c_1\cos 2t + c_2\sin 2t. \end{align}But the terms $c_1\cos 2t + c_2\sin 2t$ can be combined with the complementary function so that the last expression is the general solution to the original DE.
Let $p$, $q$, $g$ be continuous on an open interval $I$. Suppose $y_1$, $y_2$ are a fundamental set of solutions of the homogeneous DE
$$y'' + p(t)y' + q(t)y = g(t),$$that is, when $g(t) \equiv 0$. Then particular integral to the DE is given by
where $t_0$ belongs to $I$. The general solution is given by
$$y(t) = c_1 y_1(t) + c_2 y_2(t) + Y(t).$$The set of $y_1$, $y_2$ is also known as complementary functions of the non-homogeneous equation.
Then
$$Y' = u_1 y_1' + u_2 y_2' + (u_1' y_1 + u_2' y_2).$$We demand the expression coloured in green to vanish identically:
$$u_1' y_1 + u_2' y_2 = 0. \tag{4}$$That is,
$$Y' = u_1 y_1' + u_2 y_2'. \tag{5}$$Hence
$$Y'' = u_1' y_1' + u_2' y_2' + u_1 y_1'' + u_2 y_1''.$$Substitute the $Y'$ and $Y''$ into the DE and note that the blue expressions in blue and red in
\begin{align} g(t) &= y'' + p(t)y' + q(t)y(t) \\ &= u_2 y_1'' + u_1 y_2'' + u_1' y_1' + u_2' y_2' \\ &\quad + pu_1 y_1' + pu_2 y_2' \\ &\quad + qu_1 y_1 + qu_2 y_2 \\ &= 0 + 0 + u_1' y_1' + u_2' y_2' \tag{6} \end{align}both vanish since $y_1$, $y_2$ is a fundamental set of solutions of the homogeneous DE. Multiplying $y_1'$ throughout the (4) and multiplying $y_1$ throughout the (6) yield
\begin{align} u_1' y_1 y_1' + u_2' y_2 y_1' &= 0 \\ u_1' y_1' y_1 + u_2' y_2' y_1 &= y_1 g. \end{align}Subtracting the above equations yields
$$u_2' = \frac{y_1 g}{W(y_1, y_2)}.$$Similarly we can deduce
$$u_1' = -\frac{y_2 g}{W(y_1, y_2)}.$$Integrating the above two equations from a convenient point $t_0$ to $t$ results in the desired formula.
Example. Solve
$$y'' - 5y' + 6y = 2e^t.$$A fundamental set of solutions is given by $\{e^{2t}, e^{3t}\}$. Thus
$$W(e^{2t}, e^{3t}) = \begin{vmatrix} e^{2t} & e^{3t} \\ 2e^{2t} & 3e^{3t} \end{vmatrix} = 3e^{5t} - 2e^{5t} = e^{5t}.$$Hence
\begin{align} Y &= -e^{2t}\int_{t_0}^t \frac{e^{3t}(2e^t)}{e^{5t}}\,dt + e^{3t}\int_{t_0}^t \frac{e^{2t}(2e^t)}{e^{5t}}\,dt \\ &= -e^{2t}\int_{t_0}^t 2e^{-t}\,dt + e^{3t}\int_{t_0}^t 2e^{-2t}\,dt \\ &= 2e^t - 2/2 \cdot e^{(3-2)t} \\ &= e^t. \end{align}We could have used the method of undetermined coefficients method learnt from the last section to solve this DE.
Use the method of variation of parameters to solve each of the following.
Solve for the general solution of the following DEs.
Use variation of parameters to find a particular solution to:
$$y'' - 5y' + 6y = 2e^t$$Given: complementary functions are $y_1 = e^{2t}$, $y_2 = e^{3t}$.
What is $W(y_1, y_2) = W(e^{2t}, e^{3t})$?
By the formula, $u_1' = -\dfrac{y_2 g}{W}$. With $g = 2e^t$, what is $u_1'$?
Similarly, $u_2' = \dfrac{y_1 g}{W}$. What is $u_2'$?
Integrate $u_1' = -2e^{-t}$ to get $u_1$:
Integrate $u_2' = 2e^{-2t}$ to get $u_2$:
The particular solution is $Y = u_1 y_1 + u_2 y_2 = 2e^{-t} \cdot e^{2t} + (-e^{-2t}) \cdot e^{3t}$: