# Solution to first order linear ODE and “variation of parameters”?

I am reading in my textbook about the derivation of the general solution for $$\dfrac{dy}{dx} + P(x)y=f(x)$$

First, the textbook shows that a general solution for this DE is composed by the sum of a particular solution of the DE, $y_p$, and the general solution, $y_c$, of the associated homogeneous equation $\dfrac{dy}{dx} + P(x)y=0$. That is, $$y=y_c+y_p$$

The book proceeds to use separation of variables to conclude $y_c=ce^{-\int P(x)dx}$, and the text assigns $y_1(x)= e^{-\int P(x)dx}$ so that $y_c=cy_1(x)$

Then the book proceeds:

"We can now find a particular solution of equation (2) [the original, non-homogeneous linear ODE] by a procedure known as variation of parameters. The basic idea here is to find a function $u$ so that $y_p=u(x)y_1(x)$....In other words, our assumption for $y_p$ is the same as $y_c=cy_1(x)$ except that $c$ is replaced by the 'variable parameter' $u$."

The book makes it seem that variation of parameters is a common and well established technique for solving DE. Is there a solid reason of why variation of parameters was used, or is it just a technique that we try out, and sometimes works and sometimes doesn't?

Why does the book say "In other words, our assumption for $y_p$ is the same as $y_c=cy_1(x)$"? There always exists such a $u$, which can be expressed as $u(x)=\dfrac{y_p(x)}{y_1(x)}$ (the denominator will never be zero). I don't see the need for using the work "assumption" since I am not sure that we are taking anything for granted. Is this just poor wording for "we set $y_p=u(x)y_1(x)$, which has a similar form as $y_c=cy_1(x)$"?

• I think the book intended the same thing as your modified sentence "we set $y_p=u(x)y_1(x)$, which has similar form as..." Indeed we always can write $y_p$ in that form, but it is still useful to do so. In more complex multi-variable PDE problems you often "assume" a solution $f(x,y)$ has a form $f(x,y)=h(x)g(y)$ (which is not a general form), and then show that form actually works. – Michael Jan 25 '16 at 17:42
• @Michael Is there something that hints us to use variation of parameters, or is it just works or doesn't work sometimes? For example, did the fact that $y=y_c+y_p$ indicate that this problem has characteristics which hint that it is solvable by variation of parameters? – Ovi Jan 25 '16 at 19:02

The intuition behind $y_p(x) = u(x)y_1(x)$ is that when we differentiate using the product rule, we already know something nice about the derivative of $y_1(x)$. It seems to work well in this linear first-order case (which is a large class of problems). I don't know if it will work out for other problems, let's try it for second order linear problems:
Inhomogeneous ODE: $y''(x) + P(x)y'(x) + Q(x)y(x) = f(x)$
Homogeneous version: $y''(x) + P(x)y'(x) + Q(x)y(x) = 0$
Let $y_1(x)$ be a nonzero solution to the homogeneous equation. Let's try the form:
$$\boxed{y(x) = u(x)y_1(x)}$$
Differentiating gives: \begin{align} y(x) &= u(x)y_1(x)\\ y'(x) &= u(x)y_1'(x) + u'(x)y_1(x)\\ y''(x) &= u(x)y_1''(x) + u'(x)y_1'(x) + u''(x)y_1(x) + u'(x)y_1'(x) \end{align} Thus: \begin{align} y''(x) &= u(x)y_1''(x) + 2u'(x)y_1'(x) + u''(x)y_1(x)\\ P(x)y'(x) &= P(x)u(x)y_1'(x) + P(x)u'(x)y_1(x)\\ Q(x)y(x) &= Q(x)u(x)y_1(x) \end{align} Adding the above three equations, setting the result to $f(x)$, and using the fact that $y_1''+Py_1'+Qy_1=0$ gives: $$f(x) = y''(x) + P(x)y'(x) + Q(x)y(x) = u''(x)y_1(x) + u'(x)(2y_1'(x)+P(x)y_1(x))$$ Well now this is pretty nice because we can define $g(x) = u'(x)$ and we get: $$f(x)/y_1(x) = g'(x) + g(x)\left(\frac{2y_1'(x) + P(x)y_1(x)}{y_1(x)}\right)$$ This is in fact a linear (inhomogeneous) first order equation in $g(x)$, so we can solve it. Thus: The technique is also useful here!
• In general, I think this technique can reduce a linear $n$th order inhomegeneous ODE to a linear $(n-1)$th order inhomogeneous ODE. – Michael Jan 25 '16 at 19:39