1.2 problem 2

1.2.1 Existence and uniqueness analysis
1.2.2 Solving as dAlembert ode
1.2.3 Maple step by step solution

Internal problem ID [3135]
Internal file name [OUTPUT/2627_Sunday_June_05_2022_03_23_20_AM_64957984/index.tex]

Book: An introduction to the solution and applications of differential equations, J.W. Searl, 1966
Section: Chapter 4, Ex. 4.1
Problem number: 2.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "exact", "differentialType", "homogeneousTypeD2", "first_order_ode_lie_symmetry_calculated"

Maple gives the following as the ode type

[[_homogeneous, `class A`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

\[ \boxed {y+\left (x -y\right ) y^{\prime }=-x} \] With initial conditions \begin {align*} [y \left (0\right ) = 0] \end {align*}

1.2.1 Existence and uniqueness analysis

This is non linear first order ODE. In canonical form it is written as \begin {align*} y^{\prime } &= f(x,y)\\ &= \frac {x +y}{y -x} \end {align*}

The \(x\) domain of \(f(x,y)\) when \(y=0\) is \[ \{-\infty

The \(x\) domain of \(\frac {\partial f}{\partial y}\) when \(y=0\) is \[ \{x <0\boldsymbol {\lor }0

1.2.2 Solving as dAlembert ode

Let \(p=y^{\prime }\) the ode becomes \begin {align*} y +\left (x -y \right ) p = -x \end {align*}

Solving for \(y\) from the above results in \begin {align*} y &= \frac {x \left (p +1\right )}{-1+p}\tag {1A} \end {align*}

This has the form \begin {align*} y=xf(p)+g(p)\tag {*} \end {align*}

Where \(f,g\) are functions of \(p=y'(x)\). The above ode is dAlembert ode which is now solved. Taking derivative of (*) w.r.t. \(x\) gives \begin {align*} p &= f+(x f'+g') \frac {dp}{dx}\\ p-f &= (x f'+g') \frac {dp}{dx}\tag {2} \end {align*}

Comparing the form \(y=x f + g\) to (1A) shows that \begin {align*} f &= \frac {p +1}{-1+p}\\ g &= 0 \end {align*}

Hence (2) becomes \begin {align*} p -\frac {p +1}{-1+p} = x \left (\frac {1}{-1+p}-\frac {p +1}{\left (-1+p \right )^{2}}\right ) p^{\prime }\left (x \right )\tag {2A} \end {align*}

The singular solution is found by setting \(\frac {dp}{dx}=0\) in the above which gives \begin {align*} p -\frac {p +1}{-1+p} = 0 \end {align*}

Solving for \(p\) from the above gives \begin {align*} p&=1+\sqrt {2}\\ p&=-\sqrt {2}+1 \end {align*}

Substituting these in (1A) gives \begin {align*} y&=x +\sqrt {2}\, x\\ y&=x -\sqrt {2}\, x \end {align*}

The general solution is found when \( \frac { \mathop {\mathrm {d}p}}{\mathop {\mathrm {d}x}}\neq 0\). From eq. (2A). This results in \begin {align*} p^{\prime }\left (x \right ) = \frac {p \left (x \right )-\frac {p \left (x \right )+1}{-1+p \left (x \right )}}{x \left (\frac {1}{-1+p \left (x \right )}-\frac {p \left (x \right )+1}{\left (-1+p \left (x \right )\right )^{2}}\right )}\tag {3} \end {align*}

This ODE is now solved for \(p \left (x \right )\).

Inverting the above ode gives \begin {align*} \frac {d}{d p}x \left (p \right ) = \frac {x \left (p \right ) \left (\frac {1}{-1+p}-\frac {p +1}{\left (-1+p \right )^{2}}\right )}{p -\frac {p +1}{-1+p}}\tag {4} \end {align*}

This ODE is now solved for \(x \left (p \right )\).

Entering Linear first order ODE solver. In canonical form a linear first order is \begin {align*} \frac {d}{d p}x \left (p \right ) + p(p)x \left (p \right ) &= q(p) \end {align*}

Where here \begin {align*} p(p) &=\frac {2}{\left (p^{2}-2 p -1\right ) \left (-1+p \right )}\\ q(p) &=0 \end {align*}

Hence the ode is \begin {align*} \frac {d}{d p}x \left (p \right )+\frac {2 x \left (p \right )}{\left (p^{2}-2 p -1\right ) \left (-1+p \right )} = 0 \end {align*}

The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \frac {2}{\left (p^{2}-2 p -1\right ) \left (-1+p \right )}d p} \\ &= {\mathrm e}^{-\ln \left (-1+p \right )+\frac {\ln \left (p^{2}-2 p -1\right )}{2}} \\ \end{align*} Which simplifies to \[ \mu = \frac {\sqrt {p^{2}-2 p -1}}{-1+p} \] The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}p}} \mu x &= 0 \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}p}} \left (\frac {\sqrt {p^{2}-2 p -1}\, x}{-1+p}\right ) &= 0 \end {align*}

Integrating gives \begin {align*} \frac {\sqrt {p^{2}-2 p -1}\, x}{-1+p} &= c_{3} \end {align*}

Dividing both sides by the integrating factor \(\mu =\frac {\sqrt {p^{2}-2 p -1}}{-1+p}\) results in \begin {align*} x \left (p \right ) &= \frac {c_{3} \left (-1+p \right )}{\sqrt {p^{2}-2 p -1}} \end {align*}

Now we need to eliminate \(p\) between the above and (1A). One way to do this is by solving (1) for \(p\). This results in \begin {align*} p&=-\frac {y+x}{x -y} \end {align*}

Substituting the above in the solution for \(x\) found above gives \begin{align*} x&=\frac {c_{3} x \sqrt {2}}{\left (y-x \right ) \sqrt {\frac {-y^{2}+2 y x +x^{2}}{\left (x -y\right )^{2}}}} \\ \end{align*} Initial conditions are used to solve for \(c_{3}\). Substituting \(x=0\) and \(y=0\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} 0 = -c_{3} \sqrt {2} \end {align*}

The solutions are \begin {align*} c_{3} = 0 \end {align*}

Trying the constant \begin {align*} c_{3} = 0 \end {align*}

Substituting \(c_{3}\) found above in the general solution gives \begin {align*} x = 0 \end {align*}

The constant \(c_{3} = 0\) does not give valid solution.

Which is valid for any constant of integration. Therefore keeping the constant in place.

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= x +\sqrt {2}\, x \\ \tag{2} y &= x -\sqrt {2}\, x \\ \tag{3} x &= 0 \\ \end{align*}

(a) Solution plot

(b) Slope field plot

Verification of solutions

\[ y = x +\sqrt {2}\, x \] Verified OK.

\[ y = x -\sqrt {2}\, x \] Verified OK.

\[ x = 0 \] Verified OK.

1.2.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y+\left (x -y\right ) y^{\prime }=-x , y \left (0\right )=0\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \square & {} & \textrm {Check if ODE is exact}\hspace {3pt} \\ {} & \circ & \textrm {ODE is exact if the lhs is the total derivative of a}\hspace {3pt} C^{2}\hspace {3pt}\textrm {function}\hspace {3pt} \\ {} & {} & F^{\prime }\left (x , y\right )=0 \\ {} & \circ & \textrm {Compute derivative of lhs}\hspace {3pt} \\ {} & {} & F^{\prime }\left (x , y\right )+\left (\frac {\partial }{\partial y}F \left (x , y\right )\right ) y^{\prime }=0 \\ {} & \circ & \textrm {Evaluate derivatives}\hspace {3pt} \\ {} & {} & 1=1 \\ {} & \circ & \textrm {Condition met, ODE is exact}\hspace {3pt} \\ \bullet & {} & \textrm {Exact ODE implies solution will be of this form}\hspace {3pt} \\ {} & {} & \left [F \left (x , y\right )=c_{1} , M \left (x , y\right )=F^{\prime }\left (x , y\right ), N \left (x , y\right )=\frac {\partial }{\partial y}F \left (x , y\right )\right ] \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {by integrating}\hspace {3pt} M \left (x , y\right )\hspace {3pt}\textrm {with respect to}\hspace {3pt} x \\ {} & {} & F \left (x , y\right )=\int \left (x +y \right )d x +f_{1} \left (y \right ) \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & F \left (x , y\right )=\frac {x^{2}}{2}+x y +f_{1} \left (y \right ) \\ \bullet & {} & \textrm {Take derivative of}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {with respect to}\hspace {3pt} y \\ {} & {} & N \left (x , y\right )=\frac {\partial }{\partial y}F \left (x , y\right ) \\ \bullet & {} & \textrm {Compute derivative}\hspace {3pt} \\ {} & {} & x -y =x +\frac {d}{d y}f_{1} \left (y \right ) \\ \bullet & {} & \textrm {Isolate for}\hspace {3pt} \frac {d}{d y}f_{1} \left (y \right ) \\ {} & {} & \frac {d}{d y}f_{1} \left (y \right )=-y \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} f_{1} \left (y \right ) \\ {} & {} & f_{1} \left (y \right )=-\frac {y^{2}}{2} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} f_{1} \left (y \right )\hspace {3pt}\textrm {into equation for}\hspace {3pt} F \left (x , y\right ) \\ {} & {} & F \left (x , y\right )=\frac {1}{2} x^{2}+x y -\frac {1}{2} y^{2} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {into the solution of the ODE}\hspace {3pt} \\ {} & {} & \frac {1}{2} x^{2}+x y -\frac {1}{2} y^{2}=c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & \left \{y=x -\sqrt {2 x^{2}-2 c_{1}}, y=x +\sqrt {2 x^{2}-2 c_{1}}\right \} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=0 \\ {} & {} & 0=-\sqrt {-2 c_{1}} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =0 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =0\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=x \left (1-\sqrt {2}\, \mathrm {csgn}\left (x \right )\right ) \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=0 \\ {} & {} & 0=\sqrt {-2 c_{1}} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =0 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =0\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=x \left (1+\sqrt {2}\, \mathrm {csgn}\left (x \right )\right ) \\ \bullet & {} & \textrm {Solutions to the IVP}\hspace {3pt} \\ {} & {} & \left \{y=x \left (1-\sqrt {2}\, \mathrm {csgn}\left (x \right )\right ), y=x \left (1+\sqrt {2}\, \mathrm {csgn}\left (x \right )\right )\right \} \end {array} \]

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
trying inverse linear 
trying homogeneous types: 
trying homogeneous D 
<- homogeneous successful`
 

Solution by Maple

Time used: 0.047 (sec). Leaf size: 22

dsolve([(x+y(x))+(x-y(x))*diff(y(x),x)=0,y(0) = 0],y(x), singsol=all)
 

\begin{align*} y \left (x \right ) &= x \left (1+\sqrt {2}\right ) \\ y \left (x \right ) &= -x \left (\sqrt {2}-1\right ) \\ \end{align*}

Solution by Mathematica

Time used: 0.482 (sec). Leaf size: 40

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

\begin{align*} y(x)\to x-\sqrt {2} \sqrt {x^2} \\ y(x)\to \sqrt {2} \sqrt {x^2}+x \\ \end{align*}