Skip to main content
Engineering LibreTexts

2.4: Solving first-order differential equations

  • Page ID
    103429
  • \( \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}\)

    Several mathematical techniques are important in dynamics, and for that reason we dedicate space to repeat them in this textbook. Here we discuss solving differential equations and in the next section we discuss complex numbers. In the next chapter we discuss vectors and linear algebra methods.

    In kinematics we will often encounter ordinary differential equations (ODEs) that need to be solved in order to analyse the motion of objects. Solving an ODE always involves finding an unknown function \(y(x)\) based on a known ODE. The function \(y(x)\) has a dependent variable \(y\) like the position \(s\), speed \(v\) or acceleration \(a\) of a point, and an independent variable \(x\), which can be the time \(t\), position \(s\) or velocity \(v\) of the point. Realise that while in mathematics courses you usually only deal with variables \(y\) and \(x\), in dynamics different variables are used, like \(s, v, a\) and \(t\).

    Although we will deal with second order ODEs in Ch. 13, in most of this textbook we will deal with first-order ODEs that contain a known function \(f(x)\) (for instance a known position \(s(t)\) ) and the unknown function \(y(x)\) that we want to determine. The ODE can occur in either of these forms:

    \[\begin{align} & \frac{\mathrm{d} f(x)}{\mathrm{d} x}=y(x) \tag{2.12} \label{2.12}\\[4pt] & \frac{\mathrm{d} y(x)}{\mathrm{d} x}=f(x) \tag{2.13} \label{2.13}\end{align}\]

    The convenient aspect of these first-order differential equations is that they can be solved using differentiation and integration. In case of an ODE of the form of Equation 2.12, the solution can be found by taking the derivative of the known function \(f(x)\) to find the solution of the ODE \(y(x)=\frac{\mathrm{d} f(x)}{\mathrm{d} x}\). For the second case shown in Equation 2.13 solving the ODE requires integration, and can either be carried out by using the indefinite integral, or by using the definite integral. We will outline both integration procedures. In the following three subsections we discuss the basic differentiation and integration techniques in some more detail.

    2.4.1 Differentiation by chain and product rule

    When dealing with an explicit function of time \(v_{s}(t)\) taking the derivative is straightforward, e.g. \(a_{s}(t)=\frac{\mathrm{d} v_{s}(t)}{\mathrm{d} t}\). However, when dealing with functions that are implicit functions of time like \(v_{s}(s)\), where the time dependence of the position \(s\) is given by \(s(t)\), the chain rule is needed. In that case we use the
    chain rule like this:

    \[a_{s}(t)=\frac{\mathrm{d} v_{s}(s(t))}{\mathrm{d} t}=\frac{\mathrm{d} v_{s}(s)}{\mathrm{d} s} \frac{\mathrm{d} s(t)}{\mathrm{d} t} \tag{2.14} \label{2.14}\]

    Sometimes the product rule for differentiation is also needed:

    \[\frac{\mathrm{d} F(t) \cdot v(t)}{\mathrm{d} t}=\frac{\mathrm{d} F}{\mathrm{~d} t} \cdot v(t)+F(t) \cdot \frac{\mathrm{d} v}{\mathrm{~d} t} \tag{2.15} \label{2.15}\]

    2.4.2 Indefinite integral

    In case of Equation 2.13 the ODE can be solved by integration using the indefinite integral to obtain \(y(x)\) as follows:

    \[\begin{align} \frac{\mathrm{d} y(x)}{\mathrm{d} x} & =f(x) \tag{2.16} \label{2.16}\\[4pt] \mathrm{d} y & =f(x) \mathrm{d} x \tag{2.17} \label{2.17}\\[4pt] \int \mathrm{d} y & =\int f(x) \mathrm{d} x \tag{2.18} \label{2.18}\\[4pt] y(x) & =F(x)+c_{1} \tag{2.19} \label{2.19}\end{align}\]

    Here, \(F(x)\) is a primitive function of \(f(x)\) such that \(\frac{\mathrm{d} F}{\mathrm{~d} x}=f(x)\) and \(c_{1}\) is an unknown integration constant. This constant can be determined if the value of \(y\) is known for one value of \(x=x_{0}\). E.g. if \(y\left(x_{0}\right)=y_{0}\), then we have \(y_{0}=F\left(x_{0}\right)+c_{1}\), from which we find the value of the integration constant \(c_{1}=y_{0}-F\left(x_{0}\right)\) and by substituting this value of \(c_{1}\) in Equation 2.19 the full solution of the ODE is found to be \(y(x)=\left[F(x)-F\left(x_{0}\right)\right]+y_{0}\).

    2.4.3 Definite integral

    Besides taking the indefinite integral, one can also choose to use a definite integral to solve the ODE, which is often a bit shorter, since the known condition \(y\left(x_{0}\right)=y_{0}\) can be directly taken as one of the boundaries of the definite integral. The definite integral is obtained as follows:

    \[\begin{align} \frac{\mathrm{d} y(x)}{\mathrm{d} x} & =f(x) \tag{2.20} \label{2.20}\\[4pt] \mathrm{d} y & =f(x) \mathrm{d} x \tag{2.21} \label{2.21}\\[4pt] \int_{y\left(x_{0}\right)}^{y(x)} \mathrm{d} y_{i} & =\int_{x_{0}}^{x} f\left(x_{i}\right) \mathrm{d} x_{i} \tag{2.22} \label{2.22}\\[4pt] {\left[y_{i}\right]_{y_{0}}^{y} } & =\left[F\left(x_{i}\right)\right]_{x_{0}}^{x} \tag{2.23} \label{2.23}\\[4pt] y-y_{0} & =F(x)-F\left(x_{0}\right) \tag{2.24} \label{2.24}\\[4pt] y(x) & =\left[F(x)-F\left(x_{0}\right)\right]+y_{0} \tag{2.25} \label{2.25}\end{align}\]

    Note that since the definite integral evaluates the difference \(F(x)-F\left(x_{0}\right)\), any integration constant \(c_{1}\), that appeared in the indefinite integral Equation 2.19, is automatically eliminated and does not need to be determined. Eventually the result of both methods, indefinite or definite integration, is of course identical. When taking a definite integral, it is essential to ensure that the boundaries of the integrals on the left and right side of the equation are corresponding to identical points of the curve \(y(x): y_{0}=y\left(x_{0}\right)\) and \(y=y(x)\). Note that we have used the variable \(x\) as the upper boundary of the definite integral, which allows us to find the function \(y(x)\) for any value of \(x\). Note also that for clarity when taking the integral on both sides we have replaced the variables \(x\) and \(y\) inside the integral by the variables \(x_{i}\) and \(y_{i}\) (the result of the integral is of course independent of the symbol we choose to integrate over), to clearly distinguish them from the integration boundaries \(x\) and \(y\). We take the integral of the function \(f\left(x_{i}\right)\) over the variable \(x_{i}\), that runs from \(x_{0}\) up to \(x\). Or, in other words, with the definite integral we determine the area under the \(f\left(x_{i}\right)\) graph, for values of \(x_{i}\) running from \(x_{i}=x_{0}\) to \(x_{i}=x\). If the integral runs from \(x_{i}=x_{1}\) to \(x_{i}=x_{2}\), Equation 2.22 can also be written in the following form, that we will use regularly:

    \[y\left(x_{2}\right)=y\left(x_{1}\right)+\int_{x_{1}}^{x_{2}} f\left(x_{i}\right) \mathrm{d} x_{i} \tag{2.26} \label{2.26}\]

    From this equation it is clear that if the value of \(y\) is known at one value of \(x_{1}\), then \(y\left(x_{1}\right)\) can be determined such that evaluation of the integral enables us to determine \(y\left(x_{2}\right)\) at any other value \(x_{2}\).


    This page titled 2.4: Solving first-order differential equations is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Peter G. Steeneken via source content that was edited to the style and standards of the LibreTexts platform.