Internal problem ID [2659]
Internal file name [OUTPUT/2151_Sunday_June_05_2022_02_50_34_AM_23091357/index.tex
]
Book: Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth
edition, 2015
Section: Chapter 1, First-Order Differential Equations. Section 1.6, First-Order Linear Differential
Equations. page 59
Problem number: Problem 21.
ODE order: 1.
ODE degree: 1.
The type(s) of ODE detected by this program : "linear", "first_order_ode_lie_symmetry_lookup"
Maple gives the following as the ode type
[[_linear, `class A`]]
\[ \boxed {y^{\prime }-2 y=\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .} \] With initial conditions \begin {align*} [y \left (0\right ) = 1] \end {align*}
This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}
Where here \begin {align*} p(x) &=-2\\ q(x) &=\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right . \end {align*}
Hence the ode is \begin {align*} y^{\prime }-2 y = \left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right . \end {align*}
The domain of \(p(x)=-2\) is \[
\{-\infty
Entering Linear first order ODE solver. The integrating factor \(\mu \) is \begin{align*}
\mu &= {\mathrm e}^{\int \left (-2\right )d x} \\
&= {\mathrm e}^{-2 x} \\
\end{align*} The ode becomes
\begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left ({\mathrm e}^{-2 x} y\right ) &= \left ({\mathrm e}^{-2 x}\right ) \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right )\\ \mathrm {d} \left ({\mathrm e}^{-2 x} y\right ) &= \left (\left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right ) {\mathrm e}^{-2 x}\right )\, \mathrm {d} x \end {align*}
Integrating gives \begin {align*} {\mathrm e}^{-2 x} y &= \int {\left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right ) {\mathrm e}^{-2 x}\,\mathrm {d} x}\\ {\mathrm e}^{-2 x} y &= \left \{\begin {array}{cc} \frac {{\mathrm e}^{-2 x} \left (2 x -1\right )}{4} & x \le 1 \\ \frac {{\mathrm e}^{-2}}{4} & 1 Dividing both sides by the integrating factor \(\mu ={\mathrm e}^{-2 x}\) results in \begin {align*} y &= {\mathrm e}^{2 x} \left (\left \{\begin {array}{cc} \frac {{\mathrm e}^{-2 x} \left (2 x -1\right )}{4} & x \le 1 \\ \frac {{\mathrm e}^{-2}}{4} & 1 which simplifies to \begin {align*} y &= {\mathrm e}^{2 x} c_{1} +\frac {\left (\left \{\begin {array}{cc} 2 x -1 & x \le 1 \\ {\mathrm e}^{2 x -2} & 1 Initial conditions are used to solve for \(c_{1}\). Substituting \(x=0\) and \(y=1\) in the above solution gives an
equation to solve for the constant of integration. \begin {align*} 1 = c_{1} -\frac {1}{4} \end {align*}
The solutions are \begin {align*} c_{1} = {\frac {5}{4}} \end {align*}
Trying the constant \begin {align*} c_{1} = {\frac {5}{4}} \end {align*}
Substituting this in the general solution gives \begin {align*} y&=\left \{\begin {array}{cc} \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {x}{2}-\frac {1}{4} & x \le 1 \\ \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {{\mathrm e}^{2 x -2}}{4} & 1 The constant \(c_{1} = {\frac {5}{4}}\) gives valid solution.
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= \left \{\begin {array}{cc} \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {x}{2}-\frac {1}{4} & x \le 1 \\ \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {{\mathrm e}^{2 x -2}}{4} & 1 Verification of solutions
\[
y = \left \{\begin {array}{cc} \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {x}{2}-\frac {1}{4} & x \le 1 \\ \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {{\mathrm e}^{2 x -2}}{4} & 1
Writing the ode as \begin {align*} y^{\prime }&=2 y +\left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right )\\ y^{\prime }&= \omega \left ( x,y\right ) \end {align*}
The condition of Lie symmetry is the linearized PDE given by \begin {align*} \eta _{x}+\omega \left ( \eta _{y}-\xi _{x}\right ) -\omega ^{2}\xi _{y}-\omega _{x}\xi -\omega _{y}\eta =0\tag {A} \end {align*}
The type of this ode is known. It is of type ODE class Form \(\xi \) \(\eta \) linear ode \(y'=f(x) y(x) +g(x)\) \(0\) \(e^{\int fdx}\) separable ode \(y^{\prime }=f\left ( x\right ) g\left ( y\right ) \) \(\frac {1}{f}\) \(0\) quadrature ode \(y^{\prime }=f\left ( x\right ) \) \(0\) \(1\) quadrature ode \(y^{\prime }=g\left ( y\right ) \) \(1\) \(0\) homogeneous ODEs of
Class A \(y^{\prime }=f\left ( \frac {y}{x}\right ) \) \(x\) \(y\) homogeneous ODEs of
Class C \(y^{\prime }=\left ( a+bx+cy\right ) ^{\frac {n}{m}}\) \(1\) \(-\frac {b}{c}\) homogeneous class D \(y^{\prime }=\frac {y}{x}+g\left ( x\right ) F\left (\frac {y}{x}\right ) \) \(x^{2}\) \(xy\) First order special
form ID 1 \(y^{\prime }=g\left ( x\right ) e^{h\left (x\right ) +by}+f\left ( x\right ) \) \(\frac {e^{-\int bf\left ( x\right )dx-h\left ( x\right ) }}{g\left ( x\right ) }\) \(\frac {f\left ( x\right )e^{-\int bf\left ( x\right ) dx-h\left ( x\right ) }}{g\left ( x\right ) }\) polynomial type ode \(y^{\prime }=\frac {a_{1}x+b_{1}y+c_{1}}{a_{2}x+b_{2}y+c_{2}}\) \(\frac {a_{1}b_{2}x-a_{2}b_{1}x-b_{1}c_{2}+b_{2}c_{1}}{a_{1}b_{2}-a_{2}b_{1}}\) \(\frac {a_{1}b_{2}y-a_{2}b_{1}y-a_{1}c_{2}-a_{2}c_{1}}{a_{1}b_{2}-a_{2}b_{1}}\) Bernoulli ode \(y^{\prime }=f\left ( x\right ) y+g\left ( x\right ) y^{n}\) \(0\) \(e^{-\int \left ( n-1\right ) f\left ( x\right ) dx}y^{n}\) Reduced Riccati \(y^{\prime }=f_{1}\left ( x\right ) y+f_{2}\left ( x\right )y^{2}\) \(0\) \(e^{-\int f_{1}dx}\) The above table shows that \begin {align*} \xi \left (x,y\right ) &=0\\ \tag {A1} \eta \left (x,y\right ) &={\mathrm e}^{2 x} \end {align*}
The next step is to determine the canonical coordinates \(R,S\). The canonical coordinates map \(\left ( x,y\right ) \to \left ( R,S \right )\)
where \(\left ( R,S \right )\) are the canonical coordinates which make the original ode become a quadrature and
hence solved by integration.
The characteristic pde which is used to find the canonical coordinates is \begin {align*} \frac {d x}{\xi } &= \frac {d y}{\eta } = dS \tag {1} \end {align*}
The above comes from the requirements that \(\left ( \xi \frac {\partial }{\partial x} + \eta \frac {\partial }{\partial y}\right ) S(x,y) = 1\). Starting with the first pair of ode’s in (1)
gives an ode to solve for the independent variable \(R\) in the canonical coordinates, where \(S(R)\). Since
\(\xi =0\) then in this special case \begin {align*} R = x \end {align*}
\(S\) is found from \begin {align*} S &= \int { \frac {1}{\eta }} dy\\ &= \int { \frac {1}{{\mathrm e}^{2 x}}} dy \end {align*}
Which results in \begin {align*} S&= {\mathrm e}^{-2 x} y \end {align*}
Now that \(R,S\) are found, we need to setup the ode in these coordinates. This is done by
evaluating \begin {align*} \frac {dS}{dR} &= \frac { S_{x} + \omega (x,y) S_{y} }{ R_{x} + \omega (x,y) R_{y} }\tag {2} \end {align*}
Where in the above \(R_{x},R_{y},S_{x},S_{y}\) are all partial derivatives and \(\omega (x,y)\) is the right hand side of the original ode
given by \begin {align*} \omega (x,y) &= 2 y +\left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right ) \end {align*}
Evaluating all the partial derivatives gives \begin {align*} R_{x} &= 1\\ R_{y} &= 0\\ S_{x} &= -2 \,{\mathrm e}^{-2 x} y\\ S_{y} &= {\mathrm e}^{-2 x} \end {align*}
Substituting all the above in (2) and simplifying gives the ode in canonical coordinates.
\begin {align*} \frac {dS}{dR} &= \left \{\begin {array}{cc} -\left (x -1\right ) {\mathrm e}^{-2 x} & x <1 \\ 0 & 1\le x \end {array}\right .\tag {2A} \end {align*}
We now need to express the RHS as function of \(R\) only. This is done by solving for \(x,y\) in terms of
\(R,S\) from the result obtained earlier and simplifying. This gives \begin {align*} \frac {dS}{dR} &= \left \{\begin {array}{cc} -\left (R -1\right ) {\mathrm e}^{-2 R} & R <1 \\ 0 & 1\le R \end {array}\right . \end {align*}
The above is a quadrature ode. This is the whole point of Lie symmetry method. It
converts an ode, no matter how complicated it is, to one that can be solved by
integration when the ode is in the canonical coordiates \(R,S\). Integrating the above gives
\begin {align*} S \left (R \right ) = \left \{\begin {array}{cc} \frac {{\mathrm e}^{-2 R} R}{2}-\frac {{\mathrm e}^{-2 R}}{4}+c_{1} & R <1 \\ c_{1} +\frac {{\mathrm e}^{-2}}{4} & 1\le R \end {array}\right .\tag {4} \end {align*}
To complete the solution, we just need to transform (4) back to \(x,y\) coordinates. This results in
\begin {align*} {\mathrm e}^{-2 x} y = \left \{\begin {array}{cc} \frac {x \,{\mathrm e}^{-2 x}}{2}-\frac {{\mathrm e}^{-2 x}}{4}+c_{1} & x <1 \\ c_{1} +\frac {{\mathrm e}^{-2}}{4} & 1\le x \end {array}\right . \end {align*}
Which simplifies to \begin {align*} {\mathrm e}^{-2 x} y-c_{1} -\frac {\left (\left \{\begin {array}{cc} {\mathrm e}^{-2 x} \left (2 x -1\right ) & x <1 \\ {\mathrm e}^{-2} & 1\le x \end {array}\right .\right )}{4} = 0 \end {align*}
Which gives \begin {align*} y = \left \{\begin {array}{cc} \left [{\mathrm e}^{2 x} c_{1} +\frac {x}{2}-\frac {1}{4}\right ] & x <1 \\ \left [\frac {\left (4 c_{1} +{\mathrm e}^{-2}\right ) {\mathrm e}^{2 x}}{4}\right ] & 1\le x \end {array}\right . \end {align*}
The following diagram shows solution curves of the original ode and how they transform in
the canonical coordinates space using the mapping shown.
Original ode in \(x,y\) coordinates
Canonical
coordinates
transformation ODE in canonical coordinates \((R,S)\) \( \frac {dy}{dx} = 2 y +\left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right )\) \( \frac {d S}{d R} = \left \{\begin {array}{cc} -\left (R -1\right ) {\mathrm e}^{-2 R} & R <1 \\ 0 & 1\le R \end {array}\right .\) \(\!\begin {aligned} R&= x\\ S&= {\mathrm e}^{-2 x} y \end {aligned} \) Initial conditions are used to solve for \(c_{1}\). Substituting \(x=0\) and \(y=1\) in the above solution gives an
equation to solve for the constant of integration. \begin {align*} 1 = \left [c_{1} -\frac {1}{4}\right ] \end {align*}
Unable to solve for constant of integration.
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y^{\prime }-2 y=\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right ., y \left (0\right )=1\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=2 y+\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right . \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & y^{\prime }-2 y=\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right . \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }-2 y\right )=\mu \left (x \right ) \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right ) \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (y \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }-2 y\right )=y^{\prime } \mu \left (x \right )+y \mu ^{\prime }\left (x \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (x \right ) \\ {} & {} & \mu ^{\prime }\left (x \right )=-2 \mu \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )={\mathrm e}^{-2 x} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (y \mu \left (x \right )\right )\right )d x =\int \mu \left (x \right ) \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right )d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \mu \left (x \right ) \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right )d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \mu \left (x \right ) \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right )d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )={\mathrm e}^{-2 x} \\ {} & {} & y=\frac {\int \left (\left \{\begin {array}{cc} 1-x & x <1 \\ 0 & 1\le x \end {array}\right .\right ) {\mathrm e}^{-2 x}d x +c_{1}}{{\mathrm e}^{-2 x}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {\left \{\begin {array}{cc} \frac {{\mathrm e}^{-2 x} \left (2 x -1\right )}{4} & x \le 1 \\ \frac {{\mathrm e}^{-2}}{4} & 1 Maple trace
✓ Solution by Maple
Time used: 0.172 (sec). Leaf size: 31
\[
y \left (x \right ) = \frac {5 \,{\mathrm e}^{2 x}}{4}+\frac {\left (\left \{\begin {array}{cc} 2 x -1 & x <1 \\ {\mathrm e}^{2 x -2} & 1\le x \end {array}\right .\right )}{4}
\]
✓ Solution by Mathematica
Time used: 0.084 (sec). Leaf size: 45
\[
y(x)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{4} \left (2 x+5 e^{2 x}-1\right ) & x\leq 1 \\ \frac {1}{4} e^{2 x-2} \left (1+5 e^2\right ) & \text {True} \\ \end {array} \\ \end {array}
\]
3.21.2 Solving as linear ode
3.21.3 Solving as first order ode lie symmetry lookup ode
linear
. Therefore we do not need
to solve the PDE (A), and can just use the lookup table shown below to find \(\xi ,\eta \)
3.21.4 Maple step by step solution
`Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
<- 1st order linear successful`
dsolve([diff(y(x),x)-2*y(x)=piecewise(x<1,1-x,x>=1,0),y(0) = 1],y(x), singsol=all)
DSolve[{y'[x] - 2*y[x] == Piecewise[{{1-x, x < 1}, {0, x >= 1}}],{y[0]==1}},y[x],x,IncludeSingularSolutions -> True]