Exact and Bernoulli Equations, Fourier Series, Probability and Hypothesis Tests, Iterative Solvers and Finite Differences
1. Exact and Bernoulli equations
M(x, y) dx + N(x, y) dy = 0 is exact when it is the differential of some φ(x, y), and the test is ∂M/∂y = ∂N/∂x. Then φ is found by integrating M with respect to x, adding whatever terms of N contain y alone, and the solution is φ = C. For (2xy + 3) dx + (x² − 1) dy = 0: M_y = 2x = N_x, so it is exact; ∫M dx = x²y + 3x, and N contributes the extra −y, giving x²y + 3x − y = C. Through (2, 3), C = 12 + 6 − 3 = 15, and at x = 3 the curve has 8y + 9 = 15, y = 0.75.
A Bernoulli equation y′ + P(x)y = Q(x)yⁿ, n ≠ 0, 1, is nonlinear, and the substitution v = y¹⁻ⁿ makes it linear: v′ + (1 − n)Pv = (1 − n)Q. For y′ + y = y² (n = 2), v = 1/y gives v′ − v = −1, so v = 1 + Ce^x and y = 1/(1 + Ce^x); with y(0) = 1/2, C = 1 and y = 1/(1 + eˣ). If an equation is not exact, an integrating factor may make it so — for instance 1/x² or a function of x alone when (M_y − N_x)/N depends on x only.
2. Fourier series, and the heat, wave and Laplace equations
A 2π-periodic f has f(x) = a₀/2 + Σ (aₙ cos nx + bₙ sin nx), with aₙ = (1/π)∫−ππ f cos nx dx and bₙ = (1/π)∫−ππ f sin nx dx. Symmetry does half the work: an even f has only cosine terms (bₙ = 0), an odd f only sine terms (aₙ = 0). At a jump the series converges to the average of the left and right limits (Dirichlet’s conditions). For the square wave f = −1 on (−π, 0) and +1 on (0, π), f is odd and bₙ = 4/(nπ) for odd n, 0 for even n: f = (4/π)(sin x + sin 3x/3 + sin 5x/5 + …), and at x = 0 the series gives 0, the average of −1 and +1.
For f(x) = x² on (−π, π), which is even: a₀/2 = π²/3 and aₙ = 4(−1)ⁿ/n², so a₁ = −4, a₂ = 1, a₃ = −4/9. On a half-range (0, L) a function can be extended as odd, giving a sine series bₙ = (2/L)∫₀ᴸ f sin(nπx/L) dx, or as even, giving a cosine series; the boundary conditions decide which is wanted.
| Equation | Solution | What each mode does |
|---|---|---|
| Heat, u_t = k u_xx | u = Σ bₙ sin(nπx/L) e−k(nπ/L)²t | Decays; higher modes die faster, as n². |
| Wave, u_tt = c² u_xx, released from rest | u = Σ bₙ sin(nπx/L) cos(nπc·t/L) | Oscillates for ever at frequency nc/(2L). |
| Laplace, u_xx + u_yy = 0 on a rectangle | u = Σ cₙ sin(nπx/L) sinh(nπy/L) | Steady state; no time at all. |
The coefficients bₙ are the Fourier sine coefficients of the initial (or boundary) data. On (0, π) with k = 1 and u(x, 0) = 2 sin x + sin 2x, the solution is u = 2 sin x e−t + sin 2x e−4t; at x = π/2 the second mode vanishes (sin π = 0), so u(π/2, ln 2) = 2e−ln 2 = 1.
3. The axioms, the PDF and the CDF
Probability is a function on events satisfying three axioms: P(A) ≥ 0; P(S) = 1; and for mutually exclusive A₁, A₂, …, P(∪Aᵢ) = ΣP(Aᵢ). Everything else is derived: P(Aᶜ) = 1 − P(A), P(∅) = 0, and P(A ∪ B) = P(A) + P(B) − P(A ∩ B). With P(A) = 0.5, P(B) = 0.4 and P(A ∩ B) = 0.2, P(A ∪ B) = 0.7. Conditional probability is P(A | B) = P(A ∩ B)/P(B) for P(B) > 0, and A and B are independent when P(A ∩ B) = P(A)P(B) — here 0.2 = 0.5 × 0.4, so they are.
The cumulative distribution function F(x) = P(X ≤ x) exists for every random variable. It is non-decreasing, right-continuous, tends to 0 at −∞ and 1 at +∞, and P(a < X ≤ b) = F(b) − F(a). For a continuous X the probability density function is f = dF/dx wherever the derivative exists; f ≥ 0, ∫f = 1, and f itself can exceed 1 because it is a density, not a probability. For f(x) = 2x on [0, 1]: F(x) = x², so P(X > 0.5) = 1 − 0.25 = 0.75, and the median, where F = 1/2, is 1/√2 ≈ 0.707, while the mean is ∫x·2x dx = 2/3.
4. Hypothesis testing
A test sets a null hypothesis H₀ (for instance μ = μ₀) against an alternative H₁ (μ ≠ μ₀, two-tailed; or μ > μ₀, one-tailed), computes a test statistic from the sample, and rejects H₀ if the statistic falls in the critical region fixed by the significance level α. Rejecting a true H₀ is a type I error (probability α); failing to reject a false H₀ is a type II error (probability β, and 1 − β is the power). The p-value is the probability, under H₀, of a statistic at least as extreme as the one observed; H₀ is rejected at level α exactly when p < α.
For a mean with known σ, z = (x̄ − μ₀)/(σ/√n) is standard normal under H₀; the two-tailed critical values are ±1.96 at 5% and ±2.576 at 1%, and the one-tailed 5% value is 1.645. With σ unknown and a small sample, t = (x̄ − μ₀)/(s/√n) has the t distribution on n − 1 degrees of freedom. Worked: n = 36, x̄ = 52, μ₀ = 50, σ = 6 gives z = 2/(6/6) = 2. Since 1.96 < 2 < 2.576, H₀ is rejected at 5% but not at 1%; the two-tailed p-value is about 0.046.
5. Iterative solvers and finite differences
The direct route to Ax = b is Gauss elimination (in the shared Linear Algebra chapter). The iterative route rewrites each equation for its diagonal unknown. Jacobi computes every new value from the old ones; Gauss–Seidel uses each new value as soon as it exists, and usually converges about twice as fast. Both converge when A is strictly diagonally dominant (each |aᵢᵢ| exceeds the sum of the other |aᵢⱼ| in its row). For 4x + y = 9, x + 3y = 7 from (0, 0): Jacobi gives x₁ = 9/4 = 2.25, y₁ = 7/3 ≈ 2.333; Gauss–Seidel gives x₁ = 2.25, then y₁ = (7 − 2.25)/3 ≈ 1.583. The exact solution is x = 20/11 ≈ 1.818, y = 19/11 ≈ 1.727.
| Quantity | Formula | Error |
|---|---|---|
| f′(x), forward | [f(x + h) − f(x)]/h | O(h) |
| f′(x), backward | [f(x) − f(x − h)]/h | O(h) |
| f′(x), central | [f(x + h) − f(x − h)]/(2h) | O(h²) |
| f″(x), central | [f(x + h) − 2f(x) + f(x − h)]/h² | O(h²) |
For f = x³ at x = 1 with h = 0.1: forward gives (1.331 − 1)/0.1 = 3.31, central gives (1.331 − 0.729)/0.2 = 3.01, against the exact 3 — the central error is one hundredth of the forward error here, as O(h²) against O(h) predicts. In a difference table the nth differences of a degree-n polynomial are constant, which is how tabulated data reveal their degree. The explicit finite-difference step for the heat equation u_t = k u_xx, uᵢⁿ⁺¹ = uᵢⁿ + r(uᵢ₊₁ⁿ − 2uᵢⁿ + uᵢ₋₁ⁿ) with r = kΔt/Δx², is stable only for r ≤ 1/2; with k = 1 and Δx = 0.1 the largest stable Δt is 0.005.
Key takeaways
- M dx + N dy = 0 is exact iff M_y = N_x; a Bernoulli equation becomes linear under v = y¹⁻ⁿ.
- Even functions have cosine series, odd functions sine series; at a jump the series gives the average of the two limits.
- Heat modes decay as e−k(nπ/L)²t, wave modes oscillate, Laplace solutions are steady; the coefficients are the Fourier coefficients of the data.
- P(a < X ≤ b) = F(b) − F(a); a density can exceed 1. Reject H₀ when p < α; 1.96 and 2.576 are the two-tailed 5% and 1% z points.
- Gauss–Seidel uses new values at once; diagonal dominance guarantees convergence. Central differences are O(h²); the explicit heat step needs r = kΔt/Δx² ≤ 1/2.
Practice questions (17)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
The equation M(x, y) dx + N(x, y) dy = 0 is exact if and only if:
Show answer
Answer: A — ∂M/∂y = ∂N/∂x
If M = φₓ and N = φ_y for some φ, then M_y = φₓ_y = φ_yₓ = N_x; on a simply connected region the converse holds too. The other conditions compare the wrong derivatives — M_x = N_y is not implied by exactness.The solution curve of (2xy + 3) dx + (x² − 1) dy = 0 that passes through (2, 3) has, at x = 3, y = ____.
Numerical answer — type the value.
Show answer
Answer: 0.75
M_y = 2x = N_x, so the equation is exact with solution x²y + 3x − y = C. At (2, 3): 12 + 6 − 3 = 15. At x = 3: 9y + 9 − y = 15, so 8y = 6 and y = 0.75. Dropping the −y term from N gives 9y + 9 = 15, y ≈ 0.667.The solution of the Bernoulli equation y′ + y = y² with y(0) = 1/2 is:
Show answer
Answer: A — y = 1/(1 + eˣ)
With v = 1/y, v′ = −y′/y² = −(y² − y)/y² = v − 1, so v′ − v = −1 and v = 1 + Ceˣ. y(0) = 1/2 gives v(0) = 2, C = 1, and y = 1/(1 + eˣ). Check: y′ = −eˣ/(1 + eˣ)² and y² − y = [1 − (1 + eˣ)]/(1 + eˣ)² = −eˣ/(1 + eˣ)², equal. The e−x version also has y(0) = 1/2 but solves y′ = y − y².The Fourier series on (−π, π) of an odd function contains:
Show answer
Answer: A — only sine terms
f cos nx is odd when f is odd, so every aₙ (and a₀) integrates to zero over the symmetric interval; only bₙ survive. Even functions are the case with cosines and the constant.For the square wave f(x) = −1 on (−π, 0) and +1 on (0, π), extended with period 2π, the Fourier coefficient b₁, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 1.27
b₁ = (1/π)∫−ππ f sin x dx = (2/π)∫₀^π sin x dx = (2/π) × 2 = 4/π ≈ 1.2732, so 1.27. Integrating over (0, π) alone and forgetting the factor from the other half gives 2/π ≈ 0.64.The square wave equal to −1 on (−π, 0) and +1 on (0, π), extended with period 2π, is expanded in a Fourier series. At x = 0 the series converges to:
Show answer
Answer: A — 0
At a jump discontinuity the series converges to the average of the left and right limits, (−1 + 1)/2 = 0 — visible directly, since every sin(nx) is zero at x = 0. The series never takes the value 1 at the jump itself.For f(x) = x² on (−π, π), extended with period 2π, the Fourier coefficient a₂ is ____.
Numerical answer — type the value.
Show answer
Answer: 1
aₙ = (1/π)∫−ππ x² cos nx dx = 4(−1)ⁿ/n², by integrating by parts twice. For n = 2, a₂ = 4/4 = 1. The sign alternates: a₁ = −4, a₃ = −4/9.u(x, t) satisfies u_t = u_xx on 0 < x < π with u(0, t) = u(π, t) = 0 and u(x, 0) = 2 sin x + sin 2x. The value of u(π/2, ln 2) is ____.
Numerical answer — type the value.
Show answer
Answer: 1
Each mode sin nx decays as e−n²t, so u = 2 sin x e−t + sin 2x e−4t. At x = π/2, sin 2x = sin π = 0, leaving 2 × 1 × e−ln 2 = 2 × 1/2 = 1. Decaying both modes at the same rate, or forgetting that the second vanishes at π/2, gives a wrong value.P(A) = 0.5, P(B) = 0.4 and P(A ∩ B) = 0.2. Then P(A ∪ B) is:
Show answer
Answer: A — 0.7
P(A ∪ B) = P(A) + P(B) − P(A ∩ B) = 0.5 + 0.4 − 0.2 = 0.7. Adding without subtracting the intersection counts it twice (0.9); 1.1 would violate P ≤ 1, which follows from the axioms.A continuous random variable X has density f(x) = 2x for 0 ≤ x ≤ 1 and 0 elsewhere. P(X > 0.5) is ____.
Numerical answer — type the value.
Show answer
Answer: 0.75
F(x) = ∫₀ˣ 2t dt = x², so P(X > 0.5) = 1 − F(0.5) = 1 − 0.25 = 0.75. Reading f(0.5) = 1 as a probability confuses the density with the distribution function.Which statements about the cumulative distribution function F of a random variable X are true?
Show answer
Answer: A — F is non-decreasing; C — P(a < X ≤ b) = F(b) − F(a); D — For a continuous X, the density is dF/dx wherever the derivative exists
(A) F(x) = P(X ≤ x) and the event grows with x. (B) False: F is a probability, so 0 ≤ F ≤ 1 — it is the density that can exceed 1. (C) {X ≤ b} is the disjoint union of {X ≤ a} and {a < X ≤ b}. (D) The density is the derivative of the CDF.A sample of n = 36 has mean 52. The population standard deviation is known to be 6. For testing H₀: μ = 50, the value of the z statistic is ____.
Numerical answer — type the value.
Show answer
Answer: 2
z = (x̄ − μ₀)/(σ/√n) = (52 − 50)/(6/√36) = 2/1 = 2. Dividing by σ instead of the standard error σ/√n gives 1/3 and would never reject anything.A two-tailed z-test of H₀: μ = 50 against H₁: μ ≠ 50 gives z = 2 (σ known). Which statements are true?
Show answer
Answer: A — H₀ is rejected at the 5% level; C — The two-tailed p-value is less than 0.05; D — A type I error means rejecting H₀ when it is true
(A) |z| = 2 > 1.96. (B) False: 2 < 2.576, the 1% two-tailed point. (C) p = 2P(Z > 2) ≈ 2 × 0.0228 = 0.0455 < 0.05, the same verdict as (A). (D) The definition of a type I error.A type II error is:
Show answer
Answer: A — failing to reject H₀ when H₀ is false
A type II error keeps a false null hypothesis; its probability is β and 1 − β is the power. Rejecting a true H₀ is the type I error, whose probability is the significance level α.The system 4x + y = 9, x + 3y = 7 is solved by the Gauss–Seidel method starting from x = 0, y = 0, updating x first. After one iteration, y, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 1.58
x₁ = (9 − y₀)/4 = 9/4 = 2.25, and Gauss–Seidel uses it immediately: y₁ = (7 − x₁)/3 = 4.75/3 ≈ 1.583, so 1.58. Jacobi would use x₀ = 0 and give y₁ = 7/3 ≈ 2.33. The iteration converges because the matrix is strictly diagonally dominant.The central-difference estimate of f′(1) for f(x) = x³ with step h = 0.1 is ____.
Numerical answer — type the value.
Show answer
Answer: 3.01
[f(1.1) − f(0.9)]/(2 × 0.1) = (1.331 − 0.729)/0.2 = 0.602/0.2 = 3.01. The error, 0.01, is exactly h²: for a cubic the central difference errs by h² f‴/6 = 0.01 × 6/6. The forward difference gives 3.31.The heat equation u_t = u_xx is solved by the explicit forward-time, central-space scheme with Δx = 0.1. The largest time step for which the scheme is stable is:
Show answer
Answer: A — 0.005
Stability requires r = kΔt/Δx² ≤ 1/2, so Δt ≤ 0.5 × 0.01/1 = 0.005. Δt = 0.01 gives r = 1 and the solution oscillates with growing amplitude; 0.0025 is stable but not the largest.