1.10 problem 10

1.10.1 Solving as homogeneousTypeD ode
1.10.2 Solving as homogeneousTypeD2 ode
1.10.3 Solving as first order ode lie symmetry lookup ode
1.10.4 Maple step by step solution

Internal problem ID [3155]
Internal file name [OUTPUT/2647_Sunday_June_05_2022_08_38_04_AM_4756193/index.tex]

Book: Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section: Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number: 10.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "homogeneousTypeD", "homogeneousTypeD2", "first_order_ode_lie_symmetry_lookup"

Maple gives the following as the ode type

[[_homogeneous, `class A`], _dAlembert]

\[ \boxed {x \cos \left (\frac {y}{x}\right )^{2}-y+x y^{\prime }=0} \]

1.10.1 Solving as homogeneousTypeD ode

Writing the ode as \begin {align*} y^{\prime }&=-\cos \left (\frac {y}{x}\right )^{2}+\frac {y}{x}\tag {A} \end {align*}

The given ode has the form\begin {equation} y^{\prime }=\frac {y}{x}+g\left ( x\right ) f\left ( b\frac {y}{x}\right ) ^{\frac {n}{m}}\tag {1} \end {equation} Where \(b\) is scalar and \(g\left ( x\right ) \) is function of \(x\) and \(n,m\) are integers. The solution is given in Kamke page 20. Using the substitution \(y\left ( x\right ) =u\left ( x\right ) x\) then\[ \frac {dy}{dx}=\frac {du}{dx}x+u \] Hence the given ode becomes\begin {align} \frac {du}{dx}x+u & =u+g\left ( x\right ) f\left ( bu\right ) ^{\frac {n}{m}}\nonumber \\ u^{\prime } & =\frac {1}{x}g\left ( x\right ) f\left ( bu\right ) ^{\frac {n}{m}}\tag {2} \end {align}

The above ode is always separable. This is easily solved for \(u\) assuming the integration can be resolved, and then the solution to the original ode becomes \(y=ux\). Comapring the given ode (A) with the form (1) shows that \begin {align*} g \left (x \right )&=-1\\ b&=1\\ f \left (\frac {b x}{y}\right )&=\cos \left (\frac {y}{x}\right ) \end {align*}

Substituting the above in (2) results in the \(u(x)\) ode as \begin {align*} u^{\prime }\left (x \right ) = -\frac {\cos \left (u \left (x \right )\right )^{2}}{x} \end {align*}

Which is now solved as separable In canonical form the ODE is \begin {align*} u' &= F(x,u)\\ &= f( x) g(u)\\ &= -\frac {\cos \left (u \right )^{2}}{x} \end {align*}

Where \(f(x)=-\frac {1}{x}\) and \(g(u)=\cos \left (u \right )^{2}\). Integrating both sides gives \begin{align*} \frac {1}{\cos \left (u \right )^{2}} \,du &= -\frac {1}{x} \,d x \\ \int { \frac {1}{\cos \left (u \right )^{2}} \,du} &= \int {-\frac {1}{x} \,d x} \\ \tan \left (u \right )&=-\ln \left (x \right )+c_{1} \\ \end{align*} The solution is \[ \tan \left (u \left (x \right )\right )+\ln \left (x \right )-c_{1} = 0 \] Therefore the solution is found using \(y = u x\). Hence \begin {align*} \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{1} = 0 \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{1} &= 0 \\ \end{align*}

Figure 13: Slope field plot

Verification of solutions

\[ \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{1} = 0 \] Verified OK.

1.10.2 Solving as homogeneousTypeD2 ode

Using the change of variables \(y = u \left (x \right ) x\) on the above ode results in new ode in \(u \left (x \right )\) \begin {align*} x \cos \left (u \left (x \right )\right )^{2}-u \left (x \right ) x +x \left (u^{\prime }\left (x \right ) x +u \left (x \right )\right ) = 0 \end {align*}

In canonical form the ODE is \begin {align*} u' &= F(x,u)\\ &= f( x) g(u)\\ &= -\frac {\cos \left (u \right )^{2}}{x} \end {align*}

Where \(f(x)=-\frac {1}{x}\) and \(g(u)=\cos \left (u \right )^{2}\). Integrating both sides gives \begin{align*} \frac {1}{\cos \left (u \right )^{2}} \,du &= -\frac {1}{x} \,d x \\ \int { \frac {1}{\cos \left (u \right )^{2}} \,du} &= \int {-\frac {1}{x} \,d x} \\ \tan \left (u \right )&=-\ln \left (x \right )+c_{2} \\ \end{align*} The solution is \[ \tan \left (u \left (x \right )\right )+\ln \left (x \right )-c_{2} = 0 \] Replacing \(u(x)\) in the above solution by \(\frac {y}{x}\) results in the solution for \(y\) in implicit form \begin {align*} \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{2} = 0\\ \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{2} = 0 \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{2} &= 0 \\ \end{align*}

Figure 14: Slope field plot

Verification of solutions

\[ \tan \left (\frac {y}{x}\right )+\ln \left (x \right )-c_{2} = 0 \] Verified OK.

1.10.3 Solving as first order ode lie symmetry lookup ode

Writing the ode as \begin {align*} y^{\prime }&=-\frac {x \cos \left (\frac {y}{x}\right )^{2}-y}{x}\\ 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 homogeneous Type D. Therefore we do not need to solve the PDE (A), and can just use the lookup table shown below to find \(\xi ,\eta \)

Table 3: 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 ) &=x^{2}\\ \tag {A1} \eta \left (x,y\right ) &=x y \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)\). Therefore \begin {align*} \frac {dy}{dx} &= \frac {\eta }{\xi }\\ &= \frac {x y}{x^{2}}\\ &= \frac {y}{x} \end {align*}

This is easily solved to give \begin {align*} y = c_{1} x \end {align*}

Where now the coordinate \(R\) is taken as the constant of integration. Hence \begin {align*} R &= \frac {y}{x} \end {align*}

And \(S\) is found from \begin {align*} dS &= \frac {dx}{\xi } \\ &= \frac {dx}{x^{2}} \end {align*}

Integrating gives \begin {align*} S &= \int { \frac {dx}{T}}\\ &= -\frac {1}{x} \end {align*}

Where the constant of integration is set to zero as we just need one solution. 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 {x \cos \left (\frac {y}{x}\right )^{2}-y}{x} \end {align*}

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

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates. \begin {align*} \frac {dS}{dR} &= -\frac {\sec \left (\frac {y}{x}\right )^{2}}{x}\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} &= S \left (R \right ) \sec \left (R \right )^{2} \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 ) = c_{1} {\mathrm e}^{\tan \left (R \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*} -\frac {1}{x} = c_{1} {\mathrm e}^{\tan \left (\frac {y}{x}\right )} \end {align*}

Which simplifies to \begin {align*} -\frac {1}{x} = c_{1} {\mathrm e}^{\tan \left (\frac {y}{x}\right )} \end {align*}

Which gives \begin {align*} y = \arctan \left (\ln \left (-\frac {1}{c_{1} x}\right )\right ) x \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 {x \cos \left (\frac {y}{x}\right )^{2}-y}{x}\)

\( \frac {d S}{d R} = S \left (R \right ) \sec \left (R \right )^{2}\)

\(\!\begin {aligned} R&= \frac {y}{x}\\ S&= -\frac {1}{x} \end {aligned} \)

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \arctan \left (\ln \left (-\frac {1}{c_{1} x}\right )\right ) x \\ \end{align*}

Figure 15: Slope field plot

Verification of solutions

\[ y = \arctan \left (\ln \left (-\frac {1}{c_{1} x}\right )\right ) x \] Verified OK.

1.10.4 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x \cos \left (\frac {y}{x}\right )^{2}-y+x y^{\prime }=0 \\ \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 }=\frac {-x \cos \left (\frac {y}{x}\right )^{2}+y}{x} \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.0 (sec). Leaf size: 12

dsolve((x*cos(y(x)/x)^2-y(x))+x*diff(y(x),x)=0,y(x), singsol=all)
 

\[ y \left (x \right ) = -\arctan \left (\ln \left (x \right )+c_{1} \right ) x \]

Solution by Mathematica

Time used: 0.5 (sec). Leaf size: 37

DSolve[(x*Cos[y[x]/x]^2-y[x])+x*y'[x]==0,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to x \arctan (-\log (x)+2 c_1) \\ y(x)\to -\frac {\pi x}{2} \\ y(x)\to \frac {\pi x}{2} \\ \end{align*}