NARROW DISPLAY WARNING
You are most likely using a tablet or mobile device in portrait orientation. This website is best viewed using a typical computer screen with the browser window maximized.
Viewing this website in portrait orientation can cause problems with equations being longer than the screen width (you can scroll to the right), images being poorly sized, and the font size of maths text being much smaller than regular text. If your only option is a tablet or mobile device, your viewing experience will be better if you view this website in landscape orientation. You might need to refresh the page to fix any problems after rotating.
Variation of Parameters is a method to find the particular solution of a non-homogeneous linear ODE when the homogeneous solutions are known, which is more powerful than the Method of Undetermined Coefficients since this can solve for any non-homogeneous term if the integrals can be evaluated. The formula requires the homogenous solutions and evaluating some integrals. This page is focused on second order ODEs, but the method applies to higher order ODEs as well.
Given a non-homogeneous linear ODE with its two homogeneous solutions $y_{1}(x)$ and $y_{2}(x)$,
\begin{equation} y''+p(x)y'+q(x)y=g(x) \end{equation}The formula for the particular solution $y_{p}(x)$ is,
\begin{equation} y_{p}(x) = - y_{1}(x)\int \frac{y_{2}(x)g(x)}{W(y_{1},y_{2})} \text{ d}x + y_{2}(x)\int \frac{y_{1}(x)g(x)}{W(y_{1},y_{2})} \text{ d}x \end{equation}Where $W(y_{1},y_{2})$ is the Wrońskian.
Find the particular solution to the following differential equation.
\begin{equation} x^{2}y''-2xy'+2y=\sqrt{x} \qquad y_{1} = x \quad y_{2} = x^{2} \end{equation}Find the particular solution to the following differential equation.
\begin{equation} y'' + 4y = \tan(x) \qquad y_{1} = \cos(2x) \quad y_{2} = \sin(2x) \end{equation}Find the particular solution to the following differential equation.
\begin{equation} x^{2}y'' - 2xy' - (x^{2}-2)y = 3x^{3} \qquad y_{1} = e^{x} \quad y_{2} = e^{-x} \end{equation}Given a non-homogeneous linear ODE with its two homogeneous solutions $y_{1}(x)$ and $y_{2}(x)$,
\begin{equation} y''+p(x)y'+q(x)y=g(x) \end{equation}The derivation of the formula is based on two assumptions that just happen to work. The first assumption is to make up two unknown functions $u_{1}(x)$ and $u_{2}(x)$ that satisfy the following equation.
\begin{equation} y_{p}(x) = u_{1}(x)y_{1}(x) + u_{2}(x)y_{2}(x) = u_{1}y_{1} + u_{2}y_{2} \end{equation}Since there's one equation but two unknown functions $u_{1}(x)$ and $u_{2}(x)$, another equation is assumed so that there are two equations and two unknowns, so there could still be a way to solve for the unknown $u_{1}(x)$ and $u_{2}(x)$ functions.
\begin{equation} u_{1}'y_{1} + u_{2}'y_{2} = 0 \end{equation}