p. 47 # 27.
The dependent variable is y(t). The equation is first order linear.
restart:
de:=diff(y(t),t)+1/2*y(t)=2*cos(t);
inits:=y(0)=-1;
(1)
Use p. 44 (27)
p:=1/2;
int(%,t);
mu:=exp(%);
(2)
y(t)=1/mu*(int(mu*rhs(de),t)+c);
sol:=simplify(%);
(3)
Solve for the constant of integration.
eq:=-1=subs(t=0,rhs(sol));
simplify(%);
csol:=solve(%,{c});
(4)
The final solution:
sol:=subs(csol,sol);
(5)
Click on the high point and observe the approximate coordinates of t = 1.3 right below "C Text".
plot(rhs(sol),t=0..3);
0
1
2
3
t
Set the derivative to zero to find the critical point. Since fsolve picks an arbitrary solution which may
not be the solution that you want, you should help Maple by giving an approximate range in which to
find the solution, in this case the range 1..2 contains the max that you seek.
eq:=0+1/2*rhs(sol)=rhs(de);
tsol:=fsolve(%,{t},1..2);
subs(tsol,sol);
evalf(%);
(6)
p. 47 # 29.
The dependent variable is y(t). The equation is first order linear.
restart:
de:=diff(y(t),t)+1/4*y(t)=3+2*cos(2*t);
inits:=y(0)=0;
(7)
Use p. 44 (27)
p:=1/4;
int(%,t);
mu:=exp(%);
(8)
y(t)=1/mu*(int(mu*rhs(de),t)+c);
sol:=simplify(%);
(9)
Solve for the constant of integration.
eq:=0=subs(t=0,rhs(sol));
simplify(%);
csol:=solve(%,{c});
(10)
The final solution:
sol:=subs(csol,sol);
(11)
The last term drops out as t becomes infinite because of the negative exponential. The remainder of the
solution is called the steady state solution. (It can be written as 12 plus a sine of a single angle with a
phase shift, if one cares, as can any linear combination of sines and cosines.)
y(t)=rhs(sol)+788*1/65*exp(-1/4*t);
steadystateSol:=simplify(%);
plot([rhs(sol),rhs(steadystateSol)],t=0..25,color=[red,green]);
12
10
8
6
4
2
0
0
5
10
15
20
25
t
One can click on the first intersection and see the coordinates of the intersection just under the "C
Text". The t coordinate is approximately 10.1, which we use to get an approximate range 10.0..10.2 to
help fsolve pick the correct intersection.
plot([rhs(sol),12],t=0..15,y=11..13,color=[red,green]);
plot([rhs(sol),12],t=9..11,y=11..13,color=[red,green]);
13
12
11
0
5
10
t
15
13
y
12
11
9
10
t
11
eq:=12=rhs(sol);
t_first_crossing:=fsolve(eq,t,10..10.2);
(12)
© Copyright 2026 Paperzz