2.5.4 Problem (e)
Internal
problem
ID
[20980]
Book
:
Ordinary
Differential
Equations.
By
Wolfgang
Walter.
Graduate
texts
in
Mathematics.
Springer.
NY.
QA372.W224
1998
Section
:
Chapter
1.
First
order
equations:
Some
integrable
cases.
Excercises
IX
at
page
45
Problem
number
:
(e)
Date
solved
:
Saturday, November 29, 2025 at 01:23:41 AM
CAS
classification
:
[_linear]
Solved using first_order_ode_linear
Time used: 0.022 (sec)
Solve
\begin{align*}
y^{\prime }+p \left (x \right ) y&=q \left (x \right ) \\
\end{align*}
In canonical form a linear first order is
\begin{align*} y^{\prime } + q(x)y &= p(x) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(x) &=p \left (x \right )\\ p(x) &=q \left (x \right ) \end{align*}
The integrating factor \(\mu \) is
\[ \mu = {\mathrm e}^{\int p \left (x \right )d x} \]
Therefore the solution is
\[ y = \left (\int q \left (x \right ) {\mathrm e}^{\int p \left (x \right )d x}d x +c_1 \right ) {\mathrm e}^{-\int p \left (x \right )d x} \]
Summary of solutions found
\begin{align*}
y &= \left (\int q \left (x \right ) {\mathrm e}^{\int p \left (x \right )d x}d x +c_1 \right ) {\mathrm e}^{-\int p \left (x \right )d x} \\
\end{align*}
✓ Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=diff(y(x),x)+p(x)*y(x) = q(x);
dsolve(ode,y(x), singsol=all);
\[
y = \left (\int q \left (x \right ) {\mathrm e}^{\int p \left (x \right )d x}d x +c_1 \right ) {\mathrm e}^{-\int p \left (x \right )d x}
\]
Maple trace
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
<- 1st order linear successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )+p \left (x \right ) y \left (x \right )=q \left (x \right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=-p \left (x \right ) y \left (x \right )+q \left (x \right ) \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y \left (x \right )\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )+p \left (x \right ) y \left (x \right )=q \left (x \right ) \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (\frac {d}{d x}y \left (x \right )+p \left (x \right ) y \left (x \right )\right )=\mu \left (x \right ) q \left (x \right ) \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (y \left (x \right ) \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (\frac {d}{d x}y \left (x \right )+p \left (x \right ) y \left (x \right )\right )=\left (\frac {d}{d x}y \left (x \right )\right ) \mu \left (x \right )+y \left (x \right ) \left (\frac {d}{d x}\mu \left (x \right )\right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \frac {d}{d x}\mu \left (x \right ) \\ {} & {} & \frac {d}{d x}\mu \left (x \right )=\mu \left (x \right ) p \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )={\mathrm e}^{\int p \left (x \right )d x} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (y \left (x \right ) \mu \left (x \right )\right )\right )d x =\int \mu \left (x \right ) q \left (x \right )d x +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \left (x \right ) \mu \left (x \right )=\int \mu \left (x \right ) q \left (x \right )d x +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \left (x \right ) \\ {} & {} & y \left (x \right )=\frac {\int \mu \left (x \right ) q \left (x \right )d x +\mathit {C1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )={\mathrm e}^{\int p \left (x \right )d x} \\ {} & {} & y \left (x \right )=\frac {\int {\mathrm e}^{\int p \left (x \right )d x} q \left (x \right )d x +\mathit {C1}}{{\mathrm e}^{\int p \left (x \right )d x}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y \left (x \right )={\mathrm e}^{-\int p \left (x \right )d x} \left (\int {\mathrm e}^{\int p \left (x \right )d x} q \left (x \right )d x +\mathit {C1} \right ) \end {array} \]
✓ Mathematica. Time used: 0.055 (sec). Leaf size: 51
ode=D[y[x],x]+p[x]*y[x]==q[x];
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \exp \left (\int _1^x-p(K[1])dK[1]\right ) \left (\int _1^x\exp \left (-\int _1^{K[2]}-p(K[1])dK[1]\right ) q(K[2])dK[2]+c_1\right ) \end{align*}
✓ Sympy. Time used: 2.352 (sec). Leaf size: 41
from sympy import *
x = symbols("x")
y = Function("y")
p = Function("p")
q = Function("q")
ode = Eq(p(x)*y(x) - q(x) + Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
\[
\left (e^{\int p{\left (x \right )}\, dx} - \int p{\left (x \right )} e^{\int p{\left (x \right )}\, dx}\, dx\right ) y{\left (x \right )} + \int \left (p{\left (x \right )} y{\left (x \right )} - q{\left (x \right )}\right ) e^{\int p{\left (x \right )}\, dx}\, dx = C_{1}
\]