1# F5-dev-01 — Cobb–Douglas consumer: closed-form demands with numerical validation23## Question4A consumer with u(x1,x2) = α ln x1 + (1−α) ln x2 maximises utility subject to p1x1 + p2x2 ≤ m, x ≥ 0. We derive the Marshallian demands, the indirect utility, and the budget residual at the optimum, and validate them by a numerical constrained maximisation that does not use the closed form.56## Data and exclusions7Single input `data/parameters.csv` (4 rows, SHA-256 a04798ad…4722, matching the bundle manifest): α = 0.35, p1 = 2.5, p2 = 4.0, m = 120 (`n_input_rows`). No missing values, duplicates or out-of-range values; `data_issues` is empty. No rows were excluded (out/exclusions.csv: 4 → 4; `n_analysed` = 4). These are given parameters of a theoretical exercise, not observed data.89## Method10**Derivation.** Lagrangian L = α ln x1 + (1−α) ln x2 + λ(m − p1x1 − p2x2). FOCs: α/x1 = λp1, (1−α)/x2 = λp2. Summing p_i x_i = α/λ + (1−α)/λ = 1/λ = m gives λ = 1/m and11x1* = α m / p1, x2* = (1−α) m / p2, v(p,m) = α ln(α m/p1) + (1−α) ln((1−α) m/p2).1213**Assumptions under which this is the unique optimum.** 0 < α < 1, p1 > 0, p2 > 0, m > 0 (all hold here). Then u is strictly increasing in both goods (local non-satiation ⇒ the budget binds), strictly concave on the open positive orthant, and u → −∞ as either good → 0 (Inada-type boundary behaviour ⇒ no corner solution). The budget set is compact and convex, so a maximum exists, is interior, and is unique; the FOCs with the binding budget are necessary and sufficient. Outside these ranges (e.g. α ∈ {0,1}, non-positive prices or income) the formula does not apply; the script refuses to run in that case.1415**Numerical validation (independent of the closed form).** Utility was maximised directly with three methods, all at the single parameter point above only: (a) bounded scalar maximisation (scipy `minimize_scalar`, xatol 1e-12) of u(x1, (m − p1x1)/p2) along the budget line; (b) a 2,000,001-point grid on the budget line; (c) a 2-D SLSQP with bounds x ≥ 1e-9 and the inequality budget constraint, started at an arbitrary feasible interior point. `indirect_utility_numerical` is the best utility found across the three. No randomness is used (`random_seed` = null).1617## Results18- x1* = 16.8 (`x1_demand`), x2* = 19.5 (`x2_demand`).19- v = 2.9182520128635305 utils (`indirect_utility`).20- Budget residual = 0.0 (`budget_identity_residual`).21- MRS at optimum = 0.625 = p1/p2 = 0.625 (`mrs_at_optimum`, `price_ratio`): tangency holds.22- Expenditure share of good 1 = 0.35 = α (`expenditure_share_good1`).23- Numerical maximum utility = 2.9182520128635305 (`indirect_utility_numerical`), equal to the closed-form value to machine precision (`numerical_validation.abs_diff_v_closed_vs_numerical` = 0.0). The numerical maximisers were x1 ≈ 16.8000002 (bounded scalar), 16.79999 (grid), 16.79999 (SLSQP, converged, budget slack −5.7e-14); see `numerical_validation`.24- `feasibility` = "complete".2526## Uncertainty27This is a deterministic theoretical exercise; there is no sampling uncertainty. The only uncertainty is numerical: the closed-form values are exact up to float64 rounding; the numerical optimisers locate x1 to within ~1e-5 (grid spacing ≈ 2.4e-5; SLSQP tolerance), while utility, being flat at the optimum, agrees to ~1e-13 or better (`numerical_validation`).2829## Limitations and open issues30- The numerical validation covers only the single parameter point (α=0.35, p1=2.5, p2=4, m=120); the general validity of the formula rests on the analytical derivation, not on the numerics.31- SLSQP initially reported non-convergence with an unattainable ftol of 1e-15; ftol was set to 1e-12 (documented in out/state/checks.md). Results do not depend on this choice since all three methods agree.32- `indirect_utility_numerical` is defined as the maximum over three methods; at this point the bounded-scalar method reproduces the closed-form value exactly to float64 precision.33