# Solve differential equation using 'variation of parameters'

Given the differential equation $L \ u = f$, with $$L \ u = a_2(t) \frac{d^2u}{dt^2}+a_1(t)\frac{du}{dt}+a_0(t)u$$ with $a_i(t)$ sufficiently smooth and $a_2(t) \neq 0$ for every $t$. Suppose that $u_0$ is a solution to the homogenenous equation $L \ u=0$, with $u_0(t)\neq0$ for every $t$. How can I then use the variation of parameters method by Lagrange to find the solution $u =u_0v$ ? And how can I find the general solution if the equation isn't homogeneous?

Update: I've substituted $u=u_0v$ into the equation and found a new $2^{nd}$ order differential equation of the form $$f = \frac{d^2v}{dt^2}(a_2(t)u_0)+\frac{dv}{dt}(2a_2(t)u_0'+a_1(t)u_0)+va_0(t)u_0$$ which I'm supposed to solve for $w$ using $w=v'$. But I don't seem to be able to proceed as I'm not sure how to solve the system $$$$\begin{split} w =&\ v'\\ w'a_2(t)u_0+w(2a_2(t)u_0'+a_1(t)u_0)+v(a_0(t)u_0)=&\ f\ \\ \end{split}$$$$

Here is how we can solve the homogeneous equation $$L u = 0$$. Once we have both solutions of this equation, we can use the method of variation of parameters to find a solution to $$L u = f$$.

First we calculate derivatives of the solution $$u = u_0 v$$ that you suggested: $$u' = u_0' v + u_0 v'$$ $$u'' = u_0'' v + 2 u_0' v' + u_0 v''$$ Next, because $$u = u_0 v$$ is a solution to the homogeneous equation $$a_2(t) u'' + a_1(t) u' + a_0(t) u = 0$$ we have: $$a_2(t) (u_0'' v + 2 u_0' v' + u_0 v'') + a_1(t) (u_0' v + u_0 v') + a_0(t) u_0 v = 0$$ We can re-arrange the terms and the equation in terms of $$v$$ and its derivatives: $$a_2(t) u_0 v'' + (2 a_2(t) u_0' + a_1(t) u_0) v' + (a_2(t) u_0'' + a_1(t) u_0' + a_0(t) u_0) v = 0$$ Now, because $$u_0$$ satisfies the equation $$L u = 0$$ , the coefficient of $$v$$ is zero, and the equation becomes: $$a_2(t) u_0 v'' + (2 a_2(t) u_0' + a_1(t) u_0) v' = 0$$ This looks like a second order equation, but it can be solved as a first order equation, if we take $$w = v'$$ : $$a_2(t) u_0 w' + (2 a_2(t) u_0' + a_1(t) u_0) w = 0$$ From here, we solve this equation for $$w$$, calculate the integral of $$w$$ to find $$v$$, and multiply $$v$$ by $$u_0$$ to find the solution $$u$$.

With

$$L(u) = u''+\frac{a_1}{a_2} u'+\frac{a_0}{a_2} u=u''+b_1 u'+b_0 u$$

given a non null $$u_0(t)$$ such that $$L(u_0) = 0$$ being a second order $$L$$, we can obtain another independent solution $$L(u_1) = 0$$ as follows: if $$c_0$$ is a generic constant then $$L(c_0u_0) = 0$$ so choose $$u_1 = c_0(t)u_0$$ then we have

$$L(c_0(t)u_0) = c_0(t)L(u_0) + u_0c''_0+(b_1u_0+2u'_0)c'_0=u_0c''_0+(b_1u_0+2u'_0)c'_0=0$$

making $$\phi = c'_0$$ we have a first order DE as $$\frac{\phi'}{\phi} + \frac{u_0}{(b_1u_0+2u'_0)}=0$$ so obtaining $$\phi\to u_1$$ is direct.

Having $$u_0, u_1$$ for the homogeneous case, let us approach the case $$L(u) = \frac{f}{a_2(t)}$$. The method of variation of constants now will be applied to

$$L(c_0(t)u_0+c_1(t)u_1)=\frac{f}{a_2(t)}$$

so developing

$$L(c_0(t)u_0+c_1(t)u_1)=c_0L(u_0)+c_1L(u_1) + u_0c''_0+(b_1u_0+2u'_0)c'_0+c''_1u_1+(b_1u_1+2u'_1)c'_1-\frac{f}{a_2(t)}=0$$

Here as $$c_0, c_1$$ are independent we can choose them as

$$\cases{ u_0c''_0+(b_1u_0+2u'_0)c'_0-\frac{f}{a_2(t)}=0\\ c''_1u_1+(b_1u_1+2u'_1)c'_1=0 }$$

finally determining $$c_1(t), c_2(t)$$ for the non-homogeneous case.