Paper: Kenya National Examinations Council (KNEC), Diploma in Electrical and Electronic Engineering, Module III — Engineering Mathematics III, June/July 2023 (paper codes 2521/303, 2601/303, 2602/303 and 2603/303).

This revision lesson presents all eight questions from the supplied four-page paper with independently prepared worked solutions. The examination asks candidates to answer any five. These explanations are study notes, not an official KNEC marking scheme; use the source scan to check notation where needed.

Question 1: Complex variables

1(a) Exponential function and Cauchy–Riemann equations

Question. Given f(z)=ez+1, where z=x+jy, express f(z) as u+jv and show that u and v satisfy the Cauchy–Riemann equations.

Worked answer.

Since ez+1=ex+1ejy=ex+1(cos y+j sin y), we have u=ex+1cos y and v=ex+1sin y.
Then ux=ex+1cos y=vy, while uy=−ex+1sin y=−vx.

Both Cauchy–Riemann equations hold.

1(b) Harmonic function and conjugate

Question. For u(x,y)=xy³−x³y, show that u is harmonic and find a conjugate harmonic function v(x,y) such that f(z)=u+jv is analytic.

Worked answer.

ux=y³−3x²y and uy=3xy²−x³.
Hence uxx=−6xy and uyy=6xy, so ∇²u=0.
From the Cauchy–Riemann equations, vy=ux=y³−3x²y.
Integrating with respect to y gives v=y⁴/4−(3/2)x²y²+g(x).
Using vx=−uy=x³−3xy² gives g′(x)=x³, so:

v(x,y)=x⁴/4−(3/2)x²y²+y⁴/4+C. Equivalently, f(z)=jz⁴/4 plus an arbitrary complex constant.

1(c) Image of a circle under w=1/z

Question. Under the transformation w=1/z, determine the centre and radius of the image of |z−1/2|=1.

Worked answer.

Substitute z=1/w: |1/w−1/2|=1, so |2−w|=2|w|.
Writing w=u+jv and squaring gives 3u²+3v²+4u−4=0, or (u+2/3)²+v²=(4/3)².

The image circle has centre (−2/3,0) and radius 4/3.

Question 2: Matrices and state-transition matrices

2(a) Eigenvalues and eigenvectors

Question. For A=[[-4,2],[2,−4]], find its eigenvalues and corresponding eigenvectors.

Worked answer.

det(A−λI)=(−4−λ)²−4=0, giving λ=−2 and λ=−6.
For λ=−2, an eigenvector is (1,1)ᵀ.
For λ=−6, an eigenvector is (1,−1)ᵀ.

Nonzero scalar multiples are also valid.

2(b) Linear system and transition matrix

Question. The system is di₁/dt=2i₁ and di₂/dt=−3i₂. Write it as dI/dt=CI for I=[i₁,i₂]ᵀ, then determine the state-transition matrix φ(t).

Worked answer.

C=diag(2,−3), so dI/dt=CI.
With the transition referenced to t=0, φ(t)=eCt=diag(e2t,e−3t).

Question 3: Vector calculus

3(a) Work along a space curve

Question. For F=3x²i+2xzj+zk and the curve x=2t², y=t, z=4t²−t, 0≤t≤1, find the work done.

Worked answer.

Set r(t)=(2t²,t,4t²−t), so r′(t)=(4t,1,8t−1).
Along the curve, F(r(t))=(12t⁴,16t⁴−4t³,4t²−t).
Thus F·r′=48t⁵+16t⁴+28t³−12t²+t.
The work is ∫₀¹F·r′dt=8+16/5+7−4+1/2=147/10.

3(b) Conservative field and potential

Question. Show that F=y²cos(x)i+2y sin(x)j is conservative and find its scalar potential φ(x,y).

Worked answer.

Let P=y²cos x and Q=2y sin x.
Then Py=2y cos x=Qx, so the field is conservative.
Integrating P with respect to x gives φ=y²sin x+g(y).
Matching φy to Q gives g′(y)=0.
Hence φ(x,y)=y²sin x+C.

3(c) Green’s theorem

Question. Use Green’s theorem to evaluate ∮C(−y³dx+x³dy), where C bounds the region between the x-axis and the upper half of x²+y²=1.

Worked answer.

Take P=−y³ and Q=x³.
Then Qx−Py=3x²+3y².
Over the upper unit semicircle, polar coordinates give ∫₀π∫₀¹3r²·r dr dθ=3π/4.

Therefore the line integral is 3π/4.

Question 4: Newton–Raphson and interpolation

4(a) Newton–Raphson method

Question. For x³+5x²−28=0, show that xn+1=(2xn³+5xn²+28)/(3xn²+10xn). Starting with x₀=1, find the root to four decimal places.

Worked answer.

Let f(x)=x³+5x²−28, so f′(x)=3x²+10x.
Substitution in xn+1=xn−f(xn)/f′(xn) gives the stated formula.
Iterating from x₀=1 gives x₁≈2.6923, x₂≈2.1220, x₃≈2.0048, x₄≈2.0000.
Since f(2)=0, the root is 2.0000.

4(b) Newton–Gregory interpolation

Question. For x=0,1,2,3,4,5 and f(x)=4,9,32,85,180,329, use Newton–Gregory interpolation to find f(0.5) and f(4.5), correct to three decimal places.

x 0 1 2 3 4 5
f(x) 4 9 32 85 180 329
Δf 5 23 53 95 149
Δ²f 18 30 42 54
Δ³f 12 12 12

For x=0.5, use the forward formula with u=0.5: f=4+5u+18u(u−1)/2+12u(u−1)(u−2)/6=5.000. For x=4.5, the backward formula with u=−0.5 gives f=329+149u+54u(u+1)/2+12u(u+1)(u+2)/6=247.000.

Question 5: Multiple integration

5(a) Integral over an elliptical region

Question. Evaluate ∬Rxy dy dx, where R is the first-quadrant region enclosed by 9x²+4y²=36.

Worked answer.

The ellipse has x-intercept 2 and y upper bound (3/2)√(4−x²).
Therefore ∫₀²∫₀(3/2)√(4−x²)xy dy dx=(9/8)∫₀²x(4−x²)dx=9/2.

5(b) Area between two curves

Question. Sketch the region bounded by y=3x−x² and y=x, then determine its area using double integration.

Worked answer.

Intersections satisfy 3x−x²=x, so x=0 and x=2.

Between them the parabola is above the line.

Thus A=∫₀²[(3x−x²)−x]dx=∫₀²(2x−x²)dx=4/3 square units.

5(c) Volume in the first octant

Question. Find the volume bounded by x=4−y² and the planes z=y, x=0 and z=0 in the first octant.

Worked answer.

The bounds are 0≤y≤2, 0≤z≤y and 0≤x≤4−y².
Hence V=∫₀²∫₀ʸ∫₀4−y²dx dz dy=∫₀²y(4−y²)dy=4.

Question 6: Fourier series

6(a) Fourier sine series of a triangular voltage

Question. The graph of v(t) rises linearly from (0,0) to (π/2,π), then falls to (π,0). Give an analytical description, sketch its odd extension and find its Fourier sine series on 0<t<π.

Worked answer.

The two line segments are v(t)=2t for 0≤t≤π/2 and v(t)=2(π−t) for π/2≤t≤π.

Extend oddly to −π<t<0 and then periodically with period 2π.

Its sine coefficient is bn=(2/π)∫₀πv(t)sin(nt)dt=8sin(nπ/2)/(πn²).
Even n terms vanish, so:

v(t)=(8/π)∑k=0∞(−1)ᵏ sin((2k+1)t)/(2k+1)².

6(b) Fourier series of a periodic piecewise function

Question. For the period-4 function h(x)=−1 on −2≤x≤0 and h(x)=x on 0≤x≤2, determine its Fourier series.

Worked answer.

Use L=2 and the form h(x)=a₀/2+∑[ancos(nπx/2)+bnsin(nπx/2)].

The average is a₀=0.

Direct integration gives an=2((−1)ⁿ−1)/(n²π²) and bn=(1−3(−1)ⁿ)/(nπ).
Therefore:

h(x)=∑n=1∞[2((−1)ⁿ−1)/(n²π²) cos(nπx/2)+(1−3(−1)ⁿ)/(nπ) sin(nπx/2)].

At jump points, the Fourier series converges to the midpoint of the left and right limits.

Question 7: Surface integrals and Stokes’ theorem

7(a) Flux across a plane

Question. Evaluate ∬SA·n ds for A=xyi−y²j+zk, where S is the part of x+y+z=1 in the first octant.

Worked answer.

Put z=1−x−y over the triangle x≥0, y≥0, x+y≤1.

For the outward orientation, the vector area element is (1,1,1)dxdy. The integrand is xy−y²+z.

Thus the flux is ∬R(xy−y²+1−x−y)dxdy=1/24−1/12+1/6=1/8.

7(b) Verify Stokes’ theorem

Question. Verify Stokes’ theorem for A=2yi+3xj−z²k on the upper hemisphere x²+y²+z²=9, whose boundary is C.

Worked answer.

∇×A=(0,0,3−2)=k.

Its flux through the upper hemisphere equals the area of its projection onto the radius-3 disk: 9π.

For C, use r(t)=(3cos t,3sin t,0), 0≤t≤2π.
Then A·r′=−18sin²t+27cos²t, whose integral is 9π.

Both sides are 9π.

Question 8: Eigenvalues and Fourier cosine series

8(a) Construct a matrix from eigenpairs

Question. A 2×2 matrix M has eigenvalues λ₁=−2 and λ₂=7 with eigenvectors v₁=(1,−1)ᵀ and v₂=(4,5)ᵀ. Determine M.

Worked answer.

Form P from the eigenvectors as columns: P=[[1,4],[−1,5]], and D=diag(−2,7).
Then P⁻¹=(1/9)[[5,−4],[1,1]].
Therefore M=PDP⁻¹=[[2,4],[5,3]].

8(b) Half-range cosine series and odd-square identity

Question. Sketch the even extension of f(t)=1+t on 0<t<1 and find its Fourier cosine series. By setting t=0, show that π²/8=∑n=1∞1/(2n−1)².

Worked answer.

Reflect f evenly to obtain f(t)=1+|t| on −1<t<1, then repeat with period 2.
The cosine series on 0≤t≤1 has constant term a₀/2=∫₀¹(1+t)dt=3/2.
Its coefficients are an=2∫₀¹(1+t)cos(nπt)dt=2((−1)ⁿ−1)/(n²π²).
Thus only odd n terms remain:

f(t)=3/2−(4/π²)∑k=0∞cos((2k+1)πt)/(2k+1)². At t=0, 1=3/2−(4/π²)∑k=0∞1/(2k+1)², which gives the required identity.

Revision note

Use the question numbers to compare these solutions with the June/July 2023 KNEC Engineering Mathematics III paper. The answers are independently prepared learning notes and are not an official KNEC marking scheme.