2.3.12 Problem 12

Maple
Mathematica
Sympy

Internal problem ID [9068]
Book : First order enumerated odes
Section : section 3. First order odes solved using Laplace method
Problem number : 12
Date solved : Friday, April 25, 2025 at 05:40:00 PM
CAS classification : [_linear]

Solve

(at+1)y+y=t

With initial conditions

y(1)=0

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

(a(τ+1)+1)y+y=τ+1

With initial conditions

y(0)=0

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)(aτ+a+1)(ddτy(τ))La(Y(s)+s(ddsY(s)))+a(sY(s)y(0))+sY(s)y(0)τ+1L1+ss2

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

a(Y+sY)+a(sYy(0))+sYy(0)+Y=1+ss2

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

a(Y+sY)+asY+sY+Y=1+ss2

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)=(s1)a+1+sasp(s)=s1s3a

The integrating factor μ is

μ=eqds=e(s1)a+1+sasds=sa1aes(a+1)a

The ode becomes

dds(μY)=μpdds(μY)=(μ)(s1s3a)dds(Ysa1aes(a+1)a)=(sa1aes(a+1)a)(s1s3a)d(Ysa1aes(a+1)a)=((s1)sa1aes(a+1)as3a)ds

Integrating gives

Ysa1aes(a+1)a=(s1)sa1aes(a+1)as3ads=sa1aes(a+1)aa+1+c1

Dividing throughout by the integrating factor sa1aes(a+1)a gives the final solution

Y=1s2(a+1)+es(a+1)ac1sa1a

Applying inverse Laplace transform on the above gives.

(1)y=τa+1+c1L1(es+sas1+1a,s,τ)

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

0=c1L1(es+sas1+1a,s,τ)

Solving for the constant c1 from the above equation gives

c1=0

Substituting the above back into the solution (1) gives

y=τa+1

Changing back the solution from τ to t using

τ=t1

the solution becomes

y(t)=t1a+1

Maple. Time used: 0.139 (sec). Leaf size: 13
ode:=(a*t+1)*diff(y(t),t)+y(t) = t; 
ic:=y(1) = 0; 
dsolve([ode,ic],y(t),method='laplace');
 
y=t1a+1

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[(at+1)(ddty(t))+y(t)=t,y(1)=0]Highest derivative means the order of the ODE is1ddty(t)Solve for the highest derivativeddty(t)=y(t)+tat+1Collect w.r.t.y(t)and simplifyddty(t)=y(t)at+1+tat+1Group terms withy(t)on the lhs of the ODE and the rest on the rhs of the ODEddty(t)+y(t)at+1=tat+1The ODE is linear; multiply by an integrating factorμ(t)μ(t)(ddty(t)+y(t)at+1)=μ(t)tat+1Assume the lhs of the ODE is the total derivativeddt(y(t)μ(t))μ(t)(ddty(t)+y(t)at+1)=(ddty(t))μ(t)+y(t)(ddtμ(t))Isolateddtμ(t)ddtμ(t)=μ(t)at+1Solve to find the integrating factorμ(t)=(at+1)1aIntegrate both sides with respect tot(ddt(y(t)μ(t)))dt=μ(t)tat+1dt+C1Evaluate the integral on the lhsy(t)μ(t)=μ(t)tat+1dt+C1Solve fory(t)y(t)=μ(t)tat+1dt+C1μ(t)Substituteμ(t)=(at+1)1ay(t)=(at+1)1atat+1dt+C1(at+1)1aEvaluate the integrals on the rhsy(t)=(t1)(at+1)1aa+1+C1(at+1)1aSimplifyy(t)=t1+(at+1)1aC1(a+1)a+1Use initial conditiony(1)=00=(a+1)1aC1Solve for_C1C1=0Substitute_C1=0into general solution and simplifyy(t)=t1a+1Solution to the IVPy(t)=t1a+1
Mathematica. Time used: 0.599 (sec). Leaf size: 14
ode=(1+a*t)*D[y[t],t]+y[t]==t; 
ic=y[1]==0; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
y(t)t1a+1
Sympy
from sympy import * 
t = symbols("t") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-t + (a*t + 1)*Derivative(y(t), t) + y(t),0) 
ics = {y(1): 0} 
dsolve(ode,func=y(t),ics=ics)