BNU 4th Sem Lab Manual
BNU 4th Sem Lab Manual
Lab Manual
4th Semester B.Sc Mathematics (NEP)
2022-23 BATCH
INDEX
Lab 3 Solving second order linear PDE in two variables with constant
coefficients
Lab 4 Solution to One Dimensional Heat equation using Fourier series
1.Solve p2+q2=3
from sympy import *
a,b,c,x,y,z,p,q=symbols('a,b,c,x,y,z,p,q')
eqn=Eq(p**2+q**2,3)
print("The given PDE is :")
pprint(eqn)
eqn=eqn.subs([(p,a),(q,b)])
h=solve(eqn,b)
eqn=Eq(z,a*x+b*y+c)
eq1=eqn.subs(b,h[0])
print('The Required Solution is :')
pprint(eq1)
Output:
The given PDE is :
p2 + q2 = 3
The Required Solution is :
z = a⋅x + c - y. √3 − 𝑎2
Exercise:
1.Solve pq=1
Output:The given PDE is :
p⋅q = 1
The Required Solution is :
𝑦
z = a⋅x + c +
𝑎
2.Solve √𝑝 + √𝑞=1
3.Solve p=eq
Output: The given PDE is :
p=ℯq
The Required Solution is :
z = a⋅x + c + y⋅log(a)
4.Solve pq+p+q=0
Output:The given PDE is :
p⋅q + p + q = 0
The Required Solution is :
𝑎.𝑦
z=a.x - +𝑐
𝑎+1
Type-2 : Clariaut’s Equation
A first order PDE is said to be of Clariaut form if it can be written in the
form z=px+qy+f(p,q)
1.Solve px+qy+(p2+q2)
from sympy import *
x,y,p,q,a,b=symbols('x,y,p,q,a,b')
z=p*x+q*y+(p**2+q**2)
print('The given equation is z=',z)
soln=z.subs([(p,a),(q,b)])
print('The complete integral is z=',soln)
Output:
The given equation is z= p**2 + p*x + q**2 + q*y
The complete integral is z= a**2 + a*x + b**2 + b*y
2.Solve (px+qy-z)2=1+p2+q2
from sympy import *
x,y,z,p,q,a,b=symbols('x,y,z,p,q,a,b')
eq=Eq((p*x+q*y-z)**2,1+p**2+q**2)
print('The given equation is ')
pprint(eq)
soln=eq.subs([(p,a),(q,b)])
print('The complete integral is')
pprint(soln)
Output:
The given equation is
(p⋅x + q⋅y - z)2 = p2 + q2 + 1
The complete integral is (a⋅x + b⋅y - z)2 = a2 + b2 + 1
Exercise:
1.Solve z= px+qy+pq
Output:
The given equation is z= p*q + p*x + q*y
The complete integral is z= a*b + a*x + b*y
2.Solve z-px-qy=c√1 + 𝑝2 + 𝑞 2
Output:
The given equation is
3.Solve z=px+qy+logpq
Output:
The given equation is z= p*x + q*y + log(p*q)
The complete integral is z=
a⋅x + b⋅y + log(a⋅b)
Lab.2-First Order non-linear Partial Differential Equations-Type-3 & Type-4
Type 3: Equations of the form f(p,q,z)=0
1.Solve p(1+q)=qz
Output:
The given PDE is:
p⋅(q + 1) = q⋅z(u)
The required solution is :
1
z(a⋅y + x) = C₁⋅ea.y+x +
𝑎
Exercise:
1.Solve z= pq
Output: The given PDE is:
z(u) = p⋅q
The required solutions is:
𝑐1 2 −2.𝑐1 .(𝑎,𝑦+𝑥)+(𝑎.𝑦+𝑥)2
z(a⋅y + x) =
4.𝑎
2.Solve p+q=z/a
Output: The given PDE is :
𝑧(𝑢)
p+q=
𝑎
4.Solve p2=qz
Output:
The given PDE is:
p2 = q⋅z(u)
The required solutions are:
1.Solve p2-q2=x-y
from sympy import *
var('x,y,p,q,a,b,c')
eq=Eq(p**2-x,q**2-y)
print("The given equation is :")
pprint(eq)
p=solve(Eq(eq.lhs,a),p)
q=solve(Eq(eq.rhs,a),q)
z=integrate(p[0],x)+integrate(q[0],y)+c
print("The soln is z =")
pprint(z)
Output:
The given equation is :
p2 - x = q2 - y
The soln is z =
2.(𝑎+𝑥)3/2 2.(𝑎+𝑦)3/2
c- -
3 3
Exercise:
1.Solve √𝑝 + √𝑞 = 𝑥 + 𝑦
2.Solve p+q=sinx+siny
Output: The given equation is :
p - sin(x) = -q + sin(y)
The soln is z =
a⋅x - a⋅y + c - cos(x) - cos(y)
3.Solve pey=qex
Output:The given equation is :
p⋅ℯ-x = q⋅ℯ-y
The soln is z =
a⋅ℯx + a⋅ℯy + c
4.Solve p-x2=q+y2
Output:The given equation is :
p-x2=q+y2
The soln is z =
𝑥3 𝑦3
a⋅x + a⋅y + c + -
3 3
Lab3: Solving second order linear PDE in two variables with constant
coefficients.[Equation of the form F(D,D’)z=f(x,y)]
1.Solve (D2-3DD’-4D’2)z=e4x+y
from sympy import*
var('D,D1,x,y,m,c')
F=D**2-3*D*D1-4*D1**2
f=exp(4*x+y)
F=Poly(F.subs([(D,m),(D1,1)]))
r=F.all_roots(multiple=True)
m1=r[0]
m2=r[1]
print("The roots are=",m1,'and',m2)
f=f.subs(y,c-m1*x)
f=integrate(f,x)
f=f.subs(c,y+m1*x)
f=f.subs(y,c-m2*x)
f=integrate(f,x)
f=f.subs(c,y+m2*x)
PI=simplify(f)
print("Particular integral of given PDE is ")
pprint(PI)
print("The complete soln is")
if r[0]==r[1]:
pprint(f"f(y+{m1}x)+xg(y+{m2}x)+{PI}")
else:
pprint(f"f(y+{m1}x)+g(y+{m2}x)+{PI}")
Output:
The roots are= -1 and 4
Particular integral of given PDE is
𝑥𝑒 4.𝑥+𝑦
5
2. Solve (D2-DD’)z=sinxcos2y
from sympy import*
var('D,D1,x,y,m,c')
F=D**2-D*D1
f=sin(x)*cos(2*y)
F=Poly(F.subs([(D,m),(D1,1)]))
r=F.all_roots(multiple=True)
m1=r[0]
m2=r[1]
print("The roots are=",m1,'and',m2)
f=f.subs(y,c-m1*x)
f=integrate(f,x)
f=f.subs(c,y+m1*x)
f=f.subs(y,c-m2*x)
f=integrate(f,x)
f=f.subs(c,y+m2*x)
PI=simplify(f)
print("Particular integral of given PDE is")
pprint(PI)
print("The complete soln is")
if r[0]==r[1]:
pprint(f"f(y+{m1}x)+xg(y+{m2}x)+{PI}")
else:
pprint(f"f(y+{m1}x)+g(y+{m2}x)+{PI}")
Output:
The roots are= 0 and 1
Particular integral of given PDE is
sin(𝑥−2.𝑦) sin(𝑥+2.𝑦)
− +
6 2
Exercise:
𝜕2 𝑧 𝜕2 𝑧 𝜕2 𝑧
1.Solve 2
−5 +4 = cos(2x+3y)
𝜕𝑥 𝜕𝑥𝜕𝑦 𝜕𝑦 2
Output:
The roots are= 1 and 4
Particular integral of given PDE is
cos(2.𝑥+2.𝑦)
−
10
3.Solve (D2+3DD’+2D’2)z=x+y
Output:
The roots are= -2 and -1
Particular integral of given PDE is
𝑥 𝑦
x2.|- + |
3 3
𝜕𝑢 𝜕2 𝑢
1.Solve = 16 subject to the condition i)u(0,t)=0 , u(1,t)=0 ∀ t
𝜕𝑡 𝜕𝑥 2
ii)u(x,0)=x2-x ∀0≤𝑥 ≤1
Output:
The solution up to n=5 terms
2 2 2
8𝑒 −16𝜋 .𝑡 . 𝑠𝑖𝑛𝜋. 𝑥 8𝑒 −144𝜋 .𝑡 . 𝑠𝑖𝑛3𝜋. 𝑥 8𝑒 −400𝜋 .𝑡 . 𝑠𝑖𝑛5𝜋. 𝑥
− − −
𝜋3 27𝜋 3 125𝜋 3
𝜕𝑢 𝜕2 𝑢
2.Solve = subject to the condition i)u(0,t)=0 , u(l,t)=0 ∀ t
𝜕𝑡 𝜕𝑥 2
ii)u(x,0)=(l-x )x
Output:
𝜋2 .𝑐 2 .𝑡 2
9𝜋 .𝑐 .𝑡 2 25𝜋 .𝑐 .𝑡 2 2
3 − 𝐿2 𝜋. 𝑥 − 3𝜋. 𝑥 − 5𝜋. 𝑥
8𝐿 𝑒 . 𝑠𝑖𝑛 8𝐿3 𝑒 𝐿2 . 𝑠𝑖𝑛 8𝐿3 𝑒 𝐿2 . 𝑠𝑖𝑛
𝐿 + 𝐿 + 𝐿
𝜋 3 27𝜋 3 125𝜋 3
𝐿
Exercise:
𝜕𝑢 𝜕2 𝑢
1.Solve =4 subject to the condition i)u(0,t)=0 , u(1,t)=0 ∀ t
𝜕𝑡 𝜕𝑥 2
ii)u(x,0)=x-x2, ∀ 0 ≤ 𝑥 ≤ 1
Output:
The solution up to n=5 terms
2 2 2
8𝑒 −4𝜋 .𝑡 . 𝑠𝑖𝑛𝜋. 𝑥 8𝑒 −36𝜋 .𝑡 . 𝑠𝑖𝑛3𝜋. 𝑥 8𝑒 −100𝜋 .𝑡 . 𝑠𝑖𝑛5𝜋. 𝑥
− − −
𝜋3 27𝜋 3 125𝜋 3
Lab5: Solution to One Dimensional Wave equation using Fourier series
𝜕2 𝑢 𝜕2 𝑢
1.Solve = subject to the condition i)u(0,t)=0 , u(1,t)=0 ∀ t
𝜕𝑡 2 𝜕𝑥 2
𝜕𝑢
ii)u(x,0)=0 ,( ) = 𝑥 − 𝑥2 ∀0≤𝑥 ≤1
𝜕𝑡 𝑡=0
Output:
The solution up to n=5 terms
4.sin(𝜋.𝑡) sin(𝜋.𝑥) 4.sin(3.𝜋.𝑡)sin(3.𝜋.𝑥) 4.sin(5.𝜋.𝑡)sin(5.𝜋.𝑥)
2.𝜋. | + + |
𝜋3 81𝜋3 625𝜋3
𝜕2 𝑢 𝜕2 𝑢
2.Solve = subject to the condition i)u(0,t)=0 , u(𝜋,t)=0 ∀ t
𝜕𝑡 2 𝜕𝑥 2
𝜕𝑢
ii)u(x,0)=𝑥 ,( ) =0 ∀0≤𝑥 ≤𝜋
𝜕𝑡 𝑡=0
Output:
The solution up to n=5 terms
2.sin(3.𝑥).cos(3.𝑡) .sin(4.𝑥).cos(4.𝑡)
2.sin(x).cos(t)-sin(2.x).cos(2.t)+ − +
3 2
2.sin(5.𝑥).cos(5.𝑡)
5
3.A string is stretched and fastened to points l apart.Motion is started by
displacing the string into the form y=k(lx-x2) from which it is released at
time t=0.Find the displacement of any point on the string at a distance of x
from one end at time t.
Output:
The solution up to n=5 terms
𝜋. 𝑥 𝜋. 𝑐. 𝑡 3. 𝜋. 𝑥 3. 𝜋. 𝑐. 𝑡 5. 𝜋. 𝑥 5. 𝜋. 𝑐. 𝑡
4𝐿3 𝑘. 𝑠𝑖𝑛 𝑐𝑜𝑠 4𝐿3 𝑘. 𝑠𝑖𝑛 𝑐𝑜𝑠 4𝐿3 𝑘. 𝑠𝑖𝑛 𝑐𝑜𝑠
2| 𝐿 𝐿 + 𝐿 𝐿 + 𝐿 𝐿 |
𝜋3 27. 𝜋 3 125𝜋 3
Exercise:
1.A lightly stretched string with fixed end points x=0 and x=l is initially ia a
𝜋.𝑥
position given by y=y0sin3( ).If it is released from rest in this position,find
𝑙
the displacement u(x,t).
Output:
The solution up to n=5 terms
𝜋. 𝑥 𝜋. 𝑐. 𝑡 3. 𝜋. 𝑥 3. 𝜋. 𝑐. 𝑡
3𝑦0 . 𝑠𝑖𝑛 𝑐𝑜𝑠 𝑦0 . 𝑠𝑖𝑛 𝑐𝑜𝑠
𝐿 𝐿 − 𝐿 𝐿
4 4
Lab6: Fourier Series
1.Find the Fourier series of 𝑓(𝑥) = 𝑥 2 𝑖𝑛 [ −𝜋, 𝜋]
from sympy import*
x=symbols('x')
L=pi
f=lambda x:x**2
print("Given function:",f(x))
f_series=fourier_series(f(x),(x,-L,L))
f_series=f_series.truncate(n=6)
print("f(x)=",f_series)
p=plot(f_series,f(x),(x,-2*L,2*L),legend=True)
p[0].line_color='green'
p[0].label='Fourier series'
p[1].line_color='red'
p[1].label=f(x)
Output:
Given function: x**2
f(x)= -4*cos(x) + cos(2*x) - 4*cos(3*x)/9 + cos(4*x)/4 - 4*cos(5*x)/25 + pi**2/3
Graph:
π
𝒙 𝒇𝒐𝒓 𝒙 > 𝟎
2.Find the Fourier series of f(x)=|x| ={ in [−𝝅, 𝝅]
−𝒙 𝒇𝒐𝒓𝒙 < 𝟎
from sympy import*
x=symbols('x')
L=pi
f=lambda x:Piecewise((-x,(x<0)),(x,(x>0)))
print("Given function:",f(x))
f_series=fourier_series(f(x),(x,-L,L))
f_series=f_series.truncate(n=6)
print("f(x)=",f_series)
p=plot(f_series,f(x),(x,-6*L,6*L),legend=True)
p[0].line_color='green'
p[0].label='Fourier series'
p[1].line_color='red'
p[1].label=f(x)
Output:
Given function: Piecewise((-x, x < 0), (x, x > 0))
f(x)= -4*cos(x)/pi - 4*cos(3*x)/(9*pi) - 4*cos(5*x)/(25*pi) - 4*cos(7*x)/(49*pi) -
4*cos(9*x)/(81*pi) + pi/2
Graph:
OR
from sympy import*
x=symbols('x')
L=pi
f=lambda x:abs(x)
print("Given function f(x) = :",f(x))
f_series=fourier_series(f(x),(x,-L,L))
f_series=f_series.truncate(n=6)
print("f(x)=",f_series)
p=plot(f_series,f(x),(x,-4*L,4*L),show=False,legend=True)
p[0].line_color='green'
p[0].label='Fourier series'
p[1].line_color='red'
p[1].label=f(x)
p.show()
Output:
Given function f(x) = : Abs(x)
f(x)= -4*cos(x)/pi - 4*cos(3*x)/(9*pi) - 4*cos(5*x)/(25*pi) - 4*cos(7*x)/(49*pi) -
4*cos(9*x)/(81*pi) + pi/2
Graph:
Exercise:
𝜋−𝑥
1.Find the fourier series of f(x) = in [0,2𝜋]
2
Output:
Given function: -x/2 + pi/2
f(x)= sin(x) + sin(2*x)/2 + sin(3*x)/3 + sin(4*x)/4 + sin(5*x)/5 + sin(6*x)/6
𝜋−𝑥 2
2.Find the fourier series of f(x) = ( ) in [0,2𝜋]
2
Output:
Given function: (-x/2 + pi/2)**2
f(x)= cos(x) + cos(2*x)/4 + cos(3*x)/9 + cos(4*x)/16 + cos(5*x)/25 + pi**2/12
Lab7: Half Range Fourier Series
1. .Find the half range cosine series of (𝑥) = 𝑥 𝑖𝑛 [0, 𝜋]
a0=quad(f,0,L)[0]*2/L
f_series=round(a0/2,2)
for n in range(1,6):
an=round(2/L*quad(f1,0,L,args=(n))[0],2)
f_series=f_series+an*cos(n*pi*x/L)
print("Required half range cosine series :\n",f_series)
plot(f_series,f(x),(x,-4*L,4*L))
Output:
Given function f(x): x
Required half range cosine series :
Exercise:
1.Find the half range sine series of 𝑓(𝑥) = (𝑥 -1)2 𝑖𝑛 [0, 1]
Output:
Given function f(x): (x - 1)**2
Required half range sine series :
0.38*sin(pi*x) + 0.32*sin(2*pi*x) + 0.2*sin(3*pi*x) + 0.16*sin(4*pi*x) +
0.13*sin(5*pi*x)
Output:
Note 1:
If Laplace transform of function does not exist then python returns the
same function without evaluating it.
Note 2:
f(t)=tn
𝚪(𝐧+𝟏) 𝒏!
L[f(t)]= =
𝒔(𝒏+𝟏) 𝒔(𝒏+𝟏)
Note 3:
The function at should be re written as exp(log(a)*t) to get the required
Laplace Transform
Note 4:
rewrite() – A common way to deal special functions is to rewrite them in
terms of one another. This works for any function in sympy,not just special
functions.To rewrite an expression in terms of a function use
expr.rewrite(function)
Example:
>>>from sympy import*
>>> x=symbols('x')
>>> pprint(tan(x).rewrite(sin))
𝟐𝒔𝒊𝒏𝟐 (𝒙)
𝐬𝐢𝐧(𝟐𝒙)
>>>pprint(factorial(x).rewrite(gamma))
Γ(x + 1)
Note5:
Example:
𝟐𝒙 − 𝟏 𝟏 𝟑
− +
𝒙𝟐 + 𝒙 + 𝟏 𝒙 + 𝟒 𝒙
Ser
ial Function [f(t)] (OUTPUT)Laplace Transform [F(s)]
No
.
Enter the function = (sin(3*t))**2
1 sin23t The Laplace transform of given function is : -s/(2*(s**2
+ 36)) + 1/(2*s)
Enter the function = cos(3*t)*cos(4*t)
2 cos 3t cos 4t The Laplace transform of given function is : s/(2*(s**2
+ 49)) + s/(2*(s**2 + 1))
𝒄𝒐𝒔 𝒂𝒕
Note : Since the Laplace transform of does not exists, Python returns
𝒕
the same input without evaluation
Lab 9-Inverse Laplace Transforms
If L[f(t)]=F(s) then L-1[F(s)]=f(t)
Note: Type the Inverse Laplace transform at Fs to get required L-1[F(s)] or f(t)
Output:
2. 𝟏 𝟏
𝓛−𝟏 ( ) = 𝒆𝒂𝒕
(𝒔 − 𝒂) (𝒔 − 𝒂)
4. 𝒂
𝓛−𝟏 ((𝒔𝟐 +𝒂𝟐 ))=sin at
𝒂
(𝒔𝟐 + 𝒂𝟐 ) The given Inverse Laplace transform is : a/(a**2+s**2)
𝒔
𝒔 𝓛−𝟏 ( ) = 𝒄𝒐𝒔 𝒂𝒕
5. (𝒔𝟐 + 𝒂𝟐 )
(𝒔𝟐 + 𝒂𝟐 )
The given Inverse Laplace transform is : s/(a**2+s**2)
𝒔
𝒔 𝓛−𝟏 ( 𝟐 ) = 𝐜𝐨𝐬𝐡 𝒂𝒕
6. (𝒔 − 𝒂𝟐 )
(𝒔𝟐 − 𝒂𝟐 )
The given Inverse Laplace transform is : s/(-a**2+s**2)
𝟏
𝓛−𝟏 (𝒔(𝒔+𝟏)) = 𝟏 − 𝒆−𝒕
7. 𝟏
𝒔(𝒔 + 𝟏) The given Inverse Laplace transform is : 1/(s*(s+1))
𝒔−𝟓
𝓛−𝟏 (𝒔𝟐 −𝟔𝒔+𝟏𝟑) =(-sin(2t)+cos(2t))𝒆𝟑𝒕
10. 𝒔−𝟓
𝒔𝟐 − 𝟔𝒔 + 𝟏𝟑 The given Inverse Laplace transform is : (s - 5)/(s**2 - 6*s + 13)
𝟐𝒆−𝒔
𝓛−𝟏 ( ) = (𝒕 − 𝟏)𝟐 𝜽(𝒕 − 𝟏)
𝟐𝒆 −𝒔 𝒔𝟑
12.
𝒔𝟑 The given Inverse Laplace transform is : 2*exp(-s)/s**3
𝟏 𝒕 𝒔𝒊𝒏𝟑𝒕
𝓛−𝟏 (𝒔𝟐 (𝒔𝟐 +𝟗)) = 𝟗 −
𝟏 𝟐𝟕
𝒔𝟐 (𝒔𝟐 +𝟗)
13. The given Inverse Laplace transform is : 1/(s**2*(s**2 + 9))
𝒔 𝐜𝐨𝐬(𝒕) 𝐜𝐨𝐬(𝟐𝒕)
𝓛−𝟏 ((𝒔𝟐 +𝟏)(𝒔𝟐 +𝟒)) = −
14. 𝒔 𝟑 𝟑
(𝒔𝟐 + 𝟏)(𝒔𝟐 + 𝟒) The given Inverse Laplace transform is : s/((s**2 + 1)*(s**2 + 4))
import sympy as sp
t,s=sp.symbols('t,s',positive=True)
y=sp.Function('y')(s)
y0=2
y1=0
Fs=sp.Eq(s**2*y-s*y0-y1+4*y,0)
Fs=sp.apart(sp.solve(Fs,y))
print("L[y(t)]= ",Fs)
yt=sp.inverse_laplace_transform(Fs[0],s,t)
print("Solution y(t) is :",yt)
Output:
L[y(t)]= [2*s/(s**2 + 4)]
Solution y(t) is : 2*cos(2*t)
𝒅𝟐 𝒚 𝒅𝒚
2.Solve by using Laplace Transforms +𝟑 + 𝟐𝒚 = 𝟎 given that y(0)=1,
𝒅𝒕𝟐 𝒅𝒕
y’(0)=0
import sympy as sp
t,s=sp.symbols('t,s',positive=True)
y=sp.Function('y')(s)
y0=1
y1=0
Fs=sp.Eq(s**2*y-s*y0-y1+3*s*y-3*y0+2*y,0)
Fs=sp.apart(sp.solve(Fs,y))
print("L[y(t)]= ",Fs)
yt=sp.inverse_laplace_transform(Fs[0],s,t)
print("Solution y(t) is :",yt)
Output:
L[y(t)]= [-1/(s + 2) + 2/(s + 1)]
Solution y(t) is : (2*exp(t) - 1)*exp(-2*t)
𝒅𝒚
3. Solve by using Laplace Transforms + 𝒚 = 𝒕𝒆−𝒕 given that y(0)=0
𝒅𝒕
import sympy as sp
t,s=sp.symbols('t,s',positive=True)
y=sp.Function('y')(s)
y0=0
Fs=sp.Eq(s*y-y0+y,sp.laplace_transform(sp.exp(-
t)*t,t,s,noconds=True))
Fs=sp.solve(Fs,y)
Fs=sp.apart(Fs)
print("L[y(t)] =",Fs)
yt=sp.inverse_laplace_transform(Fs[0],s,t)
print("Solution y(t) is :",yt)
Output:
L[y(t)] = [(s + 1)**(-3)]
Solution y(t) is : t**2*exp(-t)/2
𝒅𝟐 𝒚 𝒅𝒚
4.Solve by using Laplace Transforms 𝟐 + 𝟐 − 𝟑𝒚 = 𝒔𝒊𝒏𝒕 given that
𝒅𝒕 𝒅𝒕
y(0)=0, y’(0)=0
import sympy as sp
t,s=sp.symbols('t,s',positive=True)
y=sp.Function('y')(s)
y0=0
y1=0
Fs=sp.Eq(s**2*y-s*y0-y1+2*s*y-2*y0-
3*y,sp.laplace_transform(sp.sin(t),t,s,noconds=True))
Fs=sp.solve(Fs,y)
Fs=sp.apart(Fs)
print("L[y(t)] =",Fs)
yt=sp.inverse_laplace_transform(Fs[0],s,t)
print("Solution y(t) is :",yt)
Output:
L[y(t)] = [-(s + 2)/(10*(s**2 + 1)) - 1/(40*(s + 3)) + 1/(8*(s - 1))]
Solution y(t) is : exp(t)/8 - sin(t)/5 - cos(t)/10 - exp(-3*t)/40
Exercise:
1. Solve by using Laplace Transforms y”+9y= 25e4t given that y(0)=3 ,
y’(0)=7
Output:
L[y(t)] = [(2*s + 3)/(s**2 + 9) + 1/(s - 4)]
Solution y(t) is : exp(4*t) + sin(3*t) + 2*cos(3*t)
Output:
L[y(t)] = [-2*s/(s**2 + 4) + (5*s + 1)/(s**2 + 1)]
Solution y(t) is : sin(t) + 5*cos(t) - 2*cos(2*t)
Output:
L[y(t)] = [(s - 6)/(s**2 + 4) - 4/(s + 1) + 2/(s - 2)]
Solution y(t) is : 2*exp(2*t) - 3*sin(2*t) + cos(2*t) - 4*exp(-t)