Question:medium

The solution of \[ \frac{dy}{dx}+y=f(x), \] where \[ f(x)= \begin{cases} x, & 0\le x\\ 0, & x\ge1, \end{cases} \] with the conditions \[ y(0)=0,\qquad y(1)=e^{-1}, \] is

Show Hint

For piecewise differential equations:
• Solve the differential equation separately on each interval.
• Use the given initial condition to determine the constant in the first interval.
• Use continuity (or the given value at the junction point) to determine the constant in the next interval.
• Finally, combine the solutions into a single piecewise function.
Updated On: Jul 2, 2026
  • \[ y= \begin{cases} x-e^{-x}, & 0\le x\\ e^{-x}, & x\ge1. \end{cases} \]
  • \[ y= \begin{cases} x-1+e^{-x}, & 0\le x\\ e^{\,1-x}, & x\ge1. \end{cases} \]
  • \[ y= \begin{cases} x-1+e^{-x}, & 0\le x\\ e^{-x}, & x\ge1. \end{cases} \]
  • \[ y= \begin{cases} x+e^{-x}, & 0\le x\\ e^{-x}, & x\ge1. \end{cases} \]
Show Solution

The Correct Option is C

Solution and Explanation

Was this answer helpful?
0