6.23 problem 23

6.23.1 Existence and uniqueness analysis
6.23.2 Solving as linear ode
6.23.3 Solving as first order ode lie symmetry lookup ode
6.23.4 Maple step by step solution

Internal problem ID [11696]
Internal file name [OUTPUT/11706_Wednesday_April_10_2024_04_55_17_PM_81399686/index.tex]

Book: Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section: Chapter 2, Miscellaneous Review. Exercises page 60
Problem number: 23.
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]

\[ \boxed {\left (x +2\right ) y^{\prime }+y=\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

6.23.1 Existence and uniqueness analysis

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) &=\frac {1}{x +2}\\ q(x) &=\frac {\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

Hence the ode is \begin {align*} y^{\prime }+\frac {y}{x +2} = \frac {\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

The domain of \(p(x)=\frac {1}{x +2}\) is \[ \{x <-2\boldsymbol {\lor }-2

6.23.2 Solving as linear ode

Entering Linear first order ODE solver. The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \frac {1}{x +2}d x} \\ &= x +2 \\ \end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\frac {\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

Integrating gives \begin {align*} \left (x +2\right ) y &= \int {2 \left (\left \{\begin {array}{cc} 0 & x <0 \\ x & x \le 2 \\ 2 & 2

Dividing both sides by the integrating factor \(\mu =x +2\) results in \begin {align*} y &= \frac {2 \left (\left \{\begin {array}{cc} 0 & x \le 0 \\ \frac {x^{2}}{2} & x \le 2 \\ 2 x -2 & 2

which simplifies to \begin {align*} y &= \frac {\left (\left \{\begin {array}{cc} 0 & x \le 0 \\ x^{2} & x \le 2 \\ 4 x -4 & 2

Initial conditions are used to solve for \(c_{1}\). Substituting \(x=0\) and \(y=4\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} 4 = \frac {c_{1}}{2} \end {align*}

The solutions are \begin {align*} c_{1} = 8 \end {align*}

Trying the constant \begin {align*} c_{1} = 8 \end {align*}

Substituting this in the general solution gives \begin {align*} y&=\left \{\begin {array}{cc} \frac {8}{x +2} & x \le 0 \\ \frac {x^{2}+8}{x +2} & x \le 2 \\ \frac {4 x +4}{x +2} & 2

The constant \(c_{1} = 8\) gives valid solution.

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \left \{\begin {array}{cc} \frac {8}{x +2} & x \le 0 \\ \frac {x^{2}+8}{x +2} & x \le 2 \\ \frac {4 x +4}{x +2} & 2

Verification of solutions

\[ y = \left \{\begin {array}{cc} \frac {8}{x +2} & x \le 0 \\ \frac {x^{2}+8}{x +2} & x \le 2 \\ \frac {4 x +4}{x +2} & 2

6.23.3 Solving as first order ode lie symmetry lookup ode

Writing the ode as \begin {align*} y^{\prime }&=\frac {-y +\left (\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

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 linear. Therefore we do not need to solve the PDE (A), and can just use the lookup table shown below to find \(\xi ,\eta \)

Table 153: Lie symmetry infinitesimal lookup table for known first order ODE’s




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 ) &=\frac {1}{x +2} \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}{\frac {1}{x +2}}} dy \end {align*}

Which results in \begin {align*} S&= \left (x +2\right ) 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) &= \frac {-y +\left (\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

Evaluating all the partial derivatives gives \begin {align*} R_{x} &= 1\\ R_{y} &= 0\\ S_{x} &= y\\ S_{y} &= x +2 \end {align*}

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates. \begin {align*} \frac {dS}{dR} &= 2 \left (\left \{\begin {array}{cc} 0 & x <0 \\ x & x \le 2 \\ 2 & 2

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} &= 2 \left (\left \{\begin {array}{cc} 0 & R <0 \\ R & R \le 2 \\ 2 & 2

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} c_{1} & R <0 \\ R^{2}+c_{1} & R <2 \\ c_{1} -4+4 R & 2\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*} y \left (x +2\right ) = \left \{\begin {array}{cc} c_{1} & x <0 \\ x^{2}+c_{1} & x <2 \\ c_{1} +4 x -4 & 2\le x \end {array}\right . \end {align*}

Which simplifies to \begin {align*} y \left (x +2\right ) = \left \{\begin {array}{cc} c_{1} & x <0 \\ x^{2}+c_{1} & x <2 \\ c_{1} +4 x -4 & 2\le x \end {array}\right . \end {align*}

Which gives \begin {align*} y = \frac {\left \{\begin {array}{cc} c_{1} & x <0 \\ x^{2}+c_{1} & x <2 \\ c_{1} +4 x -4 & 2\le x \end {array}\right .}{x +2} \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} = \frac {-y +\left (\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

\( \frac {d S}{d R} = 2 \left (\left \{\begin {array}{cc} 0 & R <0 \\ R & R \le 2 \\ 2 & 2

\(\!\begin {aligned} R&= x\\ S&= \left (x +2\right ) y \end {aligned} \)




Initial conditions are used to solve for \(c_{1}\). Substituting \(x=0\) and \(y=4\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} 4 = \frac {c_{1}}{2} \end {align*}

The solutions are \begin {align*} c_{1} = 8 \end {align*}

Trying the constant \begin {align*} c_{1} = 8 \end {align*}

Substituting this in the general solution gives \begin {align*} y&=\left \{\begin {array}{cc} \frac {8}{x +2} & x <0 \\ \frac {x^{2}+8}{x +2} & x <2 \\ \frac {4 x +4}{x +2} & 2\le x \\ 0 & \operatorname {otherwise} \end {array}\right . \end {align*}

The constant \(c_{1} = 8\) gives valid solution.

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \left \{\begin {array}{cc} \frac {8}{x +2} & x <0 \\ \frac {x^{2}+8}{x +2} & x <2 \\ \frac {4 x +4}{x +2} & 2\le x \\ 0 & \operatorname {otherwise} \end {array}\right . \\ \end{align*}

Verification of solutions

\[ y = \left \{\begin {array}{cc} \frac {8}{x +2} & x <0 \\ \frac {x^{2}+8}{x +2} & x <2 \\ \frac {4 x +4}{x +2} & 2\le x \\ 0 & \operatorname {otherwise} \end {array}\right . \] Verified OK.

6.23.4 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\left (x +2\right ) y^{\prime }+y=\left \{\begin {array}{cc} 2 x & 0\le x \le 2 \\ 4 & 2

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
<- 1st order linear successful`
 

Solution by Maple

Time used: 0.063 (sec). Leaf size: 31

dsolve([(x+2)*diff(y(x),x)+y(x)=piecewise(0<=x and x<=2,2*x,x>2,4),y(0) = 4],y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {\left \{\begin {array}{cc} 8 & x <0 \\ x^{2}+8 & x <2 \\ 4+4 x & 2\le x \end {array}\right .}{x +2} \]

Solution by Mathematica

Time used: 0.248 (sec). Leaf size: 43

DSolve[{(x+2)*y'[x]+y[x]==Piecewise[{{2*x,0<=x<=2},{4,x>2}}],{y[0]==4}},y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {8}{x+2} & x\leq 0 \\ \frac {4 (x+1)}{x+2} & x>2 \\ \frac {x^2+8}{x+2} & \text {True} \\ \end {array} \\ \end {array} \]