2.1.88 Problem 87

Solved as second order linear constant coeff ode
Solved as second order ode using Kovacic algorithm
Solved as second order ode adjoint method
Maple
Mathematica
Sympy

Internal problem ID [8800]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 87
Date solved : Wednesday, March 05, 2025 at 06:51:23 AM
CAS classification : [[_2nd_order, _missing_x]]

Solve

y+y+y=0

With initial conditions

y(0)=0

Solved as second order linear constant coeff ode

Time used: 0.099 (sec)

This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

Ay(x)+By(x)+Cy(x)=0

Where in the above A=1,B=1,C=1. Let the solution be y=eλx. Substituting this into the ODE gives

(1)λ2exλ+λexλ+exλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλx gives

(2)λ2+λ+1=0

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

λ1,2=B2A±12AB24AC

Substituting A=1,B=1,C=1 into the above gives

λ1,2=1(2)(1)±1(2)(1)12(4)(1)(1)=12±i32

Hence

λ1=12+i32λ2=12i32

Which simplifies to

λ1=12+i32λ2=12i32

Since roots are complex conjugate of each others, then let the roots be

λ1,2=α±iβ

Where α=12 and β=32. Therefore the final solution, when using Euler relation, can be written as

y=eαx(c1cos(βx)+c2sin(βx))

Which becomes

y=ex2(c1cos(3x2)+c2sin(3x2))

Will add steps showing solving for IC soon.

Summary of solutions found

y=ex2c2sin(3x2)
Figure 2.172: Slope field y+y+y=0
Solved as second order ode using Kovacic algorithm

Time used: 0.243 (sec)

Writing the ode as

(1)y+y+y=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=1(3)B=1C=1

Applying the Liouville transformation on the dependent variable gives

z(x)=yeB2Adx

Then (2) becomes

(4)z(x)=rz(x)

Where r is given by

(5)r=st=2AB2BA+B24AC4A2

Substituting the values of A,B,C from (3) in the above and simplifying gives

(6)r=34

Comparing the above to (5) shows that

s=3t=4

Therefore eq. (4) becomes

(7)z(x)=3z(x)4

Equation (7) is now solved. After finding z(x) then y is found using the inverse transformation

y=z(x)eB2Adx

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of r and the order of r at . The following table summarizes these cases.

Case

Allowed pole order for r

Allowed value for O()

1

{0,1,2,4,6,8,}

{,6,4,2,0,2,3,4,5,6,}

2

Need to have at least one pole that is either order 2 or odd order greater than 2. Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. {1,2},{1,3},{2},{3},{3,4},{1,2,5}.

no condition

3

{1,2}

{2,3,4,5,6,7,}

Table 2.17: Necessary conditions for each Kovacic case

The order of r at is the degree of t minus the degree of s. Therefore

O()=deg(t)deg(s)=00=0

There are no poles in r. Therefore the set of poles Γ is empty. Since there is no odd order pole larger than 2 and the order at is 0 then the necessary conditions for case one are met. Therefore

L=[1]

Since r=34 is not a function of x, then there is no need run Kovacic algorithm to obtain a solution for transformed ode z=rz as one solution is

z1(x)=cos(3x2)

Using the above, the solution for the original ode can now be found. The first solution to the original ode in y is found from

y1=z1e12BAdx=z1e1211dx=z1ex2=z1(ex2)

Which simplifies to

y1=ex2cos(3x2)

The second solution y2 to the original ode is found using reduction of order

y2=y1eBAdxy12dx

Substituting gives

y2=y1e11dx(y1)2dx=y1ex(y1)2dx=y1(23tan(3x2)3)

Therefore the solution is

y=c1y1+c2y2=c1(ex2cos(3x2))+c2(ex2cos(3x2)(23tan(3x2)3))

Will add steps showing solving for IC soon.

Summary of solutions found

y=2c2ex23sin(3x2)3
Figure 2.173: Slope field y+y+y=0
Solved as second order ode adjoint method

Time used: 1.312 (sec)

In normal form the ode

(1)y+y+y=0

Becomes

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

Where

p(x)=1q(x)=1r(x)=0

The Lagrange adjoint ode is given by

ξ(ξp)+ξq=0ξ(ξ(x))+(ξ(x))=0ξ(x)ξ(x)+ξ(x)=0

Which is solved for ξ(x). This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

Aξ(x)+Bξ(x)+Cξ(x)=0

Where in the above A=1,B=1,C=1. Let the solution be ξ=eλx. Substituting this into the ODE gives

(1)λ2exλλexλ+exλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλx gives

(2)λ2λ+1=0

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

λ1,2=B2A±12AB24AC

Substituting A=1,B=1,C=1 into the above gives

λ1,2=1(2)(1)±1(2)(1)12(4)(1)(1)=12±i32

Hence

λ1=12+i32λ2=12i32

Which simplifies to

λ1=12+i32λ2=12i32

Since roots are complex conjugate of each others, then let the roots be

λ1,2=α±iβ

Where α=12 and β=32. Therefore the final solution, when using Euler relation, can be written as

ξ=eαx(c1cos(βx)+c2sin(βx))

Which becomes

ξ=ex2(c1cos(3x2)+c2sin(3x2))

Will add steps showing solving for IC soon.

The original ode now reduces to first order ode

ξ(x)yyξ(x)+ξ(x)p(x)y=ξ(x)r(x)dxy+y(p(x)ξ(x)ξ(x))=ξ(x)r(x)dxξ(x)

Or

y+y(1(ex2(c1cos(3x2)+c2sin(3x2))2+ex2(c13sin(3x2)2+c23cos(3x2)2))ex2c1cos(3x2)+c2sin(3x2))=0

Which is now a first order ode. This is now solved for 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)=(c23c1)cos(3x2)sin(3x2)(c13+c2)2c1cos(3x2)+2c2sin(3x2)p(x)=0

The integrating factor μ is

μ=eqdx=e(c23c1)cos(3x2)sin(3x2)(c13+c2)2c1cos(3x2)+2c2sin(3x2)dx=sec(3x2)2e3arctan(tan(3x2))3tan(3x2)c2+c1

The ode becomes

ddxμy=0ddx(ysec(3x2)2e3arctan(tan(3x2))3tan(3x2)c2+c1)=0

Integrating gives

ysec(3x2)2e3arctan(tan(3x2))3tan(3x2)c2+c1=0dx+c3=c3

Dividing throughout by the integrating factor sec(3x2)2e3arctan(tan(3x2))3tan(3x2)c2+c1 gives the final solution

y=(tan(3x2)c2+c1)e3arctan(tan(3x2))3c3sec(3x2)2

Hence, the solution found using Lagrange adjoint equation method is

y=(tan(3x2)c2+c1)e3arctan(tan(3x2))3c3sec(3x2)2

The constants can be merged to give

y=(tan(3x2)c2+c1)e3arctan(tan(3x2))3sec(3x2)2

Will add steps showing solving for IC soon.

Summary of solutions found

y=tan(3x2)c2e3arctan(tan(3x2))3sec(3x2)2
Figure 2.174: Slope field y+y+y=0
Maple. Time used: 0.013 (sec). Leaf size: 17
ode:=diff(diff(y(x),x),x)+diff(y(x),x)+y(x) = 0; 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
y=c1ex2sin(3x2)

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
checking if the LODE has constant coefficients 
<- constant coefficients successful`
 

Maple step by step

Let’s solve[d2dx2y(x)+ddxy(x)+y(x)=0,y(0)=0]Highest derivative means the order of the ODE is2d2dx2y(x)Characteristic polynomial of ODEr2+r+1=0Use quadratic formula to solve forrr=(1)±(3)2Roots of the characteristic polynomialr=(12I32,12+I32)1st solution of the ODEy1(x)=ex2cos(3x2)2nd solution of the ODEy2(x)=ex2sin(3x2)General solution of the ODEy(x)=C1y1(x)+C2y2(x)Substitute in solutionsy(x)=C1ex2cos(3x2)+C2ex2sin(3x2)
Mathematica. Time used: 0.022 (sec). Leaf size: 26
ode=D[y[x],{x,2}]+D[y[x],x]+y[x]==0; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)c1ex/2sin(3x2)
Sympy. Time used: 0.147 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1ex2sin(3x2)