Calculus · real student question

Solve the first-order linear differential equation dy/dx + 2y = e^(-x).

Question

Find the general solution of

dydx+2y=ex\frac{dy}{dx} + 2y = e^{-x}

Step-by-step solution

  1. Confirm the equation is already in standard linear form. A first-order linear equation looks like dydx+P(x)y=Q(x)\dfrac{dy}{dx} + P(x)y = Q(x). Here P(x)=2P(x)=2 and Q(x)=exQ(x)=e^{-x}, with the derivative coefficient equal to 11 — no dividing through is needed before starting.

  2. Build the integrating factor. The whole method exists to force the left-hand side into a single derivative. The factor that does it is

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

    (the constant of integration is dropped because any nonzero multiple of μ\mu works equally well).

  3. Multiply through and collapse the left side. Multiplying every term by e2xe^{2x}:

    e2xdydx+2e2xy=e2xex=exe^{2x}\frac{dy}{dx} + 2e^{2x}y = e^{2x}e^{-x} = e^{x}

    The left side is exactly the product rule run backwards:

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

  4. Integrate both sides once. Integrating the derivative on the left simply removes it, and the right side is elementary:

    e2xy=ex+Ce^{2x}y = e^{x} + C

    The arbitrary constant CC enters here, and this is the only place it can enter — a first-order equation carries exactly one.

  5. Solve for yy. Divide by e2xe^{2x}, or equivalently multiply by e2xe^{-2x}:

    y=e2x(ex+C)=ex+Ce2xy = e^{-2x}\left(e^{x} + C\right) = e^{-x} + Ce^{-2x}

  6. Verify by substitution. With y=ex+Ce2xy = e^{-x} + Ce^{-2x}, the derivative is y=ex2Ce2xy' = -e^{-x} - 2Ce^{-2x}, so

    y+2y=(ex2Ce2x)+(2ex+2Ce2x)=exy' + 2y = \left(-e^{-x} - 2Ce^{-2x}\right) + \left(2e^{-x} + 2Ce^{-2x}\right) = e^{-x}

    The CC terms cancel for every CC, confirming the general solution. The exe^{-x} piece is the particular solution and Ce2xCe^{-2x} is the decaying homogeneous part.

Answer

y=ex+Ce2xy = e^{-x} + Ce^{-2x}

Need to solve a different problem like this? Open the solver →