2.1.2 Problem 1(b)

Solved as first order linear ode
Solved as first order Exact ode
Solved using Lie symmetry for first order ode
Maple
Mathematica
Sympy

Internal problem ID [4191]
Book : Elementary Differential equations, Chaundy, 1969
Section : Exercises 3, page 60
Problem number : 1(b)
Date solved : Tuesday, March 04, 2025 at 05:55:18 PM
CAS classification : [[_linear, `class A`]]

Solve

y=y+x3

Solved as first order linear ode

Time used: 0.068 (sec)

In canonical form a linear first order is

y+q(x)y=p(x)

Comparing the above to the given ode shows that

q(x)=1p(x)=x3

The integrating factor μ is

μ=eqdx=e(1)dx=ex

The ode becomes

ddx(μy)=μpddx(μy)=(μ)(x3)ddx(yex)=(ex)(x3)d(yex)=(exx3)dx

Integrating gives

yex=exx3dx=(x3+3x2+6x+6)ex+c1

Dividing throughout by the integrating factor ex gives the final solution

y=x3+c1ex3x26x6
Figure 2.9: Slope field yy=x3

Summary of solutions found

y=x3+c1ex3x26x6
Solved as first order Exact ode

Time used: 0.174 (sec)

To solve an ode of the form

(A)M(x,y)+N(x,y)dydx=0

We assume there exists a function ϕ(x,y)=c where c is constant, that satisfies the ode. Taking derivative of ϕ w.r.t. x gives

ddxϕ(x,y)=0

Hence

(B)ϕx+ϕydydx=0

Comparing (A,B) shows that

ϕx=Mϕy=N

But since 2ϕxy=2ϕyx then for the above to be valid, we require that

My=Nx

If the above condition is satisfied, then the original ode is called exact. We still need to determine ϕ(x,y) but at least we know now that we can do that since the condition 2ϕxy=2ϕyx is satisfied. If this condition is not satisfied then this method will not work and we have to now look for an integrating factor to force this condition, which might or might not exist. The first step is to write the ODE in standard form to check for exactness, which is

(1A)M(x,y)dx+N(x,y)dy=0

Therefore

dy=(x3+y)dx(2A)(x3y)dx+dy=0

Comparing (1A) and (2A) shows that

M(x,y)=x3yN(x,y)=1

The next step is to determine if the ODE is is exact or not. The ODE is exact when the following condition is satisfied

My=Nx

Using result found above gives

My=y(x3y)=1

And

Nx=x(1)=0

Since MyNx, then the ODE is not exact. Since the ODE is not exact, we will try to find an integrating factor to make it exact. Let

A=1N(MyNx)=1((1)(0))=1

Since A does not depend on y, then it can be used to find an integrating factor. The integrating factor μ is

μ=eAdx=e1dx

The result of integrating gives

μ=ex=ex

M and N are multiplied by this integrating factor, giving new M and new N which are called M and N for now so not to confuse them with the original M and N.

M=μM=ex(x3y)=(x3+y)ex

And

N=μN=ex(1)=ex

Now a modified ODE is ontained from the original ODE, which is exact and can be solved. The modified ODE is

M+Ndydx=0((x3+y)ex)+(ex)dydx=0

The following equations are now set up to solve for the function ϕ(x,y)

(1)ϕx=M(2)ϕy=N

Integrating (2) w.r.t. y gives

ϕydy=Ndyϕydy=exdy(3)ϕ=yex+f(x)

Where f(x) is used for the constant of integration since ϕ is a function of both x and y. Taking derivative of equation (3) w.r.t x gives

(4)ϕx=yex+f(x)

But equation (1) says that ϕx=(x3+y)ex. Therefore equation (4) becomes

(5)(x3+y)ex=yex+f(x)

Solving equation (5) for f(x) gives

f(x)=exx3

Integrating the above w.r.t x gives

f(x)dx=(exx3)dxf(x)=(x3+3x2+6x+6)ex+c1

Where c1 is constant of integration. Substituting result found above for f(x) into equation (3) gives ϕ

ϕ=yex+(x3+3x2+6x+6)ex+c1

But since ϕ itself is a constant function, then let ϕ=c2 where c2 is new constant and combining c1 and c2 constants into the constant c1 gives the solution as

c1=yex+(x3+3x2+6x+6)ex

Solving for y gives

y=(exx3+3exx2+6xex+6exc1)ex
Figure 2.10: Slope field y=y+x3

Summary of solutions found

y=(exx3+3exx2+6xex+6exc1)ex
Solved using Lie symmetry for first order ode

Time used: 0.714 (sec)

Writing the ode as

y=x3+yy=ω(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 2 to use as anstaz gives

(1E)ξ=x2a4+yxa5+y2a6+xa2+ya3+a1(2E)η=x2b4+yxb5+y2b6+xb2+yb3+b1

Where the unknown coefficients are

{a1,a2,a3,a4,a5,a6,b1,b2,b3,b4,b5,b6}

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

(5E)2xb4+yb5+b2+(x3+y)(2xa4+xb5ya5+2yb6a2+b3)(x3+y)2(xa5+2ya6+a3)3x2(x2a4+yxa5+y2a6+xa2+ya3+a1)x2b4yxb5y2b6xb2yb3b1=0

Putting the above in normal form gives

x7a52x6ya6x6a32x4ya54x3y2a65x4a4+x4b52x3ya34x3ya5+2x3yb63x2y2a64x3a2+x3b33x2ya3xy2a52y3a63x2a1x2b42xya4y2a3y2a5+y2b6xb2+2xb4ya2+yb5b1+b2=0

Setting the numerator to zero gives

(6E)x7a52x6ya6x6a32x4ya54x3y2a65x4a4+x4b52x3ya34x3ya5+2x3yb63x2y2a64x3a2+x3b33x2ya3xy2a52y3a63x2a1x2b42xya4y2a3y2a5+y2b6xb2+2xb4ya2+yb5b1+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)a5v172a6v16v2a3v162a5v14v24a6v13v222a3v13v25a4v144a5v13v23a6v12v22+b5v14+2b6v13v24a2v133a3v12v2a5v1v222a6v23+b3v133a1v12a3v222a4v1v2a5v22b4v12+b6v22a2v2b2v1+2b4v1+b5v2b1+b2=0

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

{v1,v2}

Equation (7E) now becomes

(8E)a5v172a6v16v2a3v162a5v14v2+(5a4+b5)v144a6v13v22+(2a34a5+2b6)v13v2+(4a2+b3)v133a6v12v223a3v12v2+(3a1b4)v12a5v1v222a4v1v2+(b2+2b4)v12a6v23+(a3a5+b6)v22+(a2+b5)v2b1+b2=0

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

3a3=0a3=02a4=02a5=0a5=04a6=03a6=02a6=03a1b4=04a2+b3=0a2+b5=05a4+b5=0b1+b2=0b2+2b4=02a34a5+2b6=0a3a5+b6=0

Solving the above equations for the unknowns gives

a1=b43a2=0a3=0a4=0a5=0a6=0b1=2b4b2=2b4b3=0b4=b4b5=0b6=0

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

ξ=13η=x2+2x+2

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

η=ηω(x,y)ξ=x2+2x+2(x3+y)(13)=x2+2x+2+13x3+13yξ=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+2x+2+13x3+13ydy

Which results in

S=3ln(x3+3x2+6x+y+6)

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)=x3+y

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=9x2+18x+18x3+3x2+6x+y+6Sy=3x3+3x2+6x+y+6

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

(2A)dSdR=3

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=3

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=3dRS(R)=3R+c2

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

3ln(x3+3x2+6x+y+6)=3x+c2

Which gives

y=ex+c23x33x26x6

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=x3+y

dSdR=3

R=xS=3ln(x3+3x2+6x+y+6)

Figure 2.11: Slope field y=y+x3

Summary of solutions found

y=ex+c23x33x26x6
Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(y(x),x)-y(x) = x^3; 
dsolve(ode,y(x), singsol=all);
 
y(x)=x33x26x6+exc1

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
<- 1st order linear successful`
 

Maple step by step

Let’s solveddxy(x)y(x)=x3Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=y(x)+x3Group terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODEddxy(x)y(x)=x3The ODE is linear; multiply by an integrating factorμ(x)μ(x)(ddxy(x)y(x))=μ(x)x3Assume the lhs of the ODE is the total derivativeddx(y(x)μ(x))μ(x)(ddxy(x)y(x))=(ddxy(x))μ(x)+y(x)(ddxμ(x))Isolateddxμ(x)ddxμ(x)=μ(x)Solve to find the integrating factorμ(x)=exIntegrate both sides with respect tox(ddx(y(x)μ(x)))dx=μ(x)x3dx+C1Evaluate the integral on the lhsy(x)μ(x)=μ(x)x3dx+C1Solve fory(x)y(x)=μ(x)x3dx+C1μ(x)Substituteμ(x)=exy(x)=x3exdx+C1exEvaluate the integrals on the rhsy(x)=(x3+3x2+6x+6)ex+C1exSimplifyy(x)=x3+C1ex3x26x6
Mathematica. Time used: 0.047 (sec). Leaf size: 26
ode=D[y[x],x]-y[x]==x^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)x33x26x+c1ex6
Sympy. Time used: 0.110 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 - y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1exx33x26x6