Question:

Let \( y(x) \) be the solution of the differential equation \( \frac{dy}{dx} + y = f(x) \), for \( x \geq 0, y(0) = 0 \), where 
\[ f(x) = \begin{cases} 2, & 0 \leq x < 1 \\ 0, & x \geq 1 \end{cases} \] Then \( y(x) \) is 
 

Show Hint

When solving linear differential equations with piecewise forcing functions, solve the equation for each piece separately, using the appropriate boundary conditions.
Updated On: Dec 15, 2025
  • \( 2(1 - e^{-x}) \) when \( 0 \leq x < 1 \) and \( 2(e - 1)e^{-x} \) when \( x \geq 1 \) 
     

  • \( 2(1 - e^{-x}) \) when \( 0 \leq x < 1 \) and 0 when \( x \geq 1 \)
  • \( 2(1 - e^{-x}) \) when \( 0 \leq x < 1 \) and \( 2(1 - e^{-1}) e^{-x} \) when \( x \geq 1 \)
  • \( 2(1 - e^{-x}) \) when \( 0 \leq x < 1 \) and \( 2e^{1-x} \) when \( x \geq 1 \) 
     

Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Given differential equation: $$\frac{dy}{dx} + y = f(x), \quad y(0) = 0$$

where $$f(x) = \begin{cases} 2, & 0 \leq x < 1 \ 0, & x \geq 1 \end{cases}$$

Case 1: $0 \leq x < 1$

The differential equation is: $$\frac{dy}{dx} + y = 2$$

This is a first-order linear ODE. The integrating factor is: $$\mu(x) = e^{\int 1 , dx} = e^x$$

Multiplying both sides by $e^x$: $$e^x \frac{dy}{dx} + e^x y = 2e^x$$

$$\frac{d}{dx}(e^x y) = 2e^x$$

Integrating: $$e^x y = 2e^x + C_1$$

$$y = 2 + C_1 e^{-x}$$

Using the initial condition $y(0) = 0$: $$0 = 2 + C_1 e^0 = 2 + C_1$$ $$C_1 = -2$$

Therefore, for $0 \leq x < 1$: $$y(x) = 2 - 2e^{-x} = 2(1 - e^{-x})$$

Case 2: $x \geq 1$

For $x \geq 1$, the differential equation becomes: $$\frac{dy}{dx} + y = 0$$

The general solution is: $$y = C_2 e^{-x}$$

To find $C_2$, we use continuity at $x = 1$. From Case 1: $$y(1^-) = 2(1 - e^{-1}) = 2(1 - e^{-1})$$

For continuity at $x = 1$: $$y(1) = C_2 e^{-1} = 2(1 - e^{-1})$$

$$C_2 = 2(1 - e^{-1}) \cdot e^1 = 2(e - 1)$$

Therefore, for $x \geq 1$: $$y(x) = 2(e - 1)e^{-x}$$

Complete Solution

$$y(x) = \begin{cases} 2(1 - e^{-x}), & 0 \leq x < 1 \ 2(e - 1)e^{-x}, & x \geq 1 \end{cases}$$

Answer: (A)

Was this answer helpful?
0
0

Questions Asked in IIT JAM MA exam

View More Questions