2.1.17 Problem 3 (v)

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

Internal problem ID [18426]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 3. Solutions of first-order equations. Exercises at page 47
Problem number : 3 (v)
Date solved : Saturday, April 26, 2025 at 11:16:10 AM
CAS classification : [[_linear, `class A`]]

Solved using first_order_ode_linear

Time used: 0.071 (sec)

Solve

e3tx+3xe3t=2t

In canonical form a linear first order is

x+q(t)x=p(t)

Comparing the above to the given ode shows that

q(t)=3p(t)=2te3t

The integrating factor μ is

μ=eqdt=e3dt=e3t

The ode becomes

ddt(μx)=μpddt(μx)=(μ)(2te3t)ddt(xe3t)=(e3t)(2te3t)d(xe3t)=(2te3te3t)dt

Integrating gives

xe3t=2te3te3tdt=t2+c1

Dividing throughout by the integrating factor e3t gives the final solution

x=e3t(t2+c1)
Figure 2.27: Slope field e3tx+3xe3t=2t

Summary of solutions found

x=e3t(t2+c1)
Solved using first_order_ode_exact

Time used: 0.154 (sec)

Solve

e3tx+3xe3t=2t

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(t,x)dt+N(t,x)dx=0

Therefore

(e3t)dx=(3xe3t+2t)dt(2A)(3xe3t2t)dt+(e3t)dx=0

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

M(t,x)=3xe3t2tN(t,x)=e3t

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

Mx=Nt

Using result found above gives

Mx=x(3xe3t2t)=3e3t

And

Nt=t(e3t)=3e3t

Since Mx=Nt, then the ODE is exact The following equations are now set up to solve for the function ϕ(t,x)

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

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

ϕxdx=Ndxϕxdx=e3tdx(3)ϕ=xe3t+f(t)

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

(4)ϕt=3xe3t+f(t)

But equation (1) says that ϕt=3xe3t2t. Therefore equation (4) becomes

(5)3xe3t2t=3xe3t+f(t)

Solving equation (5) for f(t) gives

f(t)=2t

Integrating the above w.r.t t gives

f(t)dt=(2t)dtf(t)=t2+c2

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

ϕ=xe3tt2+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=xe3tt2

Solving for x gives

x=(t2+c2)e3t

Which simplifies to

x=(t2+c2)e3t
Figure 2.28: Slope field e3tx+3xe3t=2t

Summary of solutions found

x=(t2+c2)e3t
Solved using first_order_ode_LIE

Time used: 0.622 (sec)

Solve

e3tx+3xe3t=2t

Writing the ode as

x=(3xe3t2t)e3tx=ω(t,x)

The condition of Lie symmetry is the linearized PDE given by

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

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

(1E)ξ=t2a4+txa5+x2a6+ta2+xa3+a1(2E)η=t2b4+txb5+x2b6+tb2+xb3+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)2tb4+xb5+b2(3xe3t2t)e3t(2ta4+tb5xa5+2xb6a2+b3)(3xe3t2t)2e6t(ta5+2xa6+a3)((9xe3t2)e3t+3(3xe3t2t)e3t)(t2a4+txa5+x2a6+ta2+xa3+a1)+3t2b4+3txb5+3x2b6+3tb2+3xb3+3b1=0

Putting the above in normal form gives

(4t2a32e3ta19e6tx2a3+3tb2e6t+3e6txa2+6e3tt2a2+6e3tta14e3tta2+2e3ttb32e3txa39e6ttx2a5+6e6ttxa4+18e3tt2xa5+30e3ttx2a64e3ttxa5+4e3ttxb6+3b1e6t+b2e6t8t2xa6+6e3tt3a46e3tt2a4+2e3tt2b52e3tx2a64t3a518e6tx3a6+3t2b4e6t+3e6tx2a53x2b6e6t+2tb4e6t+xb5e6t+18e3ttxa3)e6t=0

Setting the numerator to zero gives

(6E)4t2a32e3ta19e6tx2a3+3tb2e6t+3e6txa2+6e3tt2a2+6e3tta14e3tta2+2e3ttb32e3txa39e6ttx2a5+6e6ttxa4+18e3tt2xa5+30e3ttx2a64e3ttxa5+4e3ttxb6+3b1e6t+b2e6t8t2xa6+6e3tt3a46e3tt2a4+2e3tt2b52e3tx2a64t3a518e6tx3a6+3t2b4e6t+3e6tx2a53x2b6e6t+2tb4e6t+xb5e6t+18e3ttxa3=0

Simplifying the above gives

(6E)4t2a32e3ta19e6tx2a3+3tb2e6t+3e6txa2+6e3tt2a2+6e3tta14e3tta2+2e3ttb32e3txa39e6ttx2a5+6e6ttxa4+18e3tt2xa5+30e3ttx2a64e3ttxa5+4e3ttxb6+3b1e6t+b2e6t8t2xa6+6e3tt3a46e3tt2a4+2e3tt2b52e3tx2a64t3a518e6tx3a6+3t2b4e6t+3e6tx2a53x2b6e6t+2tb4e6t+xb5e6t+18e3ttxa3=0

Looking at the above PDE shows the following are all the terms with {t,x} in them.

{t,x,e3t,e6t}

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

{t=v1,x=v2,e3t=v3,e6t=v4}

The above PDE (6E) now becomes

(7E)6v3v13a4+18v3v12v2a59v4v1v22a5+30v3v1v22a618v4v23a6+6v3v12a2+18v3v1v2a39v4v22a36v3v12a4+6v4v1v2a44v13a54v3v1v2a5+3v4v22a58v12v2a62v3v22a6+3v12b4v4+2v3v12b5+4v3v1v2b63v22b6v4+6v3v1a14v3v1a2+3v4v2a24v12a32v3v2a3+3v1b2v4+2v3v1b3+2v1b4v4+v2b5v42v3a1+3b1v4+b2v4=0

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

{v1,v2,v3,v4}

Equation (7E) now becomes

(8E)6v3v13a44v13a5+18v3v12v2a58v12v2a6+(6a26a4+2b5)v12v3+3v12b4v44v12a3+30v3v1v22a69v4v1v22a5+(18a34a5+4b6)v1v2v3+6v4v1v2a4+(6a14a2+2b3)v1v3+(3b2+2b4)v1v418v4v23a62v3v22a6+(9a3+3a53b6)v22v42v3v2a3+(3a2+b5)v2v42v3a1+(3b1+b2)v4=0

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

2a1=04a3=02a3=06a4=09a5=04a5=018a5=018a6=08a6=02a6=030a6=03b4=03a2+b5=03b1+b2=03b2+2b4=06a14a2+2b3=06a26a4+2b5=09a3+3a53b6=018a34a5+4b6=0

Solving the above equations for the unknowns gives

a1=0a2=b53a3=0a4=0a5=0a6=0b1=0b2=0b3=2b53b4=0b5=b5b6=0

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

ξ=t3η=tx23x

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

η=ηω(t,x)ξ=tx23x((3xe3t2t)e3t)(t3)=(2xe3t+2t2)e3t3ξ=0

The next step is to determine the canonical coordinates R,S. The canonical coordinates map (t,x)(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)dtξ=dxη=dS

The above comes from the requirements that (ξt+ηx)S(t,x)=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=t

S is found from

S=1ηdy=1(2xe3t+2t2)e3t3dy

Which results in

S=3ln(xe3t+t2)2

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

(2)dSdR=St+ω(t,x)SxRt+ω(t,x)Rx

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

ω(t,x)=(3xe3t2t)e3t

Evaluating all the partial derivatives gives

Rt=1Rx=0St=9xe3t+6t2xe3t2t2Sx=32e3tt22x

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

(2A)dSdR=0

We now need to express the RHS as function of R only. This is done by solving for t,x in terms of R,S from the result obtained earlier and simplifying. This gives

dSdR=0

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=0dR+c5S(R)=c5

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

3ln(xe3t+t2)2=c5

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 t,x coordinates

Canonical coordinates transformation

ODE in canonical coordinates (R,S)

dxdt=(3xe3t2t)e3t

dSdR=0

R=tS=3ln(xe3t+t2)2

Solving for x gives

x=(e2c53t2)e3t

Which simplifies to

x=(e2c53+t2)e3t
Figure 2.29: Slope field e3tx+3xe3t=2t

Summary of solutions found

x=(e2c53+t2)e3t
Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=diff(x(t),t)*exp(3*t)+3*x(t)*exp(3*t) = 2*t; 
dsolve(ode,x(t), singsol=all);
 
x=(t2+c1)e3t

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 solvee3t(ddtx(t))+3x(t)e3t=2tHighest derivative means the order of the ODE is1ddtx(t)Isolate the derivativeddtx(t)=3x(t)+2te3tGroup terms withx(t)on the lhs of the ODE and the rest on the rhs of the ODEddtx(t)+3x(t)=2te3tThe ODE is linear; multiply by an integrating factorμ(t)μ(t)(ddtx(t)+3x(t))=2μ(t)te3tAssume the lhs of the ODE is the total derivativeddt(x(t)μ(t))μ(t)(ddtx(t)+3x(t))=(ddtx(t))μ(t)+x(t)(ddtμ(t))Isolateddtμ(t)ddtμ(t)=3μ(t)Solve to find the integrating factorμ(t)=(e3t)2e3tIntegrate both sides with respect tot(ddt(x(t)μ(t)))dt=2μ(t)te3tdt+C1Evaluate the integral on the lhsx(t)μ(t)=2μ(t)te3tdt+C1Solve forx(t)x(t)=2μ(t)te3tdt+C1μ(t)Substituteμ(t)=(e3t)2e3tx(t)=2e3te3ttdt+C1(e3t)2e3tEvaluate the integrals on the rhsx(t)=t2+C1(e3t)2e3tSimplifyx(t)=e3t(t2+C1)
Mathematica. Time used: 0.062 (sec). Leaf size: 17
ode=Exp[3*t]*D[x[t],t]+3*x[t]*Exp[3*t]==2*t; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
x(t)e3t(t2+c1)
Sympy. Time used: 0.173 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-2*t + 3*x(t)*exp(3*t) + exp(3*t)*Derivative(x(t), t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
x(t)=(C1+t2)e3t