Skip to main content
Mathematics LibreTexts

17.3: First Order Linear Equations

  • Page ID
    4843
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    As you might guess, a first order linear differential equation has the form \(\dot y + p(t)y = f(t)\). Not only is this closely related in form to the first order homogeneous linear equation, we can use what we know about solving homogeneous equations to solve the general linear equation.

    Suppose that \(y_1(t)\) and \(y_2(t)\) are solutions to \(\dot y + p(t)y = f(t)\). Let \(g(t)=y_1-y_2\). Then

    \[\eqalign{
    g'(t)+p(t)g(t)&=y_1'-y_2'+p(t)(y_1-y_2)\cr
    &=(y_1'+p(t)y_1)-(y_2'+p(t)y_2)\cr
    &=f(t)-f(t)=0.\cr}\]

    In other words, \(g(t)=y_1-y_2\) is a solution to the homogeneous equation \(\dot y + p(t)y = 0\). Turning this around, any solution to the linear equation \(\dot y + p(t)y = f(t)\), call it \(y_1\), can be written as \(y_2+g(t)\), for some particular \(y_2\) and some solution \(g(t)\) of the homogeneous equation \(\dot y + p(t)y = 0\). Since we already know how to find all solutions of the homogeneous equation, finding just one solution to the equation \(\dot y + p(t)y = f(t)\) will give us all of them.

    How might we find that one particular solution to \(\dot y + p(t)y = f(t)\)? Again, it turns out that what we already know helps. We know that the general solution to the homogeneous equation \(\dot y + p(t)y = 0\) looks like \(Ae^{P(t)}\). We now make an inspired guess: consider the function \(v(t)e^{P(t)}\), in which we have replaced the constant parameter \(A\) with the function \(v(t)\). This technique is called variation of parameters. For convenience write this as \(s(t)=v(t)h(t)\) where \( h(t)=e^{P(t)}\) is a solution to the homogeneous equation. Now let's compute a bit with \(s(t)\):

    $$\eqalign{
    s'(t)+p(t)s(t)&=v(t)h'(t)+v'(t)h(t)+p(t)v(t)h(t)\cr
    &=v(t)(h'(t)+p(t)h(t)) + v'(t)h(t)\cr
    &=v'(t)h(t).\cr}
    \]

    The last equality is true because \(h'(t)+p(t)h(t)=0\), since \(h(t)\) is a solution to the homogeneous equation. We are hoping to find a function \(s(t)\) so that \(s'(t)+p(t)s(t)=f(t)\); we will have such a function if we can arrange to have \(v'(t)h(t)=f(t)\), that is, \(v'(t)=f(t)/h(t)\). But this is as easy (or hard) as finding an anti-derivative of \(f(t)/h(t)\). Putting this all together, the general solution to \(\dot y + p(t)y = f(t)\) is

    $$v(t)h(t)+Ae^{P(t)} = v(t)e^{P(t)}+Ae^{P(t)}.\]

    Example \(\PageIndex{1}\)

    Find the solution of the initial value problem \(\dot y+3y/t=t^2\), \(y(1)=1/2\).

    Solution

    First we find the general solution; since we are interested in a solution with a given condition at \(t=1\), we may assume \(t>0\). We start by solving the homogeneous equation as usual; call the solution \(g\):

    \[g=Ae^{-\int (3/t)\,dt}=Ae^{-3\ln t}=At^{-3}.\]

    Then as in the discussion, \(h(t)=t^{-3}\) and \(v'(t)=t^2/t^{-3}=t^5\), so \(v(t)=t^6/6\). We know that every solution to the equation looks like

    \[(v(t)t^{-3}+At^{-3}={t^6\over6}t^{-3}+At^{-3}={t^3\over6}+At^{-3}.\]

    Finally we substitute to find \(A\):

    \[\eqalign{
    {1\over 2}&={(1)^3\over6}+A(1)^{-3}={1\over6}+A\cr
    A&={1\over 2}-{1\over6}={1\over3}.\cr}
    \]

    The solution is then

    \[y={t^3\over6}+{1\over3}t^{-3}.\]

    Here is an alternate method for finding a particular solution to the differential equation, using an integrating factor. In the differential equation \(\dot y+p(t)y=f(t)\), we note that if we multiply through by a function \(I(t)\) to get \(I(t)\dot y+I(t)p(t)y=I(t)f(t)\), the left hand side looks like it could be a derivative computed by the product rule:

    $${d\over dt}(I(t)y)=I(t)\dot y+I'(t)y.\]

    Now if we could choose \(I(t)\) so that \(I'(t)=I(t)p(t)\), this would be exactly the left hand side of the differential equation. But this is just a first order homogeneous linear equation, and we know a solution is \(I(t)=e^{Q(t)}\), where \(Q(t)=\int p\,dt\); note that \(Q(t)=-P(t)\), where \(P(t)\) appears in the variation of parameters method and \(P'(t)=-p\). Now the modified differential equation is

    $$
    \eqalign{
    e^{-P(t)}\dot y+e^{-P(t)}p(t)y&=e^{-P(t)}f(t)\cr
    {d\over dt}(e^{-P(t)}y)&=e^{-P(t)}f(t).\cr
    }\]

    Integrating both sides gives

    $$
    \eqalign{
    e^{-P(t)}y&=\int e^{-P(t)}f(t)\,dt\cr
    y&=e^{P(t)}\int e^{-P(t)}f(t)\,dt.\cr
    }\]

    If you look carefully, you will see that this is exactly the same solution we found by variation of parameters, because \(e^{-P(t)}f(t)=f(t)/h(t)\).

    Some people find it easier to remember how to use the integrating factor method than variation of parameters. Since ultimately they require the same calculation, you should use whichever of the two you find easier to recall. Using this method, the solution of the previous example would look just a bit different: Starting with \(\dot y+3y/t=t^2\), we recall that the integrating factor is \(e^{\int 3/t} =e^{3\ln t}=t^3\). Then we multiply through by the integrating factor and solve:

    $$\eqalign{
    t^3\dot y+t^3 3y/t&=t^3t^2\cr
    t^3\dot y+t^2 3y&=t^5\cr
    {d\over dt}(t^3 y)&=t^5\cr
    t^3 y&=t^6/6\cr
    y&=t^3/6.\cr}
    \]

    This is the same answer, of course, and the problem is then finished just as before.

    Contributors


    This page titled 17.3: First Order Linear Equations is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by David Guichard via source content that was edited to the style and standards of the LibreTexts platform.