2.1.15 Problem 3 (iii)

Solved using first_order_ode_homog_A
Solved using first_order_ode_homog_type_D2
Solved using first_order_ode_isobaric
Solved using first_order_ode_LIE
Solved using first_order_ode_dAlembert
Maple
Mathematica
Sympy

Internal problem ID [18431]
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 (iii)
Date solved : Monday, March 31, 2025 at 05:28:23 PM
CAS classification : [[_homogeneous, `class A`], _dAlembert]

Solved using first_order_ode_homog_A

Time used: 0.310 (sec)

Solve

x=cos(xt)

In canonical form, the ODE is

x=F(t,x)(1)=cos(xt)

An ode of the form x=M(t,x)N(t,x) is called homogeneous if the functions M(t,x) and N(t,x) are both homogeneous functions and of the same order. Recall that a function f(t,x) is homogeneous of order n if

f(tnt,tnx)=tnf(t,x)

In this case, it can be seen that both M=cos(xt) and N=1 are both homogeneous and of the same order n=0. Therefore this is a homogeneous ode. Since this ode is homogeneous, it is converted to separable ODE using the substitution u=xt, or x=ut. Hence

dxdt=dudtt+u

Applying the transformation x=ut to the above ODE in (1) gives

dudtt+u=cos(u)dudt=cos(u(t))u(t)t

Or

u(t)cos(u(t))u(t)t=0

Or

u(t)tcos(u(t))+u(t)=0

Which is now solved as separable in u(t).

The ode

(1)u(t)=cos(u(t))u(t)t

is separable as it can be written as

u(t)=cos(u(t))u(t)t=f(t)g(u)

Where

f(t)=1tg(u)=cos(u)u

Integrating gives

1g(u)du=f(t)dt1cos(u)udu=1tdt
u(t)1cos(τ)τdτ=ln(t)+c1

We now need to find the singular solutions, these are found by finding for what values g(u) is zero, since we had to divide by this above. Solving g(u)=0 or

cos(u)u=0

for u(t) gives

u(t)=RootOf(cos(_Z)+_Z)

Now we go over each such singular solution and check if it verifies the ode itself and any initial conditions given. If it does not then the singular solution will not be used.

The solution RootOf(cos(_Z)+_Z) will not be used

Converting u(t)1cos(τ)τdτ=ln(t)+c1 back to x gives

xt1cos(τ)τdτ=ln(t)+c1
Figure 2.17: Slope field x=cos(xt)

Summary of solutions found

xt1cos(τ)τdτ=ln(t)+c1
Solved using first_order_ode_homog_type_D2

Time used: 0.074 (sec)

Solve

x=cos(xt)

Applying change of variables x=u(t)t, then the ode becomes

u(t)t+u(t)=cos(u(t))

Which is now solved The ode

(2)u(t)=u(t)cos(u(t))t

is separable as it can be written as

u(t)=u(t)cos(u(t))t=f(t)g(u)

Where

f(t)=1tg(u)=u+cos(u)

Integrating gives

1g(u)du=f(t)dt1u+cos(u)du=1tdt
u(t)1τ+cos(τ)dτ=ln(t)+c2

We now need to find the singular solutions, these are found by finding for what values g(u) is zero, since we had to divide by this above. Solving g(u)=0 or

u+cos(u)=0

for u(t) gives

u(t)=RootOf(cos(_Z)+_Z)

Now we go over each such singular solution and check if it verifies the ode itself and any initial conditions given. If it does not then the singular solution will not be used.

The solution RootOf(cos(_Z)+_Z) will not be used

Converting u(t)1τ+cos(τ)dτ=ln(t)+c2 back to x gives

xt1τ+cos(τ)dτ=ln(t)+c2
Figure 2.18: Slope field x=cos(xt)

Summary of solutions found

xt1τ+cos(τ)dτ=ln(t)+c2
Solved using first_order_ode_isobaric

Time used: 0.093 (sec)

Solve

x=cos(xt)

Solving for x gives

(1)x=cos(xt)

Each of the above ode’s is now solved An ode x=f(t,x) is isobaric if

(1)f(tt,tmx)=tm1f(t,x)

Where here

(2)f(t,x)=cos(xt)

m is the order of isobaric. Substituting (2) into (1) and solving for m gives

m=1

Since the ode is isobaric of order m=1, then the substitution

x=utm=ut

Converts the ODE to a separable in u(t). Performing this substitution gives

u(t)+tu(t)=cos(u(t))

The ode

(3)u(t)=u(t)cos(u(t))t

is separable as it can be written as

u(t)=u(t)cos(u(t))t=f(t)g(u)

Where

f(t)=1tg(u)=u+cos(u)

Integrating gives

1g(u)du=f(t)dt1u+cos(u)du=1tdt
u(t)1τ+cos(τ)dτ=ln(t)+c3

We now need to find the singular solutions, these are found by finding for what values g(u) is zero, since we had to divide by this above. Solving g(u)=0 or

u+cos(u)=0

for u(t) gives

u(t)=RootOf(cos(_Z)+_Z)

Now we go over each such singular solution and check if it verifies the ode itself and any initial conditions given. If it does not then the singular solution will not be used.

The solution RootOf(cos(_Z)+_Z) will not be used

Converting u(t)1τ+cos(τ)dτ=ln(t)+c3 back to x gives

xt1τ+cos(τ)dτ=ln(t)+c3
Figure 2.19: Slope field x=cos(xt)

Summary of solutions found

xt1τ+cos(τ)dτ=ln(t)+c3
Solved using first_order_ode_LIE

Time used: 0.417 (sec)

Solve

x=cos(xt)

Writing the ode as

x=cos(xt)x=ω(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 1 to use as anstaz gives

(1E)ξ=ta2+xa3+a1(2E)η=tb2+xb3+b1

Where the unknown coefficients are

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

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

(5E)b2+cos(xt)(b3a2)cos(xt)2a3xsin(xt)(ta2+xa3+a1)t2+sin(xt)(tb2+xb3+b1)t=0

Putting the above in normal form gives

cos(xt)2a3t2+sin(xt)t2b2sin(xt)txa2+sin(xt)txb3sin(xt)x2a3cos(xt)t2a2+cos(xt)t2b3+sin(xt)tb1sin(xt)xa1+b2t2t2=0

Setting the numerator to zero gives

(6E)cos(xt)2a3t2+sin(xt)t2b2sin(xt)txa2+sin(xt)txb3sin(xt)x2a3cos(xt)t2a2+cos(xt)t2b3+sin(xt)tb1sin(xt)xa1+b2t2=0

Simplifying the above gives

(6E)b2t2a3t22a3t2cos(2xt)2+sin(xt)t2b2sin(xt)txa2+sin(xt)txb3sin(xt)x2a3cos(xt)t2a2+cos(xt)t2b3+sin(xt)tb1sin(xt)xa1=0

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

{t,x,cos(xt),cos(2xt),sin(xt)}

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

{t=v1,x=v2,cos(xt)=v3,cos(2xt)=v4,sin(xt)=v5}

The above PDE (6E) now becomes

(7E)b2v1212a3v1212a3v12v4+v5v12b2v5v1v2a2+v5v1v2b3v5v22a3v3v12a2+v3v12b3+v5v1b1v5v2a1=0

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

{v1,v2,v3,v4,v5}

Equation (7E) now becomes

(8E)(b2a32)v12+(b3a2)v2v1v5a3v12v42+v5v12b2v5v22a3+(b3a2)v12v3+v5v1b1v5v2a1=0

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

b1=0b2=0a1=0a3=0a32=0b2a32=0b3a2=0

Solving the above equations for the unknowns gives

a1=0a2=b3a3=0b1=0b2=0b3=b3

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

ξ=tη=x

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). Therefore

dxdt=ηξ=xt=xt

This is easily solved to give

x=c1t

Where now the coordinate R is taken as the constant of integration. Hence

R=xt

And S is found from

dS=dtξ=dtt

Integrating gives

S=dtT=ln(t)

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

(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)=cos(xt)

Evaluating all the partial derivatives gives

Rt=xt2Rx=1tSt=1tSx=0

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

(2A)dSdR=tcos(xt)tx

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=1cos(R)R

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=1cos(R)RdRS(R)=1cos(R)RdR+c5
S(R)=1cos(R)RdR+c5

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

ln(t)=xt1cos(_a)_ad_a+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=cos(xt)

dSdR=1cos(R)R

R=xtS=ln(t)

Figure 2.20: Slope field x=cos(xt)

Summary of solutions found

ln(t)=xt1cos(_a)_ad_a+c5
Solved using first_order_ode_dAlembert

Time used: 0.369 (sec)

Solve

x=cos(xt)

Let p=x the ode becomes

p=cos(xt)

Solving for x from the above results in

(1)x=arccos(p)t

This has the form

(*)x=tf(p)+g(p)

Where f,g are functions of p=x(t). The above ode is dAlembert ode which is now solved.

Taking derivative of (*) w.r.t. t gives

p=f+(tf+g)dpdt(2)pf=(tf+g)dpdt

Comparing the form x=tf+g to (1A) shows that

f=arccos(p)g=0

Hence (2) becomes

(2A)parccos(p)=tp(t)p2+1

The singular solution is found by setting dpdt=0 in the above which gives

parccos(p)=0

No valid singular solutions found.

The general solution is found when dpdt0. From eq. (2A). This results in

(3)p(t)=(p(t)arccos(p(t)))p(t)2+1t

This ODE is now solved for p(t). No inversion is needed.

The ode

(4)p(t)=(p(t)+arccos(p(t)))p(t)2+1t

is separable as it can be written as

p(t)=(p(t)+arccos(p(t)))p(t)2+1t=f(t)g(p)

Where

f(t)=1tg(p)=(p+arccos(p))p2+1

Integrating gives

1g(p)dp=f(t)dt1(p+arccos(p))p2+1dp=1tdt
p(t)1(τ+arccos(τ))τ2+1dτ=ln(t)+c6

We now need to find the singular solutions, these are found by finding for what values g(p) is zero, since we had to divide by this above. Solving g(p)=0 or

(p+arccos(p))p2+1=0

for p(t) gives

p(t)=1p(t)=1p(t)=RootOf(cos(_Z)+_Z)

Now we go over each such singular solution and check if it verifies the ode itself and any initial conditions given. If it does not then the singular solution will not be used.

The solution RootOf(cos(_Z)+_Z) will not be used

Therefore the solutions found are

p(t)1(τ+arccos(τ))τ2+1dτ=ln(t)+c6p(t)=1p(t)=1

Substituing the above solution for p in (2A) gives

x=arccos(RootOf(_Z1(τ+arccos(τ))τ2+1dτ+ln(t)+c6))tx=πtx=0

The solution

x=0

was found not to satisfy the ode or the IC. Hence it is removed. The solution

x=πt

was found not to satisfy the ode or the IC. Hence it is removed.

Figure 2.21: Slope field x=cos(xt)

Summary of solutions found

x=arccos(RootOf(_Z1(τ+arccos(τ))τ2+1dτ+ln(t)+c6))t
Maple. Time used: 0.004 (sec). Leaf size: 27
ode:=diff(x(t),t) = cos(x(t)/t); 
dsolve(ode,x(t), singsol=all);
 
x=RootOf(_Z1cos(_a)+_ad_a+ln(t)+c1)t

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 D 
<- homogeneous successful
 

Maple step by step

Let’s solveddtx(t)=cos(x(t)t)Highest derivative means the order of the ODE is1ddtx(t)Solve for the highest derivativeddtx(t)=cos(x(t)t)
Mathematica. Time used: 0.085 (sec). Leaf size: 33
ode=D[x[t],t]==Cos[x[t]/t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
Solve[1x(t)t1K[1]cos(K[1])dK[1]=log(t)+c1,x(t)]
Sympy. Time used: 1.630 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-cos(x(t)/t) + Derivative(x(t), t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
x(t)=C1etx(t)cos(1u1)u1cos(1u1)1du1