33. $\frac{dy}{dx}+2y = f(x); y(0)=0,$ where $f(x)=\begin{cases}1, & 0leq xleq3\\0, & x > 3end{cases}$

33. $\frac{dy}{dx}+2y = f(x); y(0)=0,$ where $f(x)=\begin{cases}1, & 0leq xleq3\\0, & x > 3end{cases}$

33. $\frac{dy}{dx}+2y = f(x); y(0)=0,$ where $f(x)=\begin{cases}1, & 0leq xleq3\\0, & x > 3end{cases}$

Answer

Explanation:

Step1: Identify the type of ODE

This is a first - order linear ordinary differential equation of the form $\frac{dy}{dx}+P(x)y = Q(x)$, where $P(x) = 2$ and $Q(x)=f(x)$. The integrating factor is $\mu(x)=e^{\int 2dx}=e^{2x}$.

Step2: Multiply the ODE by the integrating factor

We get $e^{2x}\frac{dy}{dx}+2e^{2x}y = e^{2x}f(x)$. The left - hand side is the derivative of the product $e^{2x}y$ by the product rule, so $\frac{d}{dx}(e^{2x}y)=e^{2x}f(x)$.

Step3: Integrate both sides for $0\leq x\leq3$

Since $f(x) = 1$ for $0\leq x\leq3$, we have $\int_{0}^{x}\frac{d}{dt}(e^{2t}y(t))dt=\int_{0}^{x}e^{2t}dt$. Using the fundamental theorem of calculus on the left - hand side and integrating the right - hand side: $e^{2x}y(x)-e^{0}y(0)=\left[\frac{1}{2}e^{2t}\right]_{0}^{x}$. Given $y(0) = 0$, we get $e^{2x}y(x)=\frac{1}{2}(e^{2x}-1)$, so $y(x)=\frac{1}{2}(1 - e^{-2x})$ for $0\leq x\leq3$.

Step4: Integrate both sides for $x > 3$

Now $f(x)=0$ for $x > 3$. Let $x>3$, then $\int_{3}^{x}\frac{d}{dt}(e^{2t}y(t))dt=\int_{3}^{x}0dt$. So $e^{2x}y(x)-e^{6}y(3)=0$. First, find $y(3)=\frac{1}{2}(1 - e^{-6})$. Then $e^{2x}y(x)=e^{6}\times\frac{1}{2}(1 - e^{-6})=\frac{1}{2}(e^{6}-1)$, and $y(x)=\frac{1}{2}(e^{6}-1)e^{-2x}$ for $x > 3$.

Answer:

$y(x)=\begin{cases}\frac{1}{2}(1 - e^{-2x}),&0\leq x\leq3\\frac{1}{2}(e^{6}-1)e^{-2x},&x > 3\end{cases}$