Paper: Kenya National Examinations Council (KNEC), Diploma in Electrical and Electronic Engineering, Module III — Engineering Mathematics III, October/November 2021. Paper codes: 2521/301, 2601/303, 2602/303 and 2603/303.

This revision lesson contains all eight questions from the supplied paper scan and independently prepared worked solutions. These notes are for study and are not an official KNEC marking scheme. The printed mark allocations are retained.

Question 1: Fourier series

1(a) Even extension and Fourier cosine series (10 marks)

Question. Sketch the even extension of f(x) = x on the stated interval, determine its Fourier cosine series, and use x = 0 to show the odd-square reciprocal identity in the paper.

f(x) = x,   0 ≤ x ≤ π
∑n=1∞ 1/(2n − 1)2 = π2/8

Worked answer. Reflect the line y = x evenly in the y-axis. The extension is y = |x| on −π ≤ x ≤ π, repeated with period 2π.

fe(x) = |x|

For a cosine series on −π ≤ x ≤ π:

a0/2 = π/2,   bn = 0
an = (2/π)∫0π x cos(nx) dx = 2[(−1)n − 1]/(πn2)

Thus only the odd cosine terms remain.

fe(x) = π/2 − (4/π)∑k=1∞ cos((2k − 1)x)/(2k − 1)2

At x = 0, the even extension has value zero.

0 = π/2 − (4/π)∑k=1∞ 1/(2k − 1)2
∑k=1∞ 1/(2k − 1)2 = π2/8

1(b) Periodic function and Fourier series (10 marks)

Question. The function is defined below and repeated with period 4. Sketch it for −2 < t < 6 and determine its Fourier series.

f(t) 2t + t2 2t − t2
Interval −2 ≤ t ≤ 0 0 ≤ t ≤ 2
f(t + 4) = f(t)

Worked answer. Over one period, the graph passes through the following turning points; repeat this curve four units to the right to complete the requested sketch.

t −2 −1 0 1 2 3 4 5 6
f(t) 0 −1 0 1 0 −1 0 1 0

The function is odd over −2 ≤ t ≤ 2, so it has only sine terms. With L = 2:

a0 = 0,   an = 0
bn = ∫02 (2t − t2) sin(nπt/2) dt = 2[1 − (−1)n]/(nπ/2)3
bn = 32/(n3π3) for odd n;   bn = 0 for even n
f(t) = (32/π3)∑k=0∞ sin((2k + 1)πt/2)/(2k + 1)3

Question 2: Multiple integration

2(a) Double integral (6 marks)

Question. Evaluate the double integral shown.

I = ∫01 ∫0y2 ex/y dx dy

Worked answer. Integrate first with respect to x, treating y as constant.

∫0y2 ex/y dx = y[ex/y]0y2 = y(ey − 1)
I = ∫01 y(ey − 1) dy
I = [(y − 1)ey]01 − [y2/2]01 = 1 − 1/2
I = 1/2

2(b) Polar coordinates in the positive quadrant (7 marks)

Question. Use polar coordinates to evaluate the integral over the positive quadrant of the unit circle.

I = ∬D xy(x2 + y2)3/2 dx dy
0 ≤ r ≤ 1,   0 ≤ θ ≤ π/2

Worked answer. Substitute x = r cos θ and y = r sin θ, with dA = r dr dθ.

xy(x2 + y2)3/2 dA = r6 cos θ sin θ dr dθ
I = ∫0π/2 cos θ sin θ dθ ∫01 r6 dr
I = (1/2)(1/7) = 1/14

2(c) Area between two parabolas (7 marks)

Question. Show by double integration that the area between the parabolas below is 16/3.

y2 = 4x,   x2 = 4y

Worked answer. The curves meet at (0, 0) and (4, 4). For 0 ≤ x ≤ 4, the upper and lower y-limits are:

y = 2√x,   y = x2/4
A = ∬D 1 dA = ∫04 ∫x2/42√x 1 dy dx
A = ∫04 (2√x − x2/4) dx = 32/3 − 16/3
A = 16/3 square units

Question 3: Line integrals and Green’s theorem

3(a) Line integral along a parabola (6 marks)

Question. Evaluate the line integral from (1, 1) to (4, 2) along the parabola y² = x.

∫(1,1)(4,2) [(x + y) dx + (y − x) dy]

Worked answer. Parameterize the curve by y = t and x = t², with 1 ≤ t ≤ 2.

x = t2,   y = t,   dx = 2t dt,   dy = dt
I = ∫12 [(t2 + t)2t + (t − t2)] dt
I = ∫12 (2t3 + t2 + t) dt
I = [t4/2 + t3/3 + t2/2]12 = 34/3

3(b) Verification of Green’s theorem on a triangle (14 marks)

Question. Verify Green’s theorem for the line integral below, where C is the triangle with vertices (0, 0), (3, 0), (3, 2), traversed counter-clockwise.

∮C [(2x − y + 4) dx + (5y + 3x − 6) dy]

Worked answer. Set P = 2x − y + 4 and Q = 5y + 3x − 6. The area integral is:

Qx − Py = 3 − (−1) = 4
∬D (Qx − Py) dA = ∫03 ∫02x/3 4 dy dx = 12

Now add the three counter-clockwise boundary contributions.

C1: (0,0) → (3,0),   ∫ P dx + Q dy = ∫03 (2x + 4) dx = 21
C2: (3,0) → (3,2),   ∫ P dx + Q dy = ∫02 (5y + 3) dy = 16
C3: (3,2) → (0,0),   x = 3t, y = 2t, 1 ≥ t ≥ 0
∫C3 P dx + Q dy = ∫10 50t dt = −25
∮C P dx + Q dy = 21 + 16 − 25 = 12

The line integral and double integral both equal 12, so Green’s theorem is verified.

Question 4: Surface area and triple integration

4(a) Surface area of a sphere (11 marks)

Question. Using double integrals, determine the surface area of the sphere below.

x2 + y2 + z2 = r2

Worked answer. Write the upper and lower hemispheres as graphs over the disk x² + y² ≤ r². For the upper hemisphere, z = √(r² − x² − y²); its surface-area element is r/z times dA. The lower hemisphere gives the same area.

z = ±√(r2 − x2 − y2),   dS = [r/√(r2 − ρ2)] dA
S = 2∫02π ∫0r [rρ/√(r2 − ρ2)] dρ dθ
∫0r ρ/√(r2 − ρ2) dρ = r
S = 2(2π)(r)(r) = 4πr2

4(b) Triple integral in spherical coordinates (9 marks)

Question. Evaluate the triple integral over the first-octant part of the unit sphere using spherical coordinates.

I = ∫01 ∫0√(1−x2) ∫0√(1−x2−y2) xyz dz dy dx

Worked answer. In spherical coordinates, the first-octant limits are 0 ≤ ρ ≤ 1, 0 ≤ φ ≤ π/2, and 0 ≤ θ ≤ π/2.

x = ρ sin φ cos θ,   y = ρ sin φ sin θ,   z = ρ cos φ
xyz dV = ρ5 sin3φ cos φ cos θ sin θ dρ dφ dθ
I = ∫01 ρ5 dρ ∫0π/2 sin3φ cos φ dφ ∫0π/2 cos θ sin θ dθ
I = (1/6)(1/4)(1/2) = 1/48

Question 5: Vector calculus

5(a) Line integral along y = x² (6 marks)

Question. Evaluate the line integral, where the vector field is shown and C is the curve y = x² from (0, 0) to (1, 1).

F = x2y2 i + y j
∫C F·dr

Worked answer. Use x = t and y = t² for 0 ≤ t ≤ 1.

dx = dt,   dy = 2t dt,   P = x2y2 = t6,   Q = y = t2
∫C F·dr = ∫01 (P dx + Q dy) = ∫01 (t6 + 2t3) dt
∫C F·dr = 1/7 + 1/2 = 9/14

5(b) Divergence theorem for a cone (14 marks)

Question. Evaluate the outward flux over the entire surface of the region above the xy-plane bounded by the cone and the plane z = 4, using the divergence theorem.

z2 = x2 + y2,   z = 4
F = 4xz i + xyz2 j + 3z k

Worked answer. The divergence theorem converts the closed-surface flux into a volume integral. In cylindrical coordinates, the solid is 0 ≤ z ≤ 4, 0 ≤ ρ ≤ z, 0 ≤ θ ≤ 2π.

∇·F = ∂(4xz)/∂x + ∂(xyz2)/∂y + ∂(3z)/∂z = 4z + xz2 + 3
∬S F·n dS = ∭V (4z + xz2 + 3) dV

The term involving x integrates to zero over each circular cross-section by symmetry. The remaining terms give:

∭V (4z + 3) dV = π∫04 (4z + 3)z2 dz
∬S F·n dS = π[z4 + z3]04 = 320π

Question 6: Complex variables

6(a) Harmonic function and conjugate (8 marks)

Question. Show that U(x, y) is harmonic and determine its harmonic conjugate v(x, y) such that f(z) = U + jv is analytic.

U(x,y) = ln(x2 + y2)

Worked answer. The origin is excluded. Differentiate U twice.

Uxx = 2(y2 − x2)/(x2 + y2)2
Uyy = 2(x2 − y2)/(x2 + y2)2
Uxx + Uyy = 0

From the Cauchy–Riemann equations, vy = Ux. Integrating gives a local harmonic conjugate.

Ux = 2x/(x2 + y2),   Uy = 2y/(x2 + y2)
v(x,y) = 2 tan−1(y/x) + C = 2 arg(z) + C
f(z) = 2 Log z + jC

The logarithm is taken on a chosen branch that excludes the origin.

6(b) Image of a circle under a transformation (12 marks)

Question. The circle is mapped onto the ω-plane by the transformation shown. Determine the centre and radius of the image circle.

|z − 2j| = 1
ω = 1/(z + 3)

Worked answer. Invert the transformation and apply the original circle equation.

z = 1/ω − 3
|1 − (3 + 2j)ω| = |ω|

Write ω = u + jv, square the modulus, and collect terms.

(1 − 3u + 2v)2 + (3v + 2u)2 = u2 + v2
12u2 + 12v2 − 6u + 4v + 1 = 0
(u − 1/4)2 + (v + 1/6)2 = 1/144
Centre: (1/4, −1/6);   radius: 1/12

Question 7: Numerical methods

7(a) Newton–Raphson method (8 marks)

Question. Show that the iteration below gives a better root of the equation. Starting with x0 = 0.5, solve it correct to four decimal places.

f(x) = x3 − 5x + 1 = 0
xn+1 = (2xn3 − 1)/(3xn2 − 5)

Worked answer. Apply Newton–Raphson with the given starting value.

f′(x) = 3x2 − 5
xn+1 = xn − f(xn)/f′(xn) = (2xn3 − 1)/(3xn2 − 5)
x0 = 0.5,   x1 = 0.176470588
x2 = 0.201568074,   x3 = 0.201639675,   x4 = 0.201639676
x = 0.2016

7(b) Newton–Gregory forward interpolation (12 marks)

Question. The table represents a polynomial of degree four. Use Newton–Gregory forward differences to find the polynomial in its simplest form, then determine f(1.5).

x 1 2 3 4 5
f(x) 1 11 85 325 881

Worked answer. The forward-difference table is:

f(x) 1 11 85 325 881
Δf 10 74 240 556
Δ²f 64 166 316
Δ³f 102 150
Δ⁴f 48

With h = 1 and p = x − 1, the forward interpolation formula gives:

f(x) = 1 + 10p + 64[p(p − 1)/2] + 102[p(p − 1)(p − 2)/6] + 48[p(p − 1)(p − 2)(p − 3)/24]
f(x) = 2p4 + 5p3 + 3p2 + 1,   p = x − 1
f(x) = 2x4 − 3x3 + x + 1

For x = 1.5, p = 0.5.

f(1.5) = 1 + 10(0.5) + 64[0.5(−0.5)/2] + 102[0.5(−0.5)(−1.5)/6] + 48[0.5(−0.5)(−1.5)(−2.5)/24]
f(1.5) = 2.5

Question 8: Matrices and differential equations

8(a) Eigenvalues and eigenvectors (10 marks)

Question. Determine the eigenvalues and corresponding eigenvectors of the matrix shown.

A = −5  2
2  −2

Worked answer. Set the characteristic determinant to zero.

det(A − λI) = λ2 + 7λ + 6 = (λ + 1)(λ + 6) = 0
λ1 = −1,   v1 = (1, 2)T;    λ2 = −6,   v2 = (−2, 1)T

8(b) State transition matrix (10 marks)

Question. A linear system is described by the constant-coefficient differential equation below. Determine its state transition matrix Φ(t).

dx(t)/dt = Bx(t),   B = 1  1
4  1

Worked answer. The eigenvalues of B are 3 and −1. The corresponding projectors give its matrix exponential.

λ2 − 2λ − 3 = (λ − 3)(λ + 1) = 0
(B + I)/4 = 2  1
4  2
/4
(3I − B)/4 = 2  −1
−4  2
/4
Φ(t) = eBt = e3t(B + I)/4 + e−t(3I − B)/4
Φ(t) = (e3t/4)2  1
4  2
+ (e−t/4)2  −1
−4  2

Study note: these independently prepared solutions are for revision and are not an official KNEC marking scheme.