2.3.7 Problem 7

Maple
Mathematica
Sympy

Internal problem ID [9063]
Book : First order enumerated odes
Section : section 3. First order odes solved using Laplace method
Problem number : 7
Date solved : Friday, April 25, 2025 at 05:39:52 PM
CAS classification : [_separable]

Solve

ty+y=0

With initial conditions

y(1)=5

Since initial condition is not at zero, then change of variable is used to transform the ode so that initial condition is at zero.

τ=t1

Solve

(τ+1)y+y=0

With initial conditions

y(0)=5

We will now apply Laplace transform to each term in the ode. Since this is time varying, the following Laplace transform property will be used

τnf(τ)L(1)ndndsnF(s)

Where in the above F(s) is the laplace transform of f(τ). Applying the above property to each term of the ode gives

y(τ)LY(s)(τ+1)(ddτy(τ))LY(s)s(ddsY(s))+sY(s)y(0)

Collecting all the terms above, the ode in Laplace domain becomes

sY+sYy(0)=0

Replacing y(0)=5 in the above results in

sY+sY5=0

The above ode in Y(s) is now solved.

In canonical form a linear first order is

Y+q(s)Y=p(s)

Comparing the above to the given ode shows that

q(s)=1p(s)=5s

The integrating factor μ is

μ=eqds=e(1)ds=es

The ode becomes

dds(μY)=μpdds(μY)=(μ)(5s)dds(Yes)=(es)(5s)d(Yes)=(5ess)ds

Integrating gives

Yes=5essds=5Ei1(s)+c1

Dividing throughout by the integrating factor es gives the final solution

Y=es(5Ei1(s)+c1)

Applying inverse Laplace transform on the above gives.

(1)y=5τ+1+c1L1(es,s,τ)

Substituting initial conditions y(0)=5 and y(0)=5 into the above solution Gives

5=c1L1(es,s,τ)+5

Solving for the constant c1 from the above equation gives

c1=0

Substituting the above back into the solution (1) gives

y=5τ+1

Changing back the solution from τ to t using

τ=t1

the solution becomes

y(t)=5t
Solution plot Slope field t(ddty(t))+y(t)=0
Maple. Time used: 0.120 (sec). Leaf size: 9
ode:=diff(y(t),t)*t+y(t) = 0; 
ic:=y(1) = 5; 
dsolve([ode,ic],y(t),method='laplace');
 
y=5t

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 solve[t(ddty(t))+y(t)=0,y(1)=5]Highest derivative means the order of the ODE is1ddty(t)Separate variablesddty(t)y(t)=1tIntegrate both sides with respect totddty(t)y(t)dt=1tdt+C1Evaluate integralln(y(t))=ln(t)+C1Solve fory(t)y(t)=eC1tRedefine the integration constant(s)y(t)=C1tUse initial conditiony(1)=55=C1Solve for_C1C1=5Substitute_C1=5into general solution and simplifyy(t)=5tSolution to the IVPy(t)=5t
Mathematica. Time used: 0.031 (sec). Leaf size: 10
ode=t*D[y[t],t]+y[t]==0; 
ic=y[1]==5; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
y(t)5t
Sympy. Time used: 0.110 (sec). Leaf size: 5
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(t*Derivative(y(t), t) + y(t),0) 
ics = {y(1): 5} 
dsolve(ode,func=y(t),ics=ics)
 
y(t)=5t