2.3.5 Problem 7 (v)

Existence and uniqueness analysis
Solved as second order linear constant coeff ode
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [18458]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 5. Linear equations. Exercises at page 85
Problem number : 7 (v)
Date solved : Monday, March 31, 2025 at 05:29:51 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

Existence and uniqueness analysis

Solve

x+4x+3x=tsin(t)

With initial conditions

x(0)=0x(0)=1

This is a linear ODE. In canonical form it is written as

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

Where here

p(t)=4q(t)=3F=tsin(t)

Hence the ode is

x+4x+3x=tsin(t)

The domain of p(t)=4 is

{<t<}

And the point t0=0 is inside this domain. The domain of q(t)=3 is

{<t<}

And the point t0=0 is also inside this domain. The domain of F=tsin(t) is

{<t<}

And the point t0=0 is also inside this domain. Hence solution exists and is unique.

Solved as second order linear constant coeff ode

Time used: 0.211 (sec)

Solve

x+4x+3x=tsin(t)

With initial conditions

x(0)=0x(0)=1

This is second order non-homogeneous ODE. In standard form the ODE is

Ax(t)+Bx(t)+Cx(t)=f(t)

Where A=1,B=4,C=3,f(t)=tsin(t). Let the solution be

x=xh+xp

Where xh is the solution to the homogeneous ODE Ax(t)+Bx(t)+Cx(t)=0, and xp is a particular solution to the non-homogeneous ODE Ax(t)+Bx(t)+Cx(t)=f(t). xh is the solution to

x+4x+3x=0

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

Ax(t)+Bx(t)+Cx(t)=0

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

(1)λ2etλ+4λetλ+3etλ=0

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

(2)λ2+4λ+3=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=4,C=3 into the above gives

λ1,2=4(2)(1)±1(2)(1)42(4)(1)(3)=2±1

Hence

λ1=2+1λ2=21

Which simplifies to

λ1=1λ2=3

Since roots are real and distinct, then the solution is

x=c1eλ1t+c2eλ2tx=c1e(1)t+c2e(3)t

Or

x=c1et+c2e3t

Therefore the homogeneous solution xh is

xh=c1et+c2e3t

The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is

tsin(t)

Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is

[{tcos(t),tsin(t),cos(t),sin(t)}]

While the set of the basis functions for the homogeneous solution found earlier is

{e3t,et}

Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.

xp=A1tcos(t)+A2tsin(t)+A3cos(t)+A4sin(t)

The unknowns {A1,A2,A3,A4} are found by substituting the above trial solution xp into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives

2A1sin(t)+2A1tcos(t)+2A2cos(t)+2A2tsin(t)+2A3cos(t)+2A4sin(t)+4A1cos(t)4A1tsin(t)+4A2sin(t)+4A2tcos(t)4A3sin(t)+4A4cos(t)=tsin(t)

Solving for the unknowns by comparing coefficients results in

[A1=15,A2=110,A3=1150,A4=125]

Substituting the above back in the above trial solution xp, gives the particular solution

xp=tcos(t)5+tsin(t)10+11cos(t)50+sin(t)25

Therefore the general solution is

x=xh+xp=(c1et+c2e3t)+(tcos(t)5+tsin(t)10+11cos(t)50+sin(t)25)

Will add steps showing solving for IC soon.

Summary of solutions found

x=tcos(t)5+tsin(t)10+11cos(t)50+sin(t)25+et447e3t100
Solution plot Slope field x+4x+3x=tsin(t)
Solved as second order ode using Kovacic algorithm

Time used: 0.128 (sec)

Solve

x+4x+3x=tsin(t)

With initial conditions

x(0)=0x(0)=1

Writing the ode as

(1)x+4x+3x=0(2)Ax+Bx+Cx=0

Comparing (1) and (2) shows that

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

Applying the Liouville transformation on the dependent variable gives

z(t)=xeB2Adt

Then (2) becomes

(4)z(t)=rz(t)

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=11

Comparing the above to (5) shows that

s=1t=1

Therefore eq. (4) becomes

(7)z(t)=z(t)

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

x=z(t)eB2Adt

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.22: 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=1 is not a function of t, then there is no need run Kovacic algorithm to obtain a solution for transformed ode z=rz as one solution is

z1(t)=et

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

x1=z1e12BAdt=z1e1241dt=z1e2t=z1(e2t)

Which simplifies to

x1=e3t

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

x2=x1eBAdtx12dt

Substituting gives

x2=x1e41dt(x1)2dt=x1e4t(x1)2dt=x1(e4te6t2)

Therefore the solution is

x=c1x1+c2x2=c1(e3t)+c2(e3t(e4te6t2))

This is second order nonhomogeneous ODE. Let the solution be

x=xh+xp

Where xh is the solution to the homogeneous ODE Ax(t)+Bx(t)+Cx(t)=0, and xp is a particular solution to the nonhomogeneous ODE Ax(t)+Bx(t)+Cx(t)=f(t). xh is the solution to

x+4x+3x=0

The homogeneous solution is found using the Kovacic algorithm which results in

xh=c1e3t+c2et2

The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is

tsin(t)

Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is

[{tcos(t),tsin(t),cos(t),sin(t)}]

While the set of the basis functions for the homogeneous solution found earlier is

{et2,e3t}

Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.

xp=A1tcos(t)+A2tsin(t)+A3cos(t)+A4sin(t)

The unknowns {A1,A2,A3,A4} are found by substituting the above trial solution xp into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives

2A1sin(t)+2A1tcos(t)+2A2cos(t)+2A2tsin(t)+2A3cos(t)+2A4sin(t)+4A1cos(t)4A1tsin(t)+4A2sin(t)+4A2tcos(t)4A3sin(t)+4A4cos(t)=tsin(t)

Solving for the unknowns by comparing coefficients results in

[A1=15,A2=110,A3=1150,A4=125]

Substituting the above back in the above trial solution xp, gives the particular solution

xp=tcos(t)5+tsin(t)10+11cos(t)50+sin(t)25

Therefore the general solution is

x=xh+xp=(c1e3t+c2et2)+(tcos(t)5+tsin(t)10+11cos(t)50+sin(t)25)

Will add steps showing solving for IC soon.

Summary of solutions found

x=tcos(t)5+tsin(t)10+11cos(t)50+sin(t)25+et447e3t100
Solution plot Slope field x+4x+3x=tsin(t)
Maple. Time used: 0.035 (sec). Leaf size: 35
ode:=diff(diff(x(t),t),t)+4*diff(x(t),t)+3*x(t) = t*sin(t); 
ic:=x(0) = 0, D(x)(0) = 1; 
dsolve([ode,ic],x(t), singsol=all);
 
x=47e3t100+et4+(10t+11)cos(t)50+sin(t)(5t+2)50

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 2; linear nonhomogeneous with symmetry [0,1] 
trying a double symmetry of the form [xi=0, eta=F(x)] 
-> Try solving first the homogeneous part of the ODE 
   checking if the LODE has constant coefficients 
   <- constant coefficients successful 
<- solving first the homogeneous part of the ODE successful
 

Maple step by step

Let’s solve[ddtddtx(t)+4ddtx(t)+3x(t)=tsin(t),x(0)=0,(ddtx(t))|{t=0}=1]Highest derivative means the order of the ODE is2ddtddtx(t)Characteristic polynomial of homogeneous ODEr2+4r+3=0Factor the characteristic polynomial(r+3)(r+1)=0Roots of the characteristic polynomialr=(3,1)1st solution of the homogeneous ODEx1(t)=e3t2nd solution of the homogeneous ODEx2(t)=etGeneral solution of the ODEx(t)=C1x1(t)+C2x2(t)+xp(t)Substitute in solutions of the homogeneous ODEx(t)=C1e3t+C2et+xp(t)Find a particular solutionxp(t)of the ODEUse variation of parameters to findxpheref(t)is the forcing function[xp(t)=x1(t)x2(t)f(t)W(x1(t),x2(t))dt+x2(t)x1(t)f(t)W(x1(t),x2(t))dt,f(t)=tsin(t)]Wronskian of solutions of the homogeneous equationW(x1(t),x2(t))=[e3tet3e3tet]Compute WronskianW(x1(t),x2(t))=2e4tSubstitute functions into equation forxp(t)xp(t)=(ettsin(t)dte2ttsin(t)e3tdt)e3t2Compute integralsxp(t)=(10t+11)cos(t)50+sin(t)(5t+2)50Substitute particular solution into general solution to ODEx(t)=C1e3t+C2et+(10t+11)cos(t)50+sin(t)(5t+2)50Check validity of solutionx(t)=_C1e3t+_C2et+(10t+11)cos(t)50+sin(t)(5t+2)50Use initial conditionx(0)=00=_C1+_C2+1150Compute derivative of the solutionddtx(t)=3_C1e3t_C2etcos(t)5(10t+11)sin(t)50+cos(t)(5t+2)50+sin(t)10Use the initial condition(ddtx(t))|{t=0}=11=3_C1_C2425Solve for_C1and_C2{_C1=47100,_C2=14}Substitute constant values into general solution and simplifyx(t)=47e3t100+et4+(10t+11)cos(t)50+sin(t)(5t+2)50Solution to the IVPx(t)=47e3t100+et4+(10t+11)cos(t)50+sin(t)(5t+2)50
Mathematica. Time used: 0.022 (sec). Leaf size: 42
ode=D[x[t],{t,2}]+4*D[x[t],t]+3*x[t]==t*Sin[t]; 
ic={x[0]==0,Derivative[1][x][0] == 1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
x(t)1100(e3t(25e2t47)+2(5t+2)sin(t)+(2220t)cos(t))
Sympy. Time used: 0.290 (sec). Leaf size: 42
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t*sin(t) + 3*x(t) + 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
x(t)=tsin(t)10tcos(t)5+sin(t)25+11cos(t)50+et447e3t100