2.5.6 Problem 8
Internal
problem
ID
[19735]
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
:
Thursday, December 11, 2025 at 01:51:16 PM
CAS
classification
:
[[_homogeneous, `class C`], _Riccati]
2.5.6.1 Solved using first_order_ode_homog_type_C
0.036 (sec)
Entering first order ode homog type C solver
\begin{align*}
y^{\prime }&=\left (x +y\right )^{2} \\
\end{align*}
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.68: Slope field \(y^{\prime } = \left (x +y\right )^{2}\)
Summary of solutions found
\begin{align*}
y &= -x +\tan \left (x +c_1 \right ) \\
\end{align*}
2.5.6.2 Solved using first_order_ode_LIE
0.252 (sec)
Entering first order ode LIE solver
\begin{align*}
y^{\prime }&=\left (x +y\right )^{2} \\
\end{align*}
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. Using these anstaz
\begin{align*}
\tag{1E} \xi &= 1 \\
\tag{2E} \eta &= \frac {A x +B y}{C x} \\
\end{align*}
Where the unknown
coefficients are \[
\{A, B, C\}
\]
Substituting equations (1E,2E) and \(\omega \) into (A) gives \begin{equation}
\tag{5E} \frac {A}{C x}-\frac {A x +B y}{C \,x^{2}}+\frac {\left (x +y \right )^{2} B}{C x}-2 x -2 y -\frac {\left (2 x +2 y \right ) \left (A x +B y \right )}{C x} = 0
\end{equation}
Putting the above in normal
form gives \[
-\frac {2 A \,x^{3}+2 A \,x^{2} y -B \,x^{3}+B x \,y^{2}+2 C \,x^{3}+2 y C \,x^{2}+B y}{C \,x^{2}} = 0
\]
Setting the numerator to zero gives \begin{equation}
\tag{6E} -2 A \,x^{3}-2 A \,x^{2} y +B \,x^{3}-B x \,y^{2}-2 C \,x^{3}-2 y C \,x^{2}-B y = 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} -2 A v_{1}^{3}-2 A v_{1}^{2} v_{2}+B v_{1}^{3}-B v_{1} v_{2}^{2}-2 C v_{1}^{3}-2 C v_{1}^{2} v_{2}-B v_{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} \left (-2 A +B -2 C \right ) v_{1}^{3}+\left (-2 A -2 C \right ) v_{1}^{2} v_{2}-B v_{1} v_{2}^{2}-B v_{2} = 0
\end{equation}
Setting each coefficients in (8E) to zero gives the following equations to solve
\begin{align*} -B&=0\\ -2 A -2 C&=0\\ -2 A +B -2 C&=0 \end{align*}
Solving the above equations for the unknowns gives
\begin{align*} A&=-C\\ B&=0\\ C&=C \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*}
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 {-1}{1}\\ &= -1 \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 &= x +y \end{align*}
And \(S\) is found from
\begin{align*} dS &= \frac {dx}{\xi } \\ &= \frac {dx}{1} \end{align*}
Integrating gives
\begin{align*} S &= \int { \frac {dx}{T}}\\ &= 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) &= \left (x +y \right )^{2} \end{align*}
Evaluating all the partial derivatives gives
\begin{align*} R_{x} &= 1\\ R_{y} &= 1\\ S_{x} &= 1\\ 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 {1}{1+\left (x +y \right )^{2}}\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} &= \frac {1}{R^{2}+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 {\frac {1}{R^{2}+1}\, dR}\\ S \left (R \right ) &= \arctan \left (R \right ) + 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*} x = \arctan \left (x +y\right )+c_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} = \left (x +y \right )^{2}\)
\( \frac {d S}{d R} = \frac {1}{R^{2}+1}\)
\(\!\begin {aligned} R&= x +y\\ S&= x \end {aligned} \)
Solving for \(y\) gives
\begin{align*}
y &= -x -\tan \left (-x +c_2 \right ) \\
\end{align*}
Figure 2.69: Slope field \(y^{\prime } = \left (x +y\right )^{2}\)
Summary of solutions found
\begin{align*}
y &= -x -\tan \left (-x +c_2 \right ) \\
\end{align*}
2.5.6.3 Solved using first_order_ode_riccati
0.305 (sec)
Entering first order ode riccati solver
\begin{align*}
y^{\prime }&=\left (x +y\right )^{2} \\
\end{align*}
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 y x +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
\[
u^{\prime \prime }\left (x \right )-2 x u^{\prime }\left (x \right )+x^{2} u \left (x \right ) = 0
\]
Entering second order change of variable
on \(y\) method 1 solver 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 (\frac {d^{2}}{d x^{2}}v \left (x \right )+v \left (x \right )\right ) = 0 \end{align*}
Which is now solved for \(v \left (x \right )\) .
The above ode simplifies to
\begin{align*} \frac {d^{2}}{d x^{2}}v \left (x \right )+v \left (x \right ) = 0 \end{align*}
Entering second order linear constant coefficient ode solver
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 )
\]
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*}
Taking derivative gives
\begin{equation}
\tag{4} 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}}
\end{equation}
Substituting equations (3,4) into (1) results in \begin{align*}
y &= \frac {-u'}{f_2 u} \\
y &= \frac {-u'}{u} \\
y &= \frac {\left (-c_1 x -c_2 \right ) \cos \left (x \right )-\sin \left (x \right ) \left (c_2 x -c_1 \right )}{\cos \left (x \right ) c_1 +c_2 \sin \left (x \right )} \\
\end{align*}
Doing change of
constants, the above solution becomes \[
y = -\frac {\left (\left (-\sin \left (x \right )+c_3 \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 )}
\]
Simplifying the above gives \begin{align*}
y &= \frac {-\left (x +c_3 \right ) \cos \left (x \right )+\left (-c_3 x +1\right ) \sin \left (x \right )}{\cos \left (x \right )+c_3 \sin \left (x \right )} \\
\end{align*}
Figure 2.70: Slope field \(y^{\prime } = \left (x +y\right )^{2}\)
Summary of solutions found
\begin{align*}
y &= \frac {-\left (x +c_3 \right ) \cos \left (x \right )+\left (-c_3 x +1\right ) \sin \left (x \right )}{\cos \left (x \right )+c_3 \sin \left (x \right )} \\
\end{align*}
2.5.6.4 Solved using first_order_ode_riccati_by_guessing_particular_solution
0.115 (sec)
Entering first order ode riccati guess solver
\begin{align*}
y^{\prime }&=\left (x +y\right )^{2} \\
\end{align*}
This is a Riccati ODE. Comparing the above ODE to
solve with the Riccati standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \begin{align*} f_0(x) & =x^{2}\\ f_1(x) & =2 x\\ f_2(x) &=1 \end{align*}
Using trial and error, the following particular solution was found
\[
y_p = -x +i
\]
Since a particular solution is
known, then the general solution is given by \begin{align*} y &= y_p + \frac { \phi (x) }{ c_1 - \int { \phi (x) f_2 \,dx} } \end{align*}
Where
\begin{align*} \phi (x) &= e^{ \int 2 f_2 y_p + f_1 \,dx } \end{align*}
Evaluating the above gives the general solution as
\[
y = \frac {\left (x +i\right ) {\mathrm e}^{2 i x}+\left (-2 i x -2\right ) c_1}{-{\mathrm e}^{2 i x}+2 i c_1}
\]
Figure 2.71: Slope field \(y^{\prime } = \left (x +y\right )^{2}\)
Figure 2.72: Slope field \(y^{\prime } = \left (x +y\right )^{2}\)
Summary of solutions found
\begin{align*}
y &= \frac {\left (x +i\right ) {\mathrm e}^{2 i x}+\left (-2 i x -2\right ) c_1}{-{\mathrm e}^{2 i x}+2 i c_1} \\
\end{align*}
2.5.6.5 ✓ Maple. Time used: 0.004 (sec). Leaf size: 16
ode := diff ( y ( x ), x ) = (x+y(x))^2;
dsolve ( ode , y ( x ), singsol=all);
\[
y = -x -\tan \left (-x +c_1 \right )
\]
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
1 st 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 step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=\left (x +y \left (x \right )\right )^{2} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=\left (x +y \left (x \right )\right )^{2} \end {array} \]
2.5.6.6 ✓ Mathematica. Time used: 0.336 (sec). Leaf size: 14
ode = D [ y [ x ], x ]==( x + y [ x ])^2;
ic ={};
DSolve [{ ode , ic }, y [ x ], x , IncludeSingularSolutions -> True ]
\begin{align*} y(x)&\to -x+\tan (x+c_1) \end{align*}
2.5.6.7 ✓ Sympy. Time used: 0.168 (sec). Leaf size: 34
from sympy import *
x = symbols("x")
y = Function("y")
ode = Eq(-(x + y(x))**2 + Derivative(y(x), x),0)
ics = {}
dsolve ( ode , func = y ( x ), ics = ics )
\[
y{\left (x \right )} = \frac {- C_{1} x + i C_{1} + x e^{2 i x} + i e^{2 i x}}{C_{1} - e^{2 i x}}
\]