2.1.7 Problem 7

Solved using first_order_ode_linear
Solved using first_order_ode_exact
Solved using first_order_ode_LIE
Maple
Mathematica
Sympy

Internal problem ID [8990]
Book : First order enumerated odes
Section : section 1
Problem number : 7
Date solved : Friday, April 18, 2025 at 01:35:38 PM
CAS classification : [[_linear, `class A`]]

Solved using first_order_ode_linear

Time used: 0.100 (sec)

Solve

y=ax+y

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)=ax

The integrating factor μ is

μ=eqdx=e(1)dx=ex

The ode becomes

ddx(μy)=μpddx(μy)=(μ)(ax)ddx(yex)=(ex)(ax)d(yex)=(axex)dx

Integrating gives

yex=axexdx=(x+1)aex+c1

Dividing throughout by the integrating factor ex gives the final solution

y=exc1(x+1)a

Summary of solutions found

y=exc1(x+1)a
Solved using first_order_ode_exact

Time used: 0.167 (sec)

Solve

y=ax+y

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=(ax+y)dx(2A)(axy)dx+dy=0

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

M(x,y)=axyN(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(axy)=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(axy)=(ax+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((ax+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=(ax+y)ex. Therefore equation (4) becomes

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

Solving equation (5) for f(x) gives

f(x)=axex

Integrating the above w.r.t x gives

f(x)dx=(axex)dxf(x)=(x+1)aex+c2

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

ϕ=yex+(x+1)aex+c2

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

c2=yex+(x+1)aex

Solving for y gives

y=(axex+aexc2)ex

Which simplifies to

y=(x+1)a+exc2

Summary of solutions found

y=(x+1)a+exc2
Solved using first_order_ode_LIE

Time used: 0.285 (sec)

Solve

y=ax+y

Writing the ode as

y=ax+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 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+(ax+y)(b3a2)(ax+y)2a3a(xa2+ya3+a1)xb2yb3b1=0

Putting the above in normal form gives

a2x2a32axya32axa2+axb3aya3y2a3aa1xb2ya2b1+b2=0

Setting the numerator to zero gives

(6E)a2x2a32axya32axa2+axb3aya3y2a3aa1xb2ya2b1+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)a2a3v122aa3v1v22aa2v1aa3v2+ab3v1a3v22aa1a2v2b2v1b1+b2=0

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

{v1,v2}

Equation (7E) now becomes

(8E)a2a3v122aa3v1v2+(2aa2+ab3b2)v1a3v22+(aa3a2)v2aa1b1+b2=0

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

a3=02aa3=0a2a3=0aa3a2=0aa1b1+b2=02aa2+ab3b2=0

Solving the above equations for the unknowns gives

a1=a1a2=0a3=0b1=aa1+ab3b2=ab3b3=b3

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

ξ=0η=ax+a+y

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=1ax+a+ydy

Which results in

S=ln(ax+a+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)=ax+y

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=aax+a+ySy=1ax+a+y

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+c5

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

ln(ax+a+y)=x+c5

Solving for y gives

y=ex+c5axa

Summary of solutions found

y=ex+c5axa
Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=diff(y(x),x) = a*x+y(x); 
dsolve(ode,y(x), singsol=all);
 
y=exc1a(x+1)

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)=ax+y(x)Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=ax+y(x)Group terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODEddxy(x)y(x)=axThe ODE is linear; multiply by an integrating factorμ(x)μ(x)(ddxy(x)y(x))=μ(x)axAssume 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)axdx+C1Evaluate the integral on the lhsy(x)μ(x)=μ(x)axdx+C1Solve fory(x)y(x)=μ(x)axdx+C1μ(x)Substituteμ(x)=exy(x)=exaxdx+C1exEvaluate the integrals on the rhsy(x)=(x+1)exa+C1exSimplifyy(x)=(x+1)a+exC1
Mathematica. Time used: 0.03 (sec). Leaf size: 18
ode=D[y[x],x]==a*x+y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)a(x+1)+c1ex
Sympy. Time used: 0.112 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a*x - y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1exaxa