2.1.58 Problem 58

Solved using first_order_ode_form_A1
Solved using first_order_ode_LIE
Solved using first_order_ode_dAlembert
Maple
Mathematica
Sympy

Internal problem ID [8770]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 58
Date solved : Sunday, March 30, 2025 at 01:30:53 PM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

Solved using first_order_ode_form_A1

Time used: 0.055 (sec)

Solve

y=4sin(y+x)4

The given ode has the general form

(1)y=B+Cf(ax+by+c)

Comparing (1) to the ode given shows the parameters in the ODE have these values

B=4C=4a=1b=1c=0

This form of ode can be solved by change of variables u=ax+by+c which makes the ode separable.

u(x)=a+by

Or

y=u(x)ab

The ode becomes

uab=B+Cf(u)u=bB+bCf(u)+adubB+bCf(u)+a=dx

Integrating gives

dubB+bCf(u)+a=x+c1udτbB+bCf(τ)+a=x+c1

Replacing back u=ax+by+c the above becomes

(2)ax+by+cdτbB+bCf(τ)+a=x+c1

If initial conditions are given as y(x0)=y0, the above becomes

0ax0+by0+cdτbB+bCf(τ)+a=x0+c1c1=0ax+by0+cdτbB+bCf(τ)+ax0

Substituting this into (2) gives

(3)ax+by+cdτbB+bCf(τ)+a=x+0ax+by0+cdτbB+bCf(τ)+ax0

Solving for y gives

y=x2arctan(3tan(3x2+3c12)545)
Figure 2.119: Slope field y=4sin(y+x)4

Summary of solutions found

y=x2arctan(3tan(3x2+3c12)545)
Solved using first_order_ode_LIE

Time used: 1.542 (sec)

Solve

y=4sin(y+x)4

Writing the ode as

y=4sin(y+x)4y=ω(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+(4sin(y+x)4)(b3a2)(4sin(y+x)4)2a3+4cos(y+x)(xa2+ya3+a1)4cos(y+x)(xb2+yb3+b1)=0

Putting the above in normal form gives

16sin(y+x)2a3+4cos(y+x)xa24cos(y+x)xb2+4cos(y+x)ya34cos(y+x)yb3+4sin(y+x)a232sin(y+x)a34sin(y+x)b3+4cos(y+x)a14cos(y+x)b1+4a216a3+b24b3=0

Setting the numerator to zero gives

(6E)16sin(y+x)2a3+4cos(y+x)xa24cos(y+x)xb2+4cos(y+x)ya34cos(y+x)yb3+4sin(y+x)a232sin(y+x)a34sin(y+x)b3+4cos(y+x)a14cos(y+x)b1+4a216a3+b24b3=0

Simplifying the above gives

(6E)4a224a3+b24b3+4cos(y+x)xa24cos(y+x)xb2+4cos(y+x)ya34cos(y+x)yb3+4sin(y+x)a232sin(y+x)a34sin(y+x)b3+4cos(y+x)a14cos(y+x)b1+8a3cos(2x2y)=0

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

{x,y,cos(2x2y),cos(y+x),sin(y+x)}

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

{x=v1,y=v2,cos(2x2y)=v3,cos(y+x)=v4,sin(y+x)=v5}

The above PDE (6E) now becomes

(7E)4v4v1a2+4v4v2a34v4v1b24v4v2b3+4v4a1+4v5a2+8a3v332v5a34v4b14v5b3+4a224a3+b24b3=0

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

{v1,v2,v3,v4,v5}

Equation (7E) now becomes

(8E)(4a24b2)v1v4+(4a34b3)v2v4+8a3v3+(4a14b1)v4+(4a232a34b3)v5+4a224a3+b24b3=0

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

8a3=04a14b1=04a24b2=04a34b3=04a232a34b3=04a224a3+b24b3=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(4sin(y+x)4)(1)=54sin(y)cos(x)+4cos(y)sin(x)ξ=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=154sin(y)cos(x)+4cos(y)sin(x)dy

Which results in

S=2arctan(2(4sin(x)5)tan(y2)+8cos(x)22516cos(x)216sin(x)2)2516cos(x)216sin(x)2

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)=4sin(y+x)4

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=8tan(y2)cos(x)+8sin(x)16(sin(x)54)2tan(y2)2+(32sin(x)40)cos(x)tan(y2)+16cos(x)2+9Sy=154sin(y)cos(x)+4cos(y)sin(x)

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

(2A)dSdR=8tan(y2)cos(x)+8sin(x)16(sin(x)54)2tan(y2)2+(32sin(x)40)cos(x)tan(y2)+16cos(x)2+9+4sin(y)cos(x)+4cos(y)sin(x)+44sin(y)cos(x)4cos(y)sin(x)5

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=4sin(R)+44sin(R)5

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=4(sin(R)1)4sin(R)5dRS(R)=2arctan(5tan(R2)343)3R+c3

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

2arctan((4sin(x)5)tan(y2)3+4cos(x)3)3=2arctan(5tan(x2)343)3x+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=4sin(y+x)4

dSdR=4sin(R)+44sin(R)5

R=xS=2arctan((4sin(x)5)tan(y2)3+4cos(x)3)3

Figure 2.120: Slope field y=4sin(y+x)4

Summary of solutions found

2arctan((4sin(x)5)tan(y2)3+4cos(x)3)3=2arctan(5tan(x2)343)3x+c3
Solved using first_order_ode_dAlembert

Time used: 0.257 (sec)

Solve

y=4sin(y+x)4

Let p=y the ode becomes

p=4sin(y+x)4

Solving for y from the above results in

(1)y=x+arcsin(p4+1)

This has the form

(*)y=xf(p)+g(p)

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

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

p=f+(xf+g)dpdx(2)pf=(xf+g)dpdx

Comparing the form y=xf+g to (1A) shows that

f=1g=arcsin(p4+1)

Hence (2) becomes

(2A)p1=p(x)p28p

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

p1=0

Solving the above for p results in

p1=1

Substituting these in (1A) and keeping singular solution that verifies the ode gives

y=x+arcsin(54)

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

(3)p(x)=(p(x)1)p(x)28p(x)

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

Integrating gives

1(p1)p(8+p)dp=dxarctan(4+5p3p(8+p))3=x+c4

Singular solutions are found by solving

(p1)p(8+p)=0

for p(x). This is because we had to divide by this in the above step. This gives the following singular solution(s), which also have to satisfy the given ODE.

p(x)=8p(x)=0p(x)=1

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

y=xarcsin(9tan(3x+3c4)(4tan(3x+3c4)+5tan(3x+3c4)2+1)5(9tan(3x+3c4)2+25)45)y=xπ2y=x+π2y=x+arcsin(54)

The solution

y=xπ2

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

y=x+π2

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

y=xarcsin(9tan(3x+3c4)(4tan(3x+3c4)+5tan(3x+3c4)2+1)5(9tan(3x+3c4)2+25)45)

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

Figure 2.121: Slope field y=4sin(y+x)4

Summary of solutions found

y=x+arcsin(54)
Maple. Time used: 0.016 (sec). Leaf size: 21
ode:=diff(y(x),x) = -4*sin(x-y(x))-4; 
dsolve(ode,y(x), singsol=all);
 
y=x+2arctan(3tan(3x2+3c12)5+45)

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)=4sin(y(x)+x)4Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=4sin(y(x)+x)4
Mathematica
ode=D[y[x],x]==4*Sin[y[x]-x]-4; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Timed out

Sympy. Time used: 4.755 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*sin(x - y(x)) + Derivative(y(x), x) + 4,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
C1+x2atan(5tan(x2y(x)2)3+43)32πxy(x)π2π3=0