Differential Equations Exam Paper Spring 2022
Differential Equations Exam Paper Spring 2022
Serial No:
MT1006: Differential Final Exam Solution
Equations Total Time: 3 Hours
BS (DS) Data Sciences Total Marks: 150
Tuesday, 21st June, 2022
________________
Course Instructor Signature of Invigilator
_____________________________________________ _____________________
Student Name Roll No. Section Signature
Q-1 Q-2 Q-3 Q-4 Q-5 Q-6 Q-7 Q-8 Q-9 Total
Marks
Obtained
Total
35 15 10 15 15 10 10 10 30 150
Marks
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 1A [10 Marks]
Solve
+ = , (0) = 4 .
Solution:
The given equation is
+ = .
The equation is already given in standard form.
Integrating factor is
( ) = exp 1 = exp( ) = .
Multiplying standard form with ( ) gives
+ = .
Implies
[ ∙ ( )] = .
Integration gives
∙ ( )= = − + ,
or
( )= − + = −1+ .
Using (0) = 4 into the solution gives
(0) = 0 − 1 + = −1 + ,
or
−1 =4.
Implies
= 5.
The general solution is then written as
( ) = −1+5 ,
or
( )=5 + − 1, −∞ < < ∞ .
∎
Page 2 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 1B [15 Marks]
Solve the given differential equation by finding an appropriate integrating factor.
(2 + 3 ) +2 =0.
Solution:
Here ( , ) = 2 + 3 and ( , ) = 2 . So
=4 ,
and
=2 .
Since ≠ , which implies that the given equation (1) is not exact. The possible integrating factors
are:
− 4 −2 2 1
= = = .
2 2
Since is a function of only, one can proceed with the integrating factor
− 1
( ) = exp = exp = exp[ln ] = exp[ln ] = .
Using ( ) = , the equation changes to
(2 +3 ) +2 = 0.
Now ( , ) = 2 + 3 and ( , ) = 2 . So
=4 ,
and
=4 .
Since = , implies the equation (2) is exact. For solution, one can write:
= ( , )=2 +3 , (3)
and
= ( , )=2 . (4)
( , )= 2 =2 =2 ∙ + ( )= + ( ).
2
So
( , )= + ( ). (5)
Differentiating in Equation (5) w.r.t gives
= [ + ( )] = [ ]+ ( )= [2 ] + ( ).
So
=2 + ( ). (6)
But
=2 +3 .
Equation (6) then implies
Page 3 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
2 +3 = 2 + ( ).
( )=3 .
Implies
( )= + , .
The ( , ) can be written from Equation (5) as
( , )= + + .
∎
Page 4 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 1C [10 Marks]
Solve the given differential equation by using an appropriate substitution.
= ( − 1) .
Note: The first order differential equation given is Bernoulli’s Equation.
Solution:
∎
Page 5 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 2 [15 Marks]
When a cake is removed from an oven, its temperature is measured at 300° . Three minutes later its
temperature is 200° . How long will it take for the cake to cool off to a room temperature of 70° ?
Solution:
The mathematical formulation of Newton’s empirical law of cooling/warming of an object is given by
the linear first-order differential equation
= ( − ),
where is a constant of proportionality, T(t) is the temperature of the object for = 0, and is the
ambient temperature—that is, the temperature of the medium around the object.
In the given scenario, is constant and is given by 70° . Implies
= ,
− 70
yields
ln | − 70| = + .
One can rewrite the above expression through simplifications as
= 70 + .
Using (0) = 300, that is, when = 0, = 300, gives
= 230 .
Therefore
= 70 + 230 .
Finally, the measurement (3) = 200 leads to
13
= ,
23
or
1 13
= ln = −0.19018 .
3 23
Thus
( ) = 70 + 230 ( . )
.
∎
Page 6 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 3 [10 Marks]
Solve
+ = 4 + 10 sin , ( ) = 0, ( )=2.
Solution:
The associated homogenous equation is
+ =0.
+1=0.
, =± .
The general solution to homogenous equation is
( ) = cos + sin .
The assumption for particular solution is
= + + cos + sin .
But there is an obvious duplication of the terms cos x and sin x in this assumed form and two terms in
the complementary function. This duplication can be eliminated by simply multiplying by .
= + + ( cos + sin ) = + + cos + sin .
Now
+ = + − 2 sin + 2 cos = 4 + 10 sin .
Implies
= 4, = 0, −2 = 10, 2 = 0 .
The solutions of the system are immediate:
= 4, = 0, = −5, = 0 .
The particular solution then becomes
= 4 − 5 cos .
The general solution of the given equation is
= + = cos + sin + 4 − 5 cos .
We now apply the prescribed initial conditions to the general solution of the equation.
( ) = cos + sin + 4 − 5 cos ,
gives
=9 .
Similarly,
= −9 sin + cos + 4 + 5 sin − 5 cos ,
gives
( ) = −9 sin + cos + 4 + 5 sin − 5 cos ,
implies
=7.
The solution of the initial-value problem is then
( ) = 9 cos + 7 sin + 4 − 5 cos .
∎
Page 7 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 4 [15 Marks]
Solve the given third-order differential equation by variation of parameters.
+ = tan .
Solution:
The general solution required is
= + .
The auxiliary equation to attached homogenous equation
+ =0,
is
+ =0.
( + 1) = 0 .
= 0, , = ± .
= + cos + sin .
The particular solution is written as
= ( ) + ( ) cos + ( ) sin .
Now
1 cos sin
= 0 − sin cos = sin + cos =1.
0 − cos − sin
Identifying ( ) = tan , one can write
0 cos sin
= 0 − sin cos = tan .
tan − cos − sin
1 0 sin
= 0 0 cos = − sin .
0 tan − sin
1 cos 0 cos − 1
= 0 − sin 0 = − sin tan = = cos − sec .
cos
0 − cos tan
Then
= = tan .
= = − sin .
= = cos − sec .
Implies
= tan = − ln|cos | .
= − sin = cos .
Page 8 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 5 [15 Marks]
Solve the given differential equation by variation of parameters.
−2 +2 = .
Solution:
The attached homogenous equation is
−2 +2 =0.
Notice that the above equation is Cauchy-Euler equation. The auxiliary equation is
+( − ) + =0.
−3 +2=0.
−2 − +2=0.
( − 2) − ( − 2) = 0 .
( − 1)( − 2) = 0 .
= 1, =2.
The is the written as
= + .
The particular solution is
= ( ) + ( ) .
Now
= =2 − = .
1 2
Identifying ( ) = = , one can write
= 0 =− .
2
0
= = .
1
Then
= =− =− .
= =− = .
Implies
( )=− +2 −2 .
( )= − .
The general solution = + is then written as
( )= + + −2 .
∎
Page 9 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 6 [10 Marks]
Show that the solution of the initial-value problem
Page 10 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
So
( )=− sin + cos − sin .
−
Using (0) = 0 gives
0= + ; =− .
− −
Using (0) = 0 gives
0= ; =0.
Then
( )=− cos + cos = (cos − cos ).
− − −
Hence, the solution of the initial-value problem
is
( )= (cos − cos ).
−
Now
lim (cos − cos ), 0/0 .
→ −
Using ’ − rule
− sin − sin
lim (cos − cos ) = lim = .
→ − → −2 −2
∎
Page 11 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 7 [10 Marks]
Find a power series solution about = 0.
( + 1) + − =0.
Solution:
The equation can be written as
+ + − =0.
The given differential equation has singular points at = ± , and so a power series solution centered
at 0 will converge at least for | | < 1, where 1 is the distance in the complex plane from 0 to either
or − . The assumption
= ,
( − 1) + ( − 1) + −
= ( − 1) + ( − 1) + −
=2 − +6 +.
=2 − +6 + [ ( − 1) + ( + 2)( + 1) + − ]
Page 12 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 8 [10 Marks]
Solve the initial value problem using method of Laplace transform.
+4 −5 = , (0) = 1, (0) = 0 .
Solution:
Let ℒ{ ( )} = ( ). Taking the Laplace transform of both sides of the differential equation in gives
ℒ{ + 4 − 5 } = ℒ { } .
1
ℒ { } + 4ℒ{ } − 5ℒ { } = .
→
1
( )− (0) − (0) + 4[ ( ) − (0)] − 5 ( ) = .
( − 1)
Using the initial conditions, one can write
1
( )− +4 ( )−4−5 ( ) = .
( − 1)
1
( +4 − ) ( ) = +4+ .
( − 1)
+2 −7 +5
( + 5)( − 1) ( ) = .
( − 1)
+2 −7 +5
( )= .
( + 5)( − 1)
The partial fraction expansion for ( ) has the form
+2 −7 +5
= + + + .
( + 5)( − 1) +5 − 1 ( − 1) ( − 1)
Solving for the numerators, we ultimately obtain
35 181 1 1
= , = , =− , = .
216 216 36 6
+2 −7 +5 35 1 181 1 1 1 1 1
= + − + .
( + 5)( − 1) 216 + 5 216 − 1 36 ( − 1) 6 ( − 1)
Or
+2 −7 +5 35 1 181 1 1 1 1 1∙2
= + − + .
( + 5)( − 1) 216 + 5 216 − 1 36 ( − 1) 6 ∙ 2 ( − 1)
One now obtains
35 181 1 1
( )= + − + ,
216 216 36 12
the solution to the initial value problem.
∎
Page 13 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Question 9 [30 Marks]
Consider a thin pipe placed along the −axis with ends at = 0 and = . The pipe is filled with a
mixture of mostly water, with a small amount of a certain chemical. As the chemical diffuses through
the pipe, the concentration ( , ) of chemical at location and time is governed by heat equation:
= .
Suppose that the initial concentration is given by:
( , 0) = , ∈ [0, ] .
If the ends of the pipe are closed so that none of the chemical can escape, the boundary conditions are:
(0, ) = 0, ( , ) = 0, ∀ ≥0.
i. Assume that ( , ) = ( ) ( ), find ODEs that are satisfied by ( ) and ( ) using
separation of variables.
ii. Use the given boundary conditions for ( , ) to find boundary conditions for ( ).
iii. Solve the eigenvalue problem for ( ) corresponding to the solution of part ii.
iv. For the eigenvalues found in part iii, solve the corresponding ODE for ( ).
v. Take a linear combination of all of the fundamental solutions ( , ) to get the general
solution ( , ) of the heat equation.
vi. Now use the initial condition:
( , 0) = , ∈ [0, ] ,
to find the coefficients in in general solution from part v.
Solution:
= , 0< < , >0. (1)
First note that the given equation is heat equation. Compare the given equation with general heat
equation
= ,
to notice/observe that = 1 in your case which will provide an ease in the computations for the
solution. Furthermore, in the given boundary conditions, is precisely given to be as which simply
means that in general solutions derived during lectures, one must use = .
With the usual assumption that ( , ) = ( ) ( ), separating variables in (1) through
= , = ,
gives
= .
Page 14 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
= =− . (4)
Remember that is a constant and one imposes a negative sign for the sake of calculation
convenience, nothing more or less. So
+ =0, (5)
and
+ =0. (6)
Boundary Conditions
The boundary conditions translate into (0) = 0 and ( ) = 0. How? Since
( , )= ( ) ( ),
and taking partial derivative of ( , ) w.r.t gives
( , )= ( ) ( ).
Now use the given boundary conditions.
At the first end, that is, at =0,
(0, ) = (0) ( ) .
It is given that (0, ) = 0, which means
(0) ( ) = 0 .
Now, either
(0) = 0, , ( ) =0.
Similarly
( , ) =0,
gives
( ) ( ) =0.
Implies
( )=0.
+ = 0, (0) = 0, ( ) = 0. (7)
One seeks the values of for which the boundary-value problem has nontrivial, that is, nonzero,
solutions.
One shall consider three cases: = 0, < 0, and > 0.
Case I: When = .
For = 0, Equation (5) becomes
+ (0) = 0 ,
or
Page 15 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
=0.
= 0.
= 0, =0.
The solution is
( )= ∙ ∙
+ = + .
( )= + .
Observe that the conditions are on derivatives, that is, . Taking derivative of the solution gives
( )= .
Using (0) = 0, gives
′(0) = .
=0.
Implies
( )= .
Using ( ) = 0, gives
( )= .
=0.
This means the solution to the BVP in first case when = 0 is,
( )= ,
which can be rewritten to identify the eigenfunction as
( )= ∙1= ∙ ⏟
1 .
Page 16 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
Alternatively, the solution is equivalent to
( )= + ,
where cosh(∙) and sinh(∙) are hyperbolic cosine and sine, respectively. This is written for the sake of
convenience as well. For instance, cosh 0 = 1 and sinh 0 = 0 will be used in applying the given
conditions.
Note that
In our case
Page 17 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
+ =0 =− .
, =± .
The solution is then written as
( )= cos + sin .
Taking derivative of ( ) gives
( )=− sin + cos .
Using (0) = 0, gives
(0) = − sin( ∙ 0) + cos( ∙ 0) = .
So
=0,
which implies
= 0, ≠0.
That is
( )= cos . (8)
Using ( ) = 0, gives
( )=− sin , ( )=− sin .
sin = 0.
Either
=0 sin , ≠0.
Since one is interested in non-trivial solutions, this means ≠ 0, implies
sin =0.
The above equation is only true when
= , ℎ = 0, ±1, ±2, ±3, ±4, …
This gives the value of to be
= , = 0, ±1, ±2, ±3, ±4, …
So
= = ,
or precisely = .
Such values of are called the eigenvalues of the problem. The eigenfunctions [(1)] are
( )= cos . (9)
Therefore, for any real nonzero , ( )= cos is a solution of the problem for each . Because
the differential equation is homogeneous, any constant multiple of a solution is also a solution, so we
Page 18 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
may, if desired, simply take = 1, that is, ( ) = cos In other words, for each number in the
sequence
= 1, =4, =9, = 16 , …
the corresponding function in the sequence
= cos , = cos 2 , = cos 3 , = cos 4 , …
is a nontrivial solution of the original problem.
The numbers in = , = 1, 2, 3, … for which the boundary-value problem in possesses nontrivial
solutions are known as eigenvalues. The nontrivial solutions that depend on these values of , =
cos or simply = cos , are called eigenfunctions.
Since solution occurred in the case > 0. The equation for ( ) can be written as
+ =0,
which gives
+ =0.
One has
=− .
Since = , implies
=− .
One can then write
( )= . (10)
Plugging the expressions of ( ) and ( ) in
( , )= ( ) ( ),
gives
( , )= cos ∙ = ∙ cos .
By rewriting as , solutions that satisfy both the heat equation (1) and boundary conditions (2)
are
( , )= cos . (11)
Now by the superposition principle
Each of the product functions ( , ) given is a particular solution of the partial differential equation
(Heat Equation), and each ( , ) satisfies both boundary conditions (0, ) = 0 and ( , ) = 0 as
well.
Page 19 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
boundary conditions (0, ) = 0 and ( , ) = 0 as well.
Page 20 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
What about the initial condition ( , ) = ?
Using ( , ) = in (3) gives
( , 0) = ∙
cos = cos = cos ,
implies
( )= cos ,
that is,
= cos .
Now by the superposition principle, the function
( , )= ( , ),
or
( , )= + cos . (12)
must also, although formally, satisfy equation heat equation and the conditions. Substituting = 0 into
(12) implies that
that is,
( )= + cos ,
or
= + cos .
This last expression is recognized as a half-range expansion of in a cosine series. This means that
2
= ( ) .
Page 21 of 22
National University of Computer and Emerging Sciences
FAST School of Computing Spring-2022 Islamabad Campus
In our case = and ( ) = . This means that
2 2
= cos = cos .
By parts gives
= [ ∙ ]| − .
That is,
sin sin sin sin ∙ 0 1 cos
cos = ∙ − = ∙ − 0∙ − − .
1 1
cos =0+ [cos ∙ − cos ∙ 0] = [cos − 1] .
Since
cos = (−1) ,
implies
1 1
cos = [cos − 1] = [(−1) − 1] .
Now
2 2 1 2
= cos = ∙ [(−1) − 1] = [(−1) − 1] .
We have
2
= , , = [(−1) − 1] .
One concludes that a solution of the boundary-value problem is given by the infinite series
( , )= + cos ,
and is written as
2 2
( , )= + ((−1) − 1) cos = + [(−1) − 1] cos .∎
Page 22 of 22