Skip to content
Exercise 9.5 · Q1

Q.Solve the following differential equation: dydx+2y=sin⁡x\frac{dy}{dx} + 2y = \sin x

Yanam BieapTextbookSubjective· 3mImportance★★★★★
37% · 83/222 Questions
✓ Free question

This is a first-order linear ODE solved using the integrating factor method. The general solution is y=15(2sin⁡x−cos⁡x)+Ce−2xy = \frac{1}{5}(2\sin x - \cos x) + Ce^{-2x}.

Why This Approach Works

The equation dydx+2y=sin⁡x\frac{dy}{dx} + 2y = \sin x is a first-order linear ordinary differential equation — it has the standard form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x). Here P(x)=2P(x) = 2 (constant) and Q(x)=sin⁡xQ(x) = \sin x.

The key insight: the left side dydx+2y\frac{dy}{dx} + 2y looks almost like the derivative of a product. If we multiply both sides by a cleverly chosen function μ(x)\mu(x), the left side becomes exactly ddx(μy)\frac{d}{dx}(\mu y). That function is the integrating factor.

For dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x), the integrating factor is μ(x)=e∫P(x) dx\mu(x) = e^{\int P(x)\,dx}.

Once we multiply through by μ\mu, we can integrate both sides directly — no guesswork needed.


Step-by-Step Solution

1. Identify P(x)P(x) and compute the integrating factor.

Here P(x)=2P(x) = 2, so:

μ(x)=e∫2 dx=e2x\mu(x) = e^{\int 2\,dx} = e^{2x}

2. Multiply the entire equation by μ(x)\mu(x).

e2xdydx+2e2xy=e2xsin⁡xe^{2x}\frac{dy}{dx} + 2e^{2x}y = e^{2x}\sin x

Notice the left side is now exactly ddx(e2xy)\frac{d}{dx}\left(e^{2x}y\right) — check by differentiating: ddx(e2xy)=e2xdydx+2e2xy\frac{d}{dx}(e^{2x}y) = e^{2x}\frac{dy}{dx} + 2e^{2x}y. Perfect.

3. Rewrite and integrate.

ddx(e2xy)=e2xsin⁡x\frac{d}{dx}\left(e^{2x}y\right) = e^{2x}\sin x

Integrate both sides with respect to xx:

e2xy=∫e2xsin⁡x dx+Ce^{2x}y = \int e^{2x}\sin x\,dx + C

4. Evaluate the integral ∫e2xsin⁡x dx\int e^{2x}\sin x\,dx.

This is a classic integration by parts (or use the formula for ∫eaxsin⁡(bx) dx\int e^{ax}\sin(bx)\,dx). Let's do it cleanly.

›Proof

Let I=∫e2xsin⁡x dxI = \int e^{2x}\sin x\,dx.

Use integration by parts: set u=sin⁡xu = \sin x, dv=e2xdxdv = e^{2x}dx. Then du=cos⁡x dxdu = \cos x\,dx, v=12e2xv = \frac{1}{2}e^{2x}.

I=12e2xsin⁡x−12∫e2xcos⁡x dxI = \frac{1}{2}e^{2x}\sin x - \frac{1}{2}\int e^{2x}\cos x\,dx

Now integrate ∫e2xcos⁡x dx\int e^{2x}\cos x\,dx similarly: u=cos⁡xu = \cos x, dv=e2xdxdv = e^{2x}dx, giving du=−sin⁡x dxdu = -\sin x\,dx, v=12e2xv = \frac{1}{2}e^{2x}.

∫e2xcos⁡x dx=12e2xcos⁡x+12∫e2xsin⁡x dx=12e2xcos⁡x+12I\int e^{2x}\cos x\,dx = \frac{1}{2}e^{2x}\cos x + \frac{1}{2}\int e^{2x}\sin x\,dx = \frac{1}{2}e^{2x}\cos x + \frac{1}{2}I

Substitute back:

I=12e2xsin⁡x−12(12e2xcos⁡x+12I)I = \frac{1}{2}e^{2x}\sin x - \frac{1}{2}\left(\frac{1}{2}e^{2x}\cos x + \frac{1}{2}I\right)

I=12e2xsin⁡x−14e2xcos⁡x−14II = \frac{1}{2}e^{2x}\sin x - \frac{1}{4}e^{2x}\cos x - \frac{1}{4}I

Bring −14I-\frac{1}{4}I to the left:

I+14I=12e2xsin⁡x−14e2xcos⁡xI + \frac{1}{4}I = \frac{1}{2}e^{2x}\sin x - \frac{1}{4}e^{2x}\cos x

54I=e2x4(2sin⁡x−cos⁡x)\frac{5}{4}I = \frac{e^{2x}}{4}(2\sin x - \cos x)

Multiply both sides by 45\frac{4}{5}:

I=e2x5(2sin⁡x−cos⁡x)I = \frac{e^{2x}}{5}(2\sin x - \cos x)

So:

∫e2xsin⁡x dx=e2x5(2sin⁡x−cos⁡x)+C\int e^{2x}\sin x\,dx = \frac{e^{2x}}{5}(2\sin x - \cos x) + C

Tip

A faster route: the formula ∫eaxsin⁡(bx) dx=eaxa2+b2(asin⁡(bx)−bcos⁡(bx))\int e^{ax}\sin(bx)\,dx = \frac{e^{ax}}{a^2+b^2}(a\sin(bx) - b\cos(bx)) gives the same result instantly with a=2a=2, b=1b=1.

5. Solve for yy.

From step 3:

e2xy=e2x5(2sin⁡x−cos⁡x)+Ce^{2x}y = \frac{e^{2x}}{5}(2\sin x - \cos x) + C

Divide through by e2xe^{2x} (which is never zero):

y=15(2sin⁡x−cos⁡x)+Ce−2xy = \frac{1}{5}(2\sin x - \cos x) + Ce^{-2x}

Watch out

A common mistake is forgetting the constant CC or misplacing the sign when integrating by parts. Always double-check the integration of eaxsin⁡(bx)e^{ax}\sin(bx) — the signs in the formula are easy to flip.


✓Final answer

The general solution is y=15(2sin⁡x−cos⁡x)+Ce−2xy = \frac{1}{5}(2\sin x - \cos x) + Ce^{-2x}.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.