04-BS-1 Mathematics · December 2019
Question 2 of 8: General Solution of a Linear First-Order ODE via Integrating Factor Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated 14 November 2026
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
Notes on this paper
Reference texts: Kreyszig, Advanced Engineering Mathematics (10th ed., Wiley) — ODEs, forced oscillations, tangent planes, line/surface integrals, Stokes'/divergence theorems; Stewart, Calculus: Early Transcendentals (9th ed., Cengage) — vectors, gradients, constrained optimization, multiple integrals.
Question 2: General Solution of a Linear First-Order ODE via Integrating Factor (20 marks)
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Given. $y'+2xy=e^{-x^2}\sec(2x)$.
Find. The general solution $y(x)$.
Approach. Use the integrating factor $\mu=e^{\int2x\,dx}=e^{x^2}$, which is engineered to exactly cancel the $e^{-x^2}$ factor in the forcing, leaving an elementary secant integral.
Integrating factor. $\mu(x)=e^{\int2x\,dx}=e^{x^2}$. Multiplying through,
$$\left(e^{x^2}y\right)'=e^{x^2}\cdot e^{-x^2}\sec(2x)=\sec(2x).$$
Integrate. $\displaystyle\int\sec(2x)\,dx=\tfrac12\ln\left|\sec2x+\tan2x\right|+C$, so
$$e^{x^2}y=\tfrac12\ln\left|\sec2x+\tan2x\right|+C.$$
Solve for $y$.
$$y(x)=e^{-x^2}\left[\tfrac12\ln\left|\sec2x+\tan2x\right|+C\right].$$
$$y(x)=\boxed{e^{-x^2}\left[\tfrac12\ln\left|\sec2x+\tan2x\right|+C\right]}$$
Quantity Result
Integrating factor $\mu(x)$ $e^{x^2}$
$\int\sec2x\,dx$ $\tfrac12\ln|\sec2x+\tan2x|+C$
$y(x)$ $e^{-x^2}\left[\tfrac12\ln|\sec2x+\tan2x|+C\right]$
Concept & Theory
Topic. Integrating-factor method for linear first-order ODEs.
Key relations. For $y'+p(x)y=q(x)$, the factor $\mu=e^{\int p\,dx}$ makes the left side $(\mu y)'$; then $\mu y=\int\mu q\,dx$.
Why this works. Here $p(x)=2x$ gives $\mu=e^{x^2}$, which multiplies the $e^{-x^2}$ in the forcing term to exactly $1$, leaving the elementary $\sec(2x)$ integral — a deliberate pairing of the coefficient $2x$ with the forcing's Gaussian decay rate, not a coincidence.
Common pitfall. Forgetting to multiply the entire right-hand side by $\mu$ before integrating, or mishandling the sign/factor-of-2 inside $\int\sec2x\,dx$ (the substitution $u=2x$ introduces the leading $\tfrac12$).
Source. Kreyszig, Advanced Engineering Mathematics , Ch. 1 (§1.5 Linear ODEs, Integrating Factor).
Report an error in this solution