2.5.6 problem 8

Solved as first order homogeneous class C ode
Solved using Lie symmetry for first order ode
Solved as first order ode of type Riccati
Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [18240]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter IV. Methods of solution: First order equations. section 32. Problems at page 89
Problem number : 8
Date solved : Monday, December 23, 2024 at 09:18:47 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

Solve

\begin{align*} y^{\prime }&=\left (x +y\right )^{2} \end{align*}

Solved as first order homogeneous class C ode

Time used: 0.064 (sec)

Let

\begin{align*} z = x +y\tag {1} \end{align*}

Then

\begin{align*} z^{\prime }\left (x \right )&=1+y^{\prime } \end{align*}

Therefore

\begin{align*} y^{\prime }&=z^{\prime }\left (x \right )-1 \end{align*}

Hence the given ode can now be written as

\begin{align*} z^{\prime }\left (x \right )-1&=z^{2} \end{align*}

This is separable first order ode. Integrating

\begin{align*} \int d x&=\int \frac {1}{z^{2}+1}d z \\ x +c_1&=\arctan \left (z \right ) \\ \end{align*}

Replacing \(z\) back by its value from (1) then the above gives the solution as Solving for \(y\) gives

\begin{align*} y &= -x +\tan \left (x +c_1 \right ) \\ \end{align*}
Figure 2.56: Slope field plot
\(y^{\prime } = \left (x +y\right )^{2}\)

Summary of solutions found

\begin{align*} y &= -x +\tan \left (x +c_1 \right ) \\ \end{align*}
Solved using Lie symmetry for first order ode

Time used: 0.607 (sec)

Writing the ode as

\begin{align*} y^{\prime }&=\left (x +y \right )^{2}\\ 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*}

To determine \(\xi ,\eta \) then (A) is solved using ansatz. Making bivariate polynomials of degree 1 to use as anstaz gives

\begin{align*} \tag{1E} \xi &= x a_{2}+y a_{3}+a_{1} \\ \tag{2E} \eta &= x b_{2}+y b_{3}+b_{1} \\ \end{align*}

Where the unknown coefficients are

\[ \{a_{1}, a_{2}, a_{3}, b_{1}, b_{2}, b_{3}\} \]

Substituting equations (1E,2E) and \(\omega \) into (A) gives

\begin{equation} \tag{5E} b_{2}+\left (x +y \right )^{2} \left (b_{3}-a_{2}\right )-\left (x +y \right )^{4} a_{3}-\left (2 x +2 y \right ) \left (x a_{2}+y a_{3}+a_{1}\right )-\left (2 x +2 y \right ) \left (x b_{2}+y b_{3}+b_{1}\right ) = 0 \end{equation}

Putting the above in normal form gives

\[ -x^{4} a_{3}-4 x^{3} y a_{3}-6 x^{2} y^{2} a_{3}-4 x \,y^{3} a_{3}-y^{4} a_{3}-3 x^{2} a_{2}-2 x^{2} b_{2}+x^{2} b_{3}-4 x y a_{2}-2 x y a_{3}-2 x y b_{2}-y^{2} a_{2}-2 y^{2} a_{3}-y^{2} b_{3}-2 x a_{1}-2 x b_{1}-2 y a_{1}-2 y b_{1}+b_{2} = 0 \]

Setting the numerator to zero gives

\begin{equation} \tag{6E} -x^{4} a_{3}-4 x^{3} y a_{3}-6 x^{2} y^{2} a_{3}-4 x \,y^{3} a_{3}-y^{4} a_{3}-3 x^{2} a_{2}-2 x^{2} b_{2}+x^{2} b_{3}-4 x y a_{2}-2 x y a_{3}-2 x y b_{2}-y^{2} a_{2}-2 y^{2} a_{3}-y^{2} b_{3}-2 x a_{1}-2 x b_{1}-2 y a_{1}-2 y b_{1}+b_{2} = 0 \end{equation}

Looking at the above PDE shows the following are all the terms with \(\{x, y\}\) in them.

\[ \{x, y\} \]

The following substitution is now made to be able to collect on all terms with \(\{x, y\}\) in them

\[ \{x = v_{1}, y = v_{2}\} \]

The above PDE (6E) now becomes

\begin{equation} \tag{7E} -a_{3} v_{1}^{4}-4 a_{3} v_{1}^{3} v_{2}-6 a_{3} v_{1}^{2} v_{2}^{2}-4 a_{3} v_{1} v_{2}^{3}-a_{3} v_{2}^{4}-3 a_{2} v_{1}^{2}-4 a_{2} v_{1} v_{2}-a_{2} v_{2}^{2}-2 a_{3} v_{1} v_{2}-2 a_{3} v_{2}^{2}-2 b_{2} v_{1}^{2}-2 b_{2} v_{1} v_{2}+b_{3} v_{1}^{2}-b_{3} v_{2}^{2}-2 a_{1} v_{1}-2 a_{1} v_{2}-2 b_{1} v_{1}-2 b_{1} v_{2}+b_{2} = 0 \end{equation}

Collecting the above on the terms \(v_i\) introduced, and these are

\[ \{v_{1}, v_{2}\} \]

Equation (7E) now becomes

\begin{equation} \tag{8E} -a_{3} v_{1}^{4}-4 a_{3} v_{1}^{3} v_{2}-6 a_{3} v_{1}^{2} v_{2}^{2}+\left (-3 a_{2}-2 b_{2}+b_{3}\right ) v_{1}^{2}-4 a_{3} v_{1} v_{2}^{3}+\left (-4 a_{2}-2 a_{3}-2 b_{2}\right ) v_{1} v_{2}+\left (-2 a_{1}-2 b_{1}\right ) v_{1}-a_{3} v_{2}^{4}+\left (-a_{2}-2 a_{3}-b_{3}\right ) v_{2}^{2}+\left (-2 a_{1}-2 b_{1}\right ) v_{2}+b_{2} = 0 \end{equation}

Setting each coefficients in (8E) to zero gives the following equations to solve

\begin{align*} b_{2}&=0\\ -6 a_{3}&=0\\ -4 a_{3}&=0\\ -a_{3}&=0\\ -2 a_{1}-2 b_{1}&=0\\ -4 a_{2}-2 a_{3}-2 b_{2}&=0\\ -3 a_{2}-2 b_{2}+b_{3}&=0\\ -a_{2}-2 a_{3}-b_{3}&=0 \end{align*}

Solving the above equations for the unknowns gives

\begin{align*} a_{1}&=-b_{1}\\ a_{2}&=0\\ a_{3}&=0\\ b_{1}&=b_{1}\\ b_{2}&=0\\ b_{3}&=0 \end{align*}

Substituting the above solution in the anstaz (1E,2E) (using \(1\) as arbitrary value for any unknown in the RHS) gives

\begin{align*} \xi &= -1 \\ \eta &= 1 \\ \end{align*}

Shifting is now applied to make \(\xi =0\) in order to simplify the rest of the computation

\begin{align*} \eta &= \eta - \omega \left (x,y\right ) \xi \\ &= 1 - \left (\left (x +y \right )^{2}\right ) \left (-1\right ) \\ &= x^{2}+2 x y +y^{2}+1\\ \xi &= 0 \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}{x^{2}+2 x y +y^{2}+1}} dy \end{align*}

Which results in

\begin{align*} S&= \arctan \left (x +y \right ) \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) &= \left (x +y \right )^{2} \end{align*}

Evaluating all the partial derivatives gives

\begin{align*} R_{x} &= 1\\ R_{y} &= 0\\ S_{x} &= \frac {1}{1+\left (x +y \right )^{2}}\\ S_{y} &= \frac {1}{1+\left (x +y \right )^{2}} \end{align*}

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates.

\begin{align*} \frac {dS}{dR} &= 1\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} &= 1 \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\).

Since the ode has the form \(\frac {d}{d R}S \left (R \right )=f(R)\), then we only need to integrate \(f(R)\).

\begin{align*} \int {dS} &= \int {1\, dR}\\ S \left (R \right ) &= R + c_2 \end{align*}

To complete the solution, we just need to transform the above back to \(x,y\) coordinates. This results in

\begin{align*} \arctan \left (x +y\right ) = x +c_2 \end{align*}

Which gives

\begin{align*} y = -x +\tan \left (x +c_2 \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} = \left (x +y \right )^{2}\)

\( \frac {d S}{d R} = 1\)

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

Figure 2.57: Slope field plot
\(y^{\prime } = \left (x +y\right )^{2}\)

Summary of solutions found

\begin{align*} y &= -x +\tan \left (x +c_2 \right ) \\ \end{align*}
Solved as first order ode of type Riccati

Time used: 0.252 (sec)

In canonical form the ODE is

\begin{align*} y' &= F(x,y)\\ &= \left (x +y \right )^{2} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = x^{2}+2 x y +y^{2} \]

With Riccati ODE standard form

\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]

Shows that \(f_0(x)=x^{2}\), \(f_1(x)=2 x\) and \(f_2(x)=1\). Let

\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u} \tag {1} \end{align*}

Using the above substitution in the given ODE results (after some simplification)in a second order ODE to solve for \(u(x)\) which is

\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}

But

\begin{align*} f_2' &=0\\ f_1 f_2 &=2 x\\ f_2^2 f_0 &=x^{2} \end{align*}

Substituting the above terms back in equation (2) gives

\begin{align*} u^{\prime \prime }\left (x \right )-2 x u^{\prime }\left (x \right )+x^{2} u \left (x \right ) = 0 \end{align*}

In normal form the given ode is written as

\begin{align*} \frac {d^{2}u}{d x^{2}}+p \left (x \right ) \left (\frac {d u}{d x}\right )+q \left (x \right ) u&=0 \tag {2} \end{align*}

Where

\begin{align*} p \left (x \right )&=-2 x\\ q \left (x \right )&=x^{2} \end{align*}

Calculating the Liouville ode invariant \(Q\) given by

\begin{align*} Q &= q - \frac {p'}{2}- \frac {p^2}{4} \\ &= x^{2} - \frac {\left (-2 x\right )'}{2}- \frac {\left (-2 x\right )^2}{4} \\ &= x^{2} - \frac {\left (-2\right )}{2}- \frac {\left (4 x^{2}\right )}{4} \\ &= x^{2} - \left (-1\right )-x^{2}\\ &= 1 \end{align*}

Since the Liouville ode invariant does not depend on the independent variable \(x\) then the transformation

\begin{align*} u = v \left (x \right ) z \left (x \right )\tag {3} \end{align*}

is used to change the original ode to a constant coefficients ode in \(v\). In (3) the term \(z \left (x \right )\) is given by

\begin{align*} z \left (x \right )&={\mathrm e}^{-\int \frac {p \left (x \right )}{2}d x}\\ &= e^{-\int \frac {-2 x}{2} }\\ &= {\mathrm e}^{\frac {x^{2}}{2}}\tag {5} \end{align*}

Hence (3) becomes

\begin{align*} u = v \left (x \right ) {\mathrm e}^{\frac {x^{2}}{2}}\tag {4} \end{align*}

Applying this change of variable to the original ode results in

\begin{align*} {\mathrm e}^{\frac {x^{2}}{2}} \left (v \left (x \right )+\frac {d^{2}}{d x^{2}}v \left (x \right )\right ) = 0 \end{align*}

Which is now solved for \(v \left (x \right )\).

The above ode can be simplified to

\begin{align*} v \left (x \right )+\frac {d^{2}}{d x^{2}}v \left (x \right ) = 0 \end{align*}

This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

\[ A v''(x) + B v'(x) + C v(x) = 0 \]

Where in the above \(A=1, B=0, C=1\). Let the solution be \(v \left (x \right )=e^{\lambda x}\). Substituting this into the ODE gives

\[ \lambda ^{2} {\mathrm e}^{x \lambda }+{\mathrm e}^{x \lambda } = 0 \tag {1} \]

Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\) gives

\[ \lambda ^{2}+1 = 0 \tag {2} \]

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

\[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \]

Substituting \(A=1, B=0, C=1\) into the above gives

\begin{align*} \lambda _{1,2} &= \frac {0}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {0^2 - (4) \left (1\right )\left (1\right )}\\ &= \pm i \end{align*}

Hence

\begin{align*} \lambda _1 &= + i\\ \lambda _2 &= - i \end{align*}

Which simplifies to

\begin{align*} \lambda _1 &= i \\ \lambda _2 &= -i \\ \end{align*}

Since roots are complex conjugate of each others, then let the roots be

\[ \lambda _{1,2} = \alpha \pm i \beta \]

Where \(\alpha =0\) and \(\beta =1\). Therefore the final solution, when using Euler relation, can be written as

\[ v \left (x \right ) = e^{\alpha x} \left ( c_1 \cos (\beta x) + c_2 \sin (\beta x) \right ) \]

Which becomes

\[ v \left (x \right ) = e^{0}\left (\cos \left (x \right ) c_1+c_2 \sin \left (x \right )\right ) \]

Or

\[ v \left (x \right ) = \cos \left (x \right ) c_1+c_2 \sin \left (x \right ) \]

Will add steps showing solving for IC soon.

Now that \(v \left (x \right )\) is known, then

\begin{align*} u&= v \left (x \right ) z \left (x \right )\\ &= \left (\cos \left (x \right ) c_1 +c_2 \sin \left (x \right )\right ) \left (z \left (x \right )\right )\tag {7} \end{align*}

But from (5)

\begin{align*} z \left (x \right )&= {\mathrm e}^{\frac {x^{2}}{2}} \end{align*}

Hence (7) becomes

\begin{align*} u = \left (\cos \left (x \right ) c_1 +c_2 \sin \left (x \right )\right ) {\mathrm e}^{\frac {x^{2}}{2}} \end{align*}

Will add steps showing solving for IC soon.

Taking derivative gives

\[ u^{\prime }\left (x \right ) = \left (-c_1 \sin \left (x \right )+c_2 \cos \left (x \right )\right ) {\mathrm e}^{\frac {x^{2}}{2}}+\left (\cos \left (x \right ) c_1 +c_2 \sin \left (x \right )\right ) x \,{\mathrm e}^{\frac {x^{2}}{2}} \]

Doing change of constants, the solution becomes

\[ y = -\frac {\left (\left (-c_3 \sin \left (x \right )+\cos \left (x \right )\right ) {\mathrm e}^{\frac {x^{2}}{2}}+\left (\cos \left (x \right ) c_3 +\sin \left (x \right )\right ) x \,{\mathrm e}^{\frac {x^{2}}{2}}\right ) {\mathrm e}^{-\frac {x^{2}}{2}}}{\cos \left (x \right ) c_3 +\sin \left (x \right )} \]
Figure 2.58: Slope field plot
\(y^{\prime } = \left (x +y\right )^{2}\)

Summary of solutions found

\begin{align*} y &= -\frac {\left (\left (-c_3 \sin \left (x \right )+\cos \left (x \right )\right ) {\mathrm e}^{\frac {x^{2}}{2}}+\left (\cos \left (x \right ) c_3 +\sin \left (x \right )\right ) x \,{\mathrm e}^{\frac {x^{2}}{2}}\right ) {\mathrm e}^{-\frac {x^{2}}{2}}}{\cos \left (x \right ) c_3 +\sin \left (x \right )} \\ \end{align*}
Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime }=\left (x +y\right )^{2} \\ \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 }=\left (x +y\right )^{2} \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 C 
1st order, trying the canonical coordinates of the invariance group 
   -> Calling odsolve with the ODE`, diff(y(x), x) = -1, y(x)`      *** Sublevel 2 *** 
      Methods for first order ODEs: 
      --- Trying classification methods --- 
      trying a quadrature 
      trying 1st order linear 
      <- 1st order linear successful 
<- 1st order, canonical coordinates successful 
<- homogeneous successful`
 
Maple dsolve solution

Solving time : 0.006 (sec)
Leaf size : 16

dsolve(diff(y(x),x) = (x+y(x))^2, 
       y(x),singsol=all)
 
\[ y = -x -\tan \left (c_1 -x \right ) \]
Mathematica DSolve solution

Solving time : 0.559 (sec)
Leaf size : 14

DSolve[{D[y[x],x]==(x+y[x])^2,{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -x+\tan (x+c_1) \]