36. $(1 + x^{2})\frac{dy}{dx}+2xy = f(x); y(0)=0, where\nf(x)=\begin{cases}x, & 0leq x < 1\\-x, &…

36. $(1 + x^{2})\frac{dy}{dx}+2xy = f(x); y(0)=0, where\nf(x)=\begin{cases}x, & 0leq x < 1\\-x, & xgeq1end{cases}$
Answer
Explanation:
Step1: Rewrite the differential equation
The given first - order linear differential equation ((1 + x^{2})\frac{dy}{dx}+2xy = f(x)) can be rewritten in the standard form (\frac{dy}{dx}+\frac{2x}{1 + x^{2}}y=\frac{f(x)}{1 + x^{2}}). The integrating factor (I.F.=e^{\int\frac{2x}{1 + x^{2}}dx}). Let (u = 1 + x^{2}), then (du=2xdx), so (\int\frac{2x}{1 + x^{2}}dx=\ln(1 + x^{2})) and (I.F.=e^{\ln(1 + x^{2})}=1 + x^{2}).
Step2: Solve the differential equation for (0\leq x\lt1)
The general solution of the linear differential equation (\frac{dy}{dx}+P(x)y = Q(x)) is (y\cdot(I.F.)=\int Q(x)\cdot(I.F.)dx + C). For (0\leq x\lt1), (Q(x)=\frac{x}{1 + x^{2}}) and (I.F. = 1 + x^{2}), so (y(1 + x^{2})=\int xdx=\frac{x^{2}}{2}+C). Using the initial condition (y(0) = 0), when (x = 0,y = 0), we get (0=\frac{0}{2}+C), so (C = 0). Then (y=\frac{x^{2}}{2(1 + x^{2})}) for (0\leq x\lt1).
Step3: Solve the differential equation for (x\geq1)
For (x\geq1), (Q(x)=\frac{-x}{1 + x^{2}}) and (I.F. = 1 + x^{2}). So (y(1 + x^{2})=\int - xdx=-\frac{x^{2}}{2}+C). To find (C), we need to ensure continuity at (x = 1). When (x = 1) from the left - hand side, (y=\frac{1}{2(1 + 1)}=\frac{1}{4}). Substituting (x = 1,y=\frac{1}{4}) into (y(1 + x^{2})=-\frac{x^{2}}{2}+C), we have (\frac{1}{4}(1 + 1)=-\frac{1}{2}+C), (\frac{1}{2}=-\frac{1}{2}+C), so (C = 1). Then (y=\frac{1-\frac{x^{2}}{2}}{1 + x^{2}}=\frac{2 - x^{2}}{2(1 + x^{2})}) for (x\geq1).
Answer:
(y=\begin{cases}\frac{x^{2}}{2(1 + x^{2})},&0\leq x\lt1\\frac{2 - x^{2}}{2(1 + x^{2})},&x\geq1\end{cases})