Problem Statement
Consider the first-order linear differential equation:
$$\frac{dy}{dx} + y\cot x = 4\cos x$$
for $0 < x < \pi$, with boundary condition $y\left(\frac{\pi}{2}\right) = 3$.
**(a)** [3 marks] Find the integrating factor $I(x)$ for this differential equation.
**(b)** [3 marks] Hence, find the general solution for $y$ in terms of $x$.
**(c)** [2 marks] Find the particular solution satisfying the condition $y\left(\frac{\pi}{2}\right) = 3$.
Verified Solution & Marking Scheme
Part (a) [M1]
Standard form: $\frac{dy}{dx} + P(x)y = Q(x)$ with $P(x) = \cot x$
Part (a) [M1]
Integrating factor $I(x) = e^{\int P(x)\,dx} = e^{\int \cot x\,dx} = e^{\ln|\sin x|}$
Part (a) [A1]
Since $0 < x < \pi$, $\sin x > 0$, so $I(x) = \sin x$
Part (b) [M1]
Multiply throughout by $I(x)$: $\frac{d}{dx}[y\sin x] = 4\cos x\sin x = 2\sin(2x)$
Part (b) [M1]
Integrate both sides with respect to $x$: $y\sin x = \int 2\sin(2x)\,dx = -\cos(2x) + C$ (or $2\sin^2 x + C'$)
Part (b) [A1]
General solution: $y = \frac{-\cos(2x) + C}{\sin x}$ (or $y = 2\sin x + \frac{C'}{\sin x}$)
Part (c) [M1]
Apply boundary condition $y\left(\frac{\pi}{2}\right) = 3$: $3\sin\left(\frac{\pi}{2}\right) = -\cos(\pi) + C \implies 3(1) = -(-1) + C \implies 3 = 1 + C \implies C = 2$
Part (c) [A1]
Particular solution: $y = \frac{2 - \cos(2x)}{\sin x} = 2\sin x + \csc x$