Differential Equations
Linear ODE — integrating factor
Grade Class 12
Question:
<p>If \(\sin x\,\dfrac{dy}{dx} + y\cos x + 2x + x^2\cos x = 0\), \(f(0) = 0\), then \(f\\!\left(\dfrac{\pi}{2}\right) =\)</p>
<span>\(-\pi^2/4\)</span>
<span>\(\pi^2/4\)</span>
<span>\(-\pi^2/2\)</span>
<span>\(\pi^2/2\)</span>
Step-by-Step Solution
Key Concept: Recognise d/dx(y sin x) = sin x \cdot dy/dx + y cos x.
<div class='solution'><p><strong>Step 1:</strong> Rewrite: $\dfrac{d}{dx}(y\sin x) = \sin x\,y' + y\cos x$.</p>
<p>So the equation is: $\dfrac{d}{dx}(y\sin x) = -(2x + x^2\cos x)$.</p>
<p><strong>Step 2:</strong> Integrate both sides:</p>
<p>$$y\sin x = -\int(2x + x^2\cos x)\,dx$$</p>
<p>$\int 2x\,dx = x^2$. For $\int x^2\cos x\,dx$: integrate by parts twice:</p>
<p>$= x^2\sin x - 2\int x\sin x\,dx = x^2\sin x - 2(-x\cos x + \sin x) = x^2\sin x + 2x\cos x - 2\sin x$.</p>
<p>$$y\sin x = -(x^2 + x^2\sin x + 2x\cos x - 2\sin x) + C$$</p>
<p><strong>Step 3:</strong> At $x=0$: $0 = 0 + C \implies C = 0$.</p>
<p>At $x = \pi/2$, $\sin(\pi/2)=1$: $y = -(\pi^2/4 + \pi^2/4 + 0 - 2) + 2 = -\pi^2/4$.</p>
<p>Wait — simplify: $y(\pi/2) = -\pi^2/4$. <strong>Answer: (A)</strong> $-\pi^2/4$.</p>
<p class='key-concept'>🔑 Key Concept: When you see $\sin x\cdot y' + y\cos x$, immediately recognise it as $\frac{d}{dx}(y\sin x)$. This converts the equation to direct integration.</p>
<p class='trap-warning'>⚠️ Trap: Dividing through by $\sin x$ and treating as a standard linear ODE — valid but messy. The exact derivative shortcut is far cleaner.</p></div>
Correct Answer: 1