Calculus · real student question

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

Question

Solve

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

Step-by-step solution

  1. Identify the equation as first-order linear and read off PP and QQ. It is already in the standard form y+P(x)y=Q(x)y'+P(x)y=Q(x) with

    P(x)=2,Q(x)=exP(x)=2,\qquad Q(x)=e^{-x}

    That form is what makes the integrating-factor method available; nothing has to be rearranged.

  2. Build the integrating factor. The factor μ(x)=ePdx\mu(x)=e^{\int P\,dx} is chosen precisely so that multiplying by it turns the left side into a single derivative:

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

    (The constant of integration is omitted here because any nonzero multiple of μ\mu works equally well.)

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

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

    By the product rule the left side is exactly ddx(e2xy)\dfrac{d}{dx}\left(e^{2x}y\right), so

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

  4. Integrate both sides once. Antidifferentiating an exact derivative is immediate, and this is where the single arbitrary constant enters:

    e2xy=exdx=ex+Ce^{2x}y=\int e^{x}\,dx=e^{x}+C

  5. Divide by the integrating factor to isolate yy. Since e2xe^{2x} is never zero, division is legal everywhere:

    y=ex+Ce2x=ex+Ce2xy=\frac{e^{x}+C}{e^{2x}}=e^{-x}+Ce^{-2x}

  6. Substitute the answer back into the original equation. With y=ex+Ce2xy=e^{-x}+Ce^{-2x} we get y=ex2Ce2xy'=-e^{-x}-2Ce^{-2x}, so

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

    The CC terms cancel for every CC, confirming the whole one-parameter family solves the equation.

Answer

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

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