2.5.17 Problem 17

Maple
Mathematica
Sympy

Internal problem ID [8977]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 17
Date solved : Friday, April 25, 2025 at 05:32:35 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

Solve

y+3y4y=6e2t2

With initial conditions

y(1)=4y(1)=5

Since both initial conditions are not at zero, then let

y(0)=c1y(0)=c2

Solving using the Laplace transform method. Let

L(y)=Y(s)

Taking the Laplace transform of the ode and using the relations that

L(y)=sY(s)y(0)L(y)=s2Y(s)y(0)sy(0)

The given ode now becomes an algebraic equation in the Laplace domain.

(1)s2Y(s)y(0)sy(0)+3sY(s)3y(0)4Y(s)=6e2s2

Substituting the initial conditions in above in Eq (1) gives

s2Y(s)c2sc1+3sY(s)3c14Y(s)=6e2s2

Solving the above equation for Y(s) results in

Y(s)=s2c1+sc1+c2s+6e26c12c2(s2)(s2+3s4)

Applying partial fractions decomposition results in

Y(s)=e2s2+4c15+c256e25s1+c15c25+e25s+4

The inverse Laplace of each term above is now found, which gives

L1(e2s2)=e2t2L1(4c15+c256e25s1)=et(4c1+c26e2)5L1(c15c25+e25s+4)=(c1c2+e2)e4t5

Adding the above results and simplifying gives

y=e2t2+et(4c1+c26e2)5+(c1c2+e2)e4t5

Solving for c1 and c2 from the given initial conditions results in

y=e2t2+3ete1

Simplifying the solution gives

y=3e1+t+e2t2
Figure 2.194: Solution plot
Maple. Time used: 0.106 (sec). Leaf size: 17
ode:=diff(diff(y(t),t),t)+3*diff(y(t),t)-4*y(t) = 6*exp(2*t-2); 
ic:=y(1) = 4, D(y)(1) = 5; 
dsolve([ode,ic],y(t),method='laplace');
 
y=e2t2+3et1

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[ddtddty(t)+3ddty(t)4y(t)=6e2t2,y(1)=4,(ddty(t))|{t=1}=5]Highest derivative means the order of the ODE is2ddtddty(t)Characteristic polynomial of homogeneous ODEr2+3r4=0Factor the characteristic polynomial(r+4)(r1)=0Roots of the characteristic polynomialr=(4,1)1st solution of the homogeneous ODEy1(t)=e4t2nd solution of the homogeneous ODEy2(t)=etGeneral solution of the ODEy(t)=C1y1(t)+C2y2(t)+yp(t)Substitute in solutions of the homogeneous ODEy(t)=C1e4t+C2et+yp(t)Find a particular solutionyp(t)of the ODEUse variation of parameters to findypheref(t)is the forcing function[yp(t)=y1(t)y2(t)f(t)W(y1(t),y2(t))dt+y2(t)y1(t)f(t)W(y1(t),y2(t))dt,f(t)=6e2t2]Wronskian of solutions of the homogeneous equationW(y1(t),y2(t))=[e4tet4e4tet]Compute WronskianW(y1(t),y2(t))=5e3tSubstitute functions into equation foryp(t)yp(t)=6(e2+tdte5t+e2+6tdt)e4t5Compute integralsyp(t)=e2t2Substitute particular solution into general solution to ODEy(t)=C1e4t+C2et+e2t2Check validity of solutiony(t)=_C1e4t+_C2et+e2t2Use initial conditiony(1)=44=_C1e4+_C2e+1Compute derivative of the solutionddty(t)=4_C1e4t+_C2et+2e2t2Use the initial condition(ddty(t))|{t=1}=55=4_C1e4+_C2e+2Solve for_C1and_C2{_C1=0,_C2=3e}Substitute constant values into general solution and simplifyy(t)=3et1+e2t2Solution to the IVPy(t)=3et1+e2t2
Mathematica. Time used: 0.076 (sec). Leaf size: 18
ode=D[y[t],{t,2}]+3*D[y[t],t]-4*y[t]==6*Exp[2*t-2]; 
ic={y[1]==4,Derivative[1][y][1]==5}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
y(t)et2(et+3e)
Sympy. Time used: 0.240 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-4*y(t) - 6*exp(2*t - 2) + 3*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(1): 4, Subs(Derivative(y(t), t), t, 1): 5} 
dsolve(ode,func=y(t),ics=ics)
 
y(t)=3ete+e2t2