2.5.6 Problem 8

Solved using first_order_ode_homog_type_C
Solved using first_order_ode_LIE
Solved using first_order_ode_riccati
Solved as second order ode using change of variable on y method 1
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [18486]
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 : Saturday, April 26, 2025 at 11:23:04 AM
CAS classification : [[_homogeneous, `class C`], _Riccati]

Solved using first_order_ode_homog_type_C

Time used: 0.019 (sec)

Solve

y=(x+y)2

Let

(1)z=x+y

Then

z(x)=1+y

Therefore

y=z(x)1

Hence the given ode can now be written as

z(x)1=z2

This is separable first order ode. Integrating

dx=1z2+1dzx+c1=arctan(z)

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

y=x+tan(x+c1)
Figure 2.53: Slope field y=(x+y)2

Summary of solutions found

y=x+tan(x+c1)
Solved using first_order_ode_LIE

Time used: 0.307 (sec)

Solve

y=(x+y)2

Writing the ode as

y=(x+y)2y=ω(x,y)

The condition of Lie symmetry is the linearized PDE given by

(A)ηx+ω(ηyξx)ω2ξyωxξωyη=0

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

(1E)ξ=xa2+ya3+a1(2E)η=xb2+yb3+b1

Where the unknown coefficients are

{a1,a2,a3,b1,b2,b3}

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

(5E)b2+(x+y)2(b3a2)(x+y)4a3(2x+2y)(xa2+ya3+a1)(2x+2y)(xb2+yb3+b1)=0

Putting the above in normal form gives

x4a34x3ya36x2y2a34xy3a3y4a33x2a22x2b2+x2b34xya22xya32xyb2y2a22y2a3y2b32xa12xb12ya12yb1+b2=0

Setting the numerator to zero gives

(6E)x4a34x3ya36x2y2a34xy3a3y4a33x2a22x2b2+x2b34xya22xya32xyb2y2a22y2a3y2b32xa12xb12ya12yb1+b2=0

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=v1,y=v2}

The above PDE (6E) now becomes

(7E)a3v144a3v13v26a3v12v224a3v1v23a3v243a2v124a2v1v2a2v222a3v1v22a3v222b2v122b2v1v2+b3v12b3v222a1v12a1v22b1v12b1v2+b2=0

Collecting the above on the terms vi introduced, and these are

{v1,v2}

Equation (7E) now becomes

(8E)a3v144a3v13v26a3v12v22+(3a22b2+b3)v124a3v1v23+(4a22a32b2)v1v2+(2a12b1)v1a3v24+(a22a3b3)v22+(2a12b1)v2+b2=0

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

b2=06a3=04a3=0a3=02a12b1=04a22a32b2=03a22b2+b3=0a22a3b3=0

Solving the above equations for the unknowns gives

a1=b1a2=0a3=0b1=b1b2=0b3=0

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

ξ=1η=1

Shifting is now applied to make ξ=0 in order to simplify the rest of the computation

η=ηω(x,y)ξ=1((x+y)2)(1)=x2+2xy+y2+1ξ=0

The next step is to determine the canonical coordinates R,S. The canonical coordinates map (x,y)(R,S) where (R,S) 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

(1)dxξ=dyη=dS

The above comes from the requirements that (ξx+ηy)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 ξ=0 then in this special case

R=x

S is found from

S=1ηdy=1x2+2xy+y2+1dy

Which results in

S=arctan(x+y)

Now that R,S are found, we need to setup the ode in these coordinates. This is done by evaluating

(2)dSdR=Sx+ω(x,y)SyRx+ω(x,y)Ry

Where in the above Rx,Ry,Sx,Sy are all partial derivatives and ω(x,y) is the right hand side of the original ode given by

ω(x,y)=(x+y)2

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=11+(x+y)2Sy=11+(x+y)2

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

(2A)dSdR=1

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

dSdR=1

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 ddRS(R)=f(R), then we only need to integrate f(R).

dS=1dRS(R)=R+c3

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

arctan(x+y)=x+c3

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)

dydx=(x+y)2

dSdR=1

R=xS=arctan(x+y)

Solving for y gives

y=x+tan(x+c3)
Figure 2.54: Slope field y=(x+y)2

Summary of solutions found

y=x+tan(x+c3)
Solved using first_order_ode_riccati

Time used: 0.546 (sec)

Solve

y=(x+y)2

In canonical form the ODE is

y=F(x,y)=(x+y)2

This is a Riccati ODE. Comparing the ODE to solve

y=x2+2xy+y2

With Riccati ODE standard form

y=f0(x)+f1(x)y+f2(x)y2

Shows that f0(x)=x2, f1(x)=2x and f2(x)=1. Let

y=uf2u(1)=uu

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

(2)f2u(x)(f2+f1f2)u(x)+f22f0u(x)=0

But

f2=0f1f2=2xf22f0=x2

Substituting the above terms back in equation (2) gives

u(x)2xu(x)+x2u(x)=0

Solved as second order ode using change of variable on y method 1

Time used: 0.214 (sec)

In normal form the given ode is written as

(2)u+p(x)u+q(x)u=0

Where

p(x)=2xq(x)=x2

Calculating the Liouville ode invariant Q given by

Q=qp2p24=x2(2x)2(2x)24=x2(2)2(4x2)4=x2(1)x2=1

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

(3)u=v(x)z(x)

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

z(x)=ep(x)2dx=e2x2(5)=ex22

Hence (3) becomes

(4)u=v(x)ex22

Applying this change of variable to the original ode results in

ex22(v(x)+v(x))=0

Which is now solved for v(x).

The above ode can be simplified to

v(x)+v(x)=0

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

Av(x)+Bv(x)+Cv(x)=0

Where in the above A=1,B=0,C=1. Let the solution be v=eλx. Substituting this into the ODE gives

(1)λ2exλ+exλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλx gives

(2)λ2+1=0

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

λ1,2=B2A±12AB24AC

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

λ1,2=0(2)(1)±1(2)(1)02(4)(1)(1)=±i

Hence

λ1=+iλ2=i

Which simplifies to

λ1=iλ2=i

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

λ1,2=α±iβ

Where α=0 and β=1. Therefore the final solution, when using Euler relation, can be written as

v=eαx(c4cos(βx)+c5sin(βx))

Which becomes

v=e0(c4cos(x)+c5sin(x))

Or

v=c4cos(x)+c5sin(x)

Will add steps showing solving for IC soon.

Now that v is known, then

u(x)=vz(x)(7)=(c4cos(x)+c5sin(x))(z(x))

But from (5)

z(x)=ex22

Hence (7) becomes

u(x)=(c4cos(x)+c5sin(x))ex22

Will add steps showing solving for IC soon.

Summary of solutions found

u(x)=(c4cos(x)+c5sin(x))ex22

Solved as second order ode using Kovacic algorithm

Time used: 0.143 (sec)

Solve

u2xu+x2u=0

Writing the ode as

(1)u2xu+x2u=0(2)Au+Bu+Cu=0

Comparing (1) and (2) shows that

A=1(3)B=2xC=x2

Applying the Liouville transformation on the dependent variable gives

z(x)=ueB2Adx

Then (2) becomes

(4)z(x)=rz(x)

Where r is given by

(5)r=st=2AB2BA+B24AC4A2

Substituting the values of A,B,C from (3) in the above and simplifying gives

(6)r=11

Comparing the above to (5) shows that

s=1t=1

Therefore eq. (4) becomes

(7)z(x)=z(x)

Equation (7) is now solved. After finding z(x) then u is found using the inverse transformation

u=z(x)eB2Adx

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of r and the order of r at . The following table summarizes these cases.

Case

Allowed pole order for r

Allowed value for O()

1

{0,1,2,4,6,8,}

{,6,4,2,0,2,3,4,5,6,}

2

Need to have at least one pole that is either order 2 or odd order greater than 2. Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. {1,2},{1,3},{2},{3},{3,4},{1,2,5}.

no condition

3

{1,2}

{2,3,4,5,6,7,}

Table 2.9: Necessary conditions for each Kovacic case

The order of r at is the degree of t minus the degree of s. Therefore

O()=deg(t)deg(s)=00=0

There are no poles in r. Therefore the set of poles Γ is empty. Since there is no odd order pole larger than 2 and the order at is 0 then the necessary conditions for case one are met. Therefore

L=[1]

Since r=1 is not a function of x, then there is no need run Kovacic algorithm to obtain a solution for transformed ode z=rz as one solution is

z1(x)=cos(x)

Using the above, the solution for the original ode can now be found. The first solution to the original ode in u is found from

u1=z1e12BAdx=z1e122x1dx=z1ex22=z1(ex22)

Which simplifies to

u1=cos(x)ex22

The second solution u2 to the original ode is found using reduction of order

u2=u1eBAdxu12dx

Substituting gives

u2=u1e2x1dx(u1)2dx=u1ex2(u1)2dx=u1(tan(x))

Therefore the solution is

u=c1u1+c2u2=c1(cos(x)ex22)+c2(cos(x)ex22(tan(x)))

Will add steps showing solving for IC soon.

Summary of solutions found

u=c1cos(x)ex22+c2sin(x)ex22

Taking derivative gives

u(x)=(c4sin(x)+c5cos(x))ex22+(c4cos(x)+c5sin(x))xex22

Doing change of constants, the solution becomes

y=((c1sin(x)+cos(x))ex22+(c1cos(x)+sin(x))xex22)ex22c1cos(x)+sin(x)

Which simplifies to

y=(c1x1)cos(x)sin(x)(c1+x)c1cos(x)+sin(x)
Figure 2.55: Slope field y=(x+y)2

Summary of solutions found

y=(c1x1)cos(x)sin(x)(c1+x)c1cos(x)+sin(x)
Maple. Time used: 0.005 (sec). Leaf size: 16
ode:=diff(y(x),x) = (x+y(x))^2; 
dsolve(ode,y(x), singsol=all);
 
y=xtan(x+c1)

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 step by step

Let’s solveddxy(x)=(x+y(x))2Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=(x+y(x))2
Mathematica. Time used: 0.509 (sec). Leaf size: 14
ode=D[y[x],x]==(x+y[x])^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)x+tan(x+c1)
Sympy. Time used: 0.283 (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(x)=C1x+iC1+xe2ix+ie2ixC1e2ix