If \(y = y(x)\) is the solution of the differential equation \(\displaystyle\frac{dy}{dx} - y = e^{x}\sin x\) with \(y(0) = 0\), then \(y(\pi)\) is equal to
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → \(2e^{\pi}\)
This is a linear equation with \(P = -1\) and \(Q = e^{x}\sin x\). The integrating factor is \(e^{-x}\). So
\( \displaystyle y\,e^{-x} = \int e^{x}\sin x\cdot e^{-x}\,dx = \int \sin x\,dx \)
\( y\,e^{-x} = -\cos x + C \)
Using \(y(0) = 0\):
\( 0 = -1 + C \Rightarrow C = 1 \)
\( y = e^{x}(1 - \cos x) \)
At \(x = \pi\), \(\cos \pi = -1\):
\( y(\pi) = e^{\pi}(1 + 1) = 2e^{\pi} \)
Why the other options are incorrect
Option (1) \(0\) — Incorrect. The function \(y = e^{x}(1 + \cos x)\) gives 0 at \(\pi\), but it fails \(y(0) = 0\): it gives \(y(0) = 2\).
Option (2) \(e^{\pi}\) — Incorrect. This drops the constant: \(y = -e^{x}\cos x\) gives \(e^{\pi}\) at \(\pi\), but \(y(0) = -1\), not 0.
Option (4) \(-2e^{\pi}\) — Incorrect. This takes \(\int \sin x\,dx = \cos x\); then \(C = -1\) and \(y = e^{x}(\cos x - 1)\), which gives \(-2e^{\pi}\). The integral of \(\sin x\) is \(-\cos x\).